-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(nitro): support for rendering ssr teleports to body #3909
Conversation
β Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
This is a nice initiative, however obviously not best solution using cheerio nor vue3 seems have a proper solution for SSR teleports right now. It would be nice if we could have a limited parser (maybe #id only selectors) to do a quick replacement? Before that, it would be nice having a section in docs for Teleports to mention usage limitations and workaround. Ideally by moving this feature to nitropack, we could make a nitro plugin, and start support teleport behind a flag to avoid overhead when not needed bit nice to try here in meantime. Another note: If ever we want to start supporting streaming, SSR teleport would be a problem. Which is why thinking focusing on docs and stable client-only support would worth. |
Agreed. Maybe, priority list of:
For anyone else's reference, teleport SSR support is up to frameworks to implement: see vuejs/core#3869 (comment). |
Small side-node regarding the client-only solution: it would be amazing if the |
I've adapted this PR for an ultra-minimal support for teleports, using the existing template. I think that this is a reasonable approach to include out-of-the-box, with more advanced use cases to be developed under a flag later on. (Given that teleports are meant to be outside the Vue app, the body target should cover most use cases, with the client-only approach being an escape hatch only...) |
π Linked issue
resolves nuxt/nuxt#12766, nuxt/nuxt#13431
β Type of change
π Description
This PR adds support for using teleports in Nuxt 3, including an example based on https://vuejs.org/guide/built-ins/teleport.html.
π Checklist