-
Notifications
You must be signed in to change notification settings - Fork 792
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
bug: Hydrate SSR Issue – Incorrect order of children elements after renderToString() #5198
Comments
Thanks for the issue! This issue has been labeled as In the meantime, please read our 2023 Winter Holiday Triage Guide for information on how to ensure that your issue is triaged correctly. Thank you! |
Hey @natgerost 👋 I've confirmed the issue and updated the label for this to get ingested into the Stencil backlog. Thanks for reporting! |
@natgerost thanks for providing the reproducible example. Unfortunately it doesn't allow me to re-build the project using the latest Stencil version. We have been doing a lot of bug fixes around server side rendering of Stencil components. I would love to validate if this issue still exist with the latest Stencil version. Can you provide something that allows me to reproduce the bug and allowing me to build the project as well? |
Thanks for the issue! This issue has been labeled as Please reproduce this issue in an Stencil starter component library and provide a way for us to access it (GitHub repo, StackBlitz, etc). Without a reliable code reproduction, it is unlikely we will be able to resolve the issue, leading to it being closed. If you have already provided a code snippet and are seeing this message, it is likely that the code snippet was not enough for our team to reproduce the issue. For a guide on how to create a good reproduction, see our Contributing Guide. |
@natgerost thanks again for raising this issue. A patch was applied for this bug which will be released as part of Stencil |
A fix for this was released in Stencil |
Prerequisites
Stencil Version
4.9.0
Current Behavior
Stencil's
renderToString()
function results in the incorrect ordering of elements in the DOM.Rendering custom components with
renderToString()
results always in this order (Tab6, Tab4 Tab2 ..):
Until client-side hydration occurs, the tabs are displayed in the incorrect order, impacting the visual experience, especially when the ESM script loads slowly.
Upon the client script loading, a repaint operation occurs, which triggers the ”flashing” issue:
Expected Behavior
The order of children should remain as defined before
renderToString()
System Info
No response
Steps to Reproduce
Issue can be observed in provided repository, using older version of Stencil. However it was also tested with 4.9.0.
Reload the page multiple times to see the "flashing" effect of re-ordering. Or add network throttling to slow down the loading of ESM script.
Code Reproduction URL
https://gitlab.ost.ch/stencil-ssr-research/basic-setup-with-express
Additional Information
Current workaround with CSS-Grid
The text was updated successfully, but these errors were encountered: