Skip to content
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

feat(runtime-core): support hydration of all custom element properties #8038

Conversation

steveworkman
Copy link

Resolves #7203 by checking for the presence of a custom element in the custom element registry and allowing that to be hydrated with vue properties.

Ideally, I'd use the isCustomElement compiler option - however, that is not available at runtime. This is the next best thing - however, it could potentially hydrate more components than the user intended if they have not specified all of their custom elements in the isCustomElement function.

This is required for hydration to function correctly in prashantpalikhe/nuxt-ssr-lit#34

This PR superceedes #7300 & #8035 as those got out of sync with main

@vercel
Copy link

vercel bot commented Oct 3, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Updated (UTC)
sfc-playground ⬜️ Ignored (Inspect) Visit Preview Oct 3, 2023 0:10am

@yyx990803
Copy link
Member

Thanks for the PR - relying on compilerOptions.isCustomElement is not going to work for projects that use the build step to pre-compile templates. However, we can simply check for the presence of - in the tag name for custom elements. See 7d473b7 (partially reused the test from this PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Rejected
Status: Done
Development

Successfully merging this pull request may close these issues.

Custom element's props are not applied on the client side when they are SSR-ed
3 participants