create demo for streaming render - #280
Conversation
|
| while (d.firstChild) e.parentNode.insertBefore(d.firstChild, e); | ||
|
|
||
| d.parentNode.removeChild(d); | ||
| requestAnimationFrame(() => { |
There was a problem hiding this comment.
This fixes a bug where the app server-side renders the whole document, we have to wait for the d.children to actually be populated which is an afterFrame
| // import { hydrate } from 'preact'; | ||
| // import { App } from './App'; | ||
|
|
||
| // hydrate(<App />, document); |
There was a problem hiding this comment.
This is currently commented out, uncommenting this will make the CommentNode dissapear for the closing comment and hence kill island-appends
de977ec to
a621153
Compare
|
@JoviDeCroock do you know if the wipe issue you mentioned might be due to the Suspense fallback/timeout we have in compat? That makes me wonder if we should do a version of this demo using lazy()+ErrorBoubdary preact-iso, since they never render a fallback. |
|
@developit The wiping stopped happening when we supported comments in Preact, I used the open PR we have and then everything worked correctly. |
This currently contains the bug that we correctly stream in but when the hydration continues we wipe the
Suspensestate with nothing and after 3 seconds replace it with the Counter content.Another peculiar thing is that if we comment out the
entry-client.jsxcode that after the Counter resolves on the server theloading...boundary gets replaced with.. nothing#259