-
Notifications
You must be signed in to change notification settings - Fork 192
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
revert(#434): use getSlidesVNodes utility to extract slides to be clone #443
Conversation
The change was found to cause issues during static site generation processes, particularly with frameworks like VitePress.
Could you please review this PR @Tofandel? |
Did you check that this would solve it? It looks to be more of a SSR issue, where the generated stuff SSR does not match what is generated on mounted, I'm not sure this would fix this From what I see the cloned vNodes are not rendering properly SSR (before mount), they are comments And because vue's hydration policy dictates that hydration mismatch should not update, they do not get mounted after that |
I think we should disable the cloned vNode until the mount hook which would solve the hydration mismatch issue I'll add a SSR test case to the test suite |
Yes, this solution resolves the issue. You can verify it by building the documentation, as the problem occurs specifically during the build process. I don’t believe that disabling clones until the component is mounted would address the issue. From my observations, the carousel goes through two rendering phases: Since VitePress processes the HTML markup during static site generation, it only captures the initial render, which excludes the cloned slides. This discrepancy leads to the problem during build time. |
The problem with getSlidesVnodes was that it was not working properly with Slides passed through a slot, which was why #434 was needed The reason is that from a slot we are not getting a Fragment, we are getting this
It's actually the only way to properly fix the discrepancy with SSR, clones should only be added in the nextTick after mount Here is a test case, that will fail with getSlidesVNodes
The second test should fail with hydration mismatch I'm implementing a proper fix in #444 with those tests |
Closed in favor of #444 |
The change was found to cause issues during static site generation processes, particularly with frameworks like VitePress.
By reverting this, we restore compatibility with static file generation workflows while maintaining functionality for existing use cases.
Closes #442