[✨] Opt-out streaming #133
Replies: 6 comments
-
|
I think this can't be done easily, because the SSR code assumes that the components will not be rerendered. I might be wrong. If it was easy to support it would make an interesting feature, although I think all the examples you give are better solved in other ways. |
Beta Was this translation helpful? Give feedback.
-
|
@GrandSchtroumpf I'm looking at the SSR code and what you want would require a complete rewrite, so it would be extremely unlikely. |
Beta Was this translation helpful? Give feedback.
-
|
I just realized that opt-out streaming is possible by running regular Qwik on JSDom on the server, and then pausing the container. That would be possible as a standalone package. |
Beta Was this translation helpful? Give feedback.
-
|
That would be amazing ! Qwik would work the same in web & server (modulo differences between DOM & JSDom). const { window } = new JSDOM('');
render(window.document, <Root />, opts) |
Beta Was this translation helpful? Give feedback.
-
|
Seems to me that you have to await the result and then clean up the subscriptions, and then you can call root.pause() and read the outerHtml to get the container. https://qwik.builder.io/api/qwik/#render It wouldn't be efficient but for generating SSG that's ok |
Beta Was this translation helpful? Give feedback.
-
|
We moved this issue to |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem?
A lot of issues in Qwik seems to be related to streaming because we cannot update items that have been already rendered and sent to the client.
I think streaming is a good feature, but it comes at a high price. And sometime we don't need streaming at all, like with SSG.
Streaming is currently preventing us to update context at render time, which has a huge impact on how we built the app:
routeLoader$(which also come with side effects) [🐞] Document head/title set from inside a component does not work in SSR qwik#4712Describe the solution you'd like
The function
renderToStringshould not userenderToStreamunder-the-hood.Renderer should wait for DOM to be stable with a timeout to avoid infinity loop a little bit and angular universal is working.
Describe alternatives you've considered
Not updating the context at render time
Additional context
No response
Beta Was this translation helpful? Give feedback.
All reactions