-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(components): .client.vue
/ .server.vue
convention
#1919
Conversation
βοΈ Deploy Preview for nuxt3-docs canceled. π¨ Explore the source changes: 399f944 π Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6232552869a46b0008f21714 |
.client.vue
/ .server.vue
convention
Hi @antfu do you mind to fix merge conflicts? |
For the bundle optimization, for now, I can see two ways of doing it:
Do you have any idea on them? Thanks |
Some improvement suggestions:
|
My initial idea is that
I'd love to, but I guess that's more like the initial approach that we faced the hydration errors - and that's why we introduced the |
Guess what, I made it work! πd093fa9 - Pushed to this branch |
hello, when it will be merged?? |
Co-authored-by: Wolfgang Hobmaier <[email protected]>
β¦xt/framework into feat/client-server-components
Marked as draft Global mode probably won't work due to the latest refactor of how components been resolved. Working with @danielroe on this. |
Resolved :) |
New conflicts again π What do we do about this PR? If agree, I think next step if to update the docs in https://v3.nuxtjs.org/docs/directory-structure/components#clientonly-component in order to merge. |
I think will finally have to rework this PR. Idea is nice but implementation needs to be revised with simpler component options. |
Thank you again @antfu for working on this. Since PR is stalled with conflicts and I expect a simpler interface for implementation, let's track this via nuxt/nuxt#11884. We are also closer with nitro to support server-only components π€πΌ |
π Linked issue
nuxt/nuxt#11884
Continues from #1853
β Type of change
π Description
This PR bring
.client.vue
and.server.vue
conversion for components directly. This PR is focus on.client.vue
client only components with optional.server.vue
as SSR fallback. Server-only components will be left to future PRs.How it works
When we do the component scanning, components with suffixes will be treated as one component entry with two file paths. Then we create a virtual component using templates with the wrapper by
<ClientOnly>
. This way we could use the component as normal but be able to do environment-specific logic.Progress
.server.vue
and.client.vue
π Checklist