Closed
Description
This would allow for automatic data prefetching (for example with apollo) on the server.
Ideas:
waitCounter = 0
- mount the App and render the whole component tree
- user/lib code can hook into
renderToString
withthis.waitForPrefetch()
(waitCounter++
) - if
waitCounter
is0
, resolverenderToString
- else, we wait for user/lib code that should call
this.prefetchDone()
after fetching data- we re-render the component
- eventually code in children can call
this.waitForPrefetch()
again - then
waitCounter--
- then if
waitCounter
is0
we resolverenderToString
- a re-render could trigger new
this.waitForPrefetch()
(maybe make this parametrable, likemaxReRenders
) <NoSSR>
component prevents both server-side render and async prefetching- some way of skipping a component (and its children) only for async prefetching, like a
skipPrefetch () { return this.myProp }
option?
Metadata
Metadata
Assignees
Labels
No labels