Skip to content

create demo for streaming render - #280

Closed
JoviDeCroock wants to merge 7 commits into
streaming-renderfrom
streaming-demo
Closed

create demo for streaming render#280
JoviDeCroock wants to merge 7 commits into
streaming-renderfrom
streaming-demo

Conversation

@JoviDeCroock

@JoviDeCroock JoviDeCroock commented Feb 24, 2023

Copy link
Copy Markdown
Member

This currently contains the bug that we correctly stream in but when the hydration continues we wipe the Suspense state with nothing and after 3 seconds replace it with the Counter content.

Another peculiar thing is that if we comment out the entry-client.jsx code that after the Counter resolves on the server the loading... boundary gets replaced with.. nothing

#259

@changeset-bot

changeset-bot Bot commented Feb 24, 2023

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: bd73505

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment thread src/lib/client.js
while (d.firstChild) e.parentNode.insertBefore(d.firstChild, e);

d.parentNode.removeChild(d);
requestAnimationFrame(() => {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread demo/src/entry-client.jsx Outdated
// import { hydrate } from 'preact';
// import { App } from './App';

// hydrate(<App />, document);

@JoviDeCroock JoviDeCroock Feb 24, 2023

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is currently commented out, uncommenting this will make the CommentNode dissapear for the closing comment and hence kill island-appends

@developit

Copy link
Copy Markdown
Member

@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.

@JoviDeCroock

Copy link
Copy Markdown
Member Author

@developit The wiping stopped happening when we supported comments in Preact, I used the open PR we have and then everything worked correctly.

@JoviDeCroock
JoviDeCroock deleted the streaming-demo branch March 30, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants