-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspensed parts of page and moving styles to top #69
Comments
There could be an option to inject a little piece of script after every injected style to move it to the top, but it likely will only cause extra re-renders and make things slow. AFAIK streaming response should still wait for the stream to end before starting hydration as "opened tags should be closed". |
That might be the only option. I want to try. Fortunately, still, some of the styles will still be moved to the head from non-streamed/non-suspended part of the application before hydration.
I mean components inside with async logic inside. We looking for INP (interaction to next paint) improvements. We wanna push the header, footer, and some other parts of the page, to be interactive (and move styles before hydration) and not be blocked for the heavier part of the app rendered later, after hydration. |
The solution was simpler than we though. So, each streamed component, outside of lifecycle (means ever render/re-render) checks if any styles to move exist, if so, it moves them to head. If don't, do nothing. We still developing streaming rendering so it's not tested on production yet, but so far so good ;)
|
Wondering what calls the code that calls |
Hi,
We want to introduce streaming rendering and suspended components to our application.
And we cannot handle the hydration process well.
The library's documentation mentions the strategy of moving styles to head just before hydration. However in the case of suspended/streamed components, we are already in the hydration process, so how we can move those styles if even its possible?
Thanks
The text was updated successfully, but these errors were encountered: