-
Notifications
You must be signed in to change notification settings - Fork 648
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
server side rendering - any way to get state for non 'top level' components serialized ? #1018
Comments
Is the await data not being passed as input to another tag? Or is just rendering it in place? It would be helpful if you could show an example :) |
So are top level components within an My await data was being rendered in place, however I can always split the component into two. This may be a solution, however I think there is still an issue with the Uncaught Error: Tried to render async while in sync mode. Note: Client side await is not currently supported in re-renders (Issue: #942). |
And to provide some context, here is an simple example I setup : PromiseParentWithWait.marko
PromiseChildOfWait.marko
Now, putting issue: #942 aside for now, if you statement that children of
|
The |
I am rendering components on the server that use
<await>
to pull in additional data to use when rendering.One of these components is not a top level component and therefore its state is not serialised to the browser. So when the component is rendered in the browser the first time it has to fetches the data from the server. While fetching, the UI is in a degraded state - showing partial content - infact less content than was shown when it was rendered on the server
I'm not quite sure how to solve this. Getting the component state serialized and re-constructured via require('marko/components').init(); would be a neat solution.
I've tried hacking it into global state, however due to the use of the await tag, the global data is serialised before the components within the
<await>
tag are resolvedThe text was updated successfully, but these errors were encountered: