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(nuxt): support basic slots on server only components #19851
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
ATM this PR is only working in dev mode. However #19911 which fixes the server only components re-rendering (by using a key to force the static vnode to re-render) introduce another issue (in build). The current Implementation of NextJS (did not dig too much into it) does not allow client-side interactivity. Or maybe using a Edit: found a fix π π |
β¦ands" This reverts commit 49a0f51.
772e3a9
to
f99cdf7
Compare
β Live Preview ready!
|
this is absolutely awesome! π played around with the branch a bit today and it works as I would expect it to work. but since server components are experimental anyways, this is a major improvement and such limitations can be addressed incrementally in the future
|
Thank you ! About scoped slots, i think this can be done. I'll do something about it in the incoming week (won't have a lot of time) with another PR I'll update the docs about theses limitations. |
β¦-julien/nuxt into feat/slot-server-component
b23a72e
to
8f4395e
Compare
β¦-julien/nuxt into feat/slot-server-component
I feel like this PR can be closed since #20284 includes and goes beyond this PR for slot support (since it is forked from this one) |
π Linked issue
resolve #19765
resolve #19884
β Type of change
π Description
Hi π
This PR is currently in progress (draft to keep tracking my progress on it)
This PR allow to have slots with server only components.
Slots also works in SSR for pages !
Currently the only way to simulate a slot is to render a container tag, however it needs a
display: contents
which seems just a bit buggy atm in some cases but we still need it to ignore the container tag box, maybe will it be fixed one day.see: https://caniuse.com/css-display-contents
How does this work ?
This introduce changes to
<NuxtIsland>
,<IslandRenderer>
, server components and to the nitro renderer./NuxtIsland
<NuxtIsland>
islandRenderer
are now uniqueIslandRenderer
IslandRenderer
NuxtIsland
to teleport its slotsπ Checklist and TODO
related to the branch
related to PR
fixtures