framework
framework copied to clipboard
feat(nuxt): server-only components
🔗 Linked issue
- Pending: https://github.com/nuxt/framework/pull/5689 (Implements: https://github.com/nuxt/framework/discussions/666)
- Resolves https://github.com/nuxt/framework/issues/648
❓ Type of change
- [ ] 📖 Documentation (updates to the documentation or readme)
- [ ] 🐞 Bug fix (a non-breaking change that fixes an issue)
- [ ] 👌 Enhancement (improving an existing functionality like performance)
- [x] ✨ New feature (a non-breaking change that adds functionality)
- [ ] ⚠️ Breaking change (fix or feature that would cause existing functionality to change)
📚 Description
Summary
This PR adds support for:
- rendering individual components through a special GET request to
/__nuxt_render(implementing RFC https://github.com/nuxt/framework/discussions/666) - registering and rendering server components with
.server.vuesuffix (implementing https://github.com/nuxt/framework/issues/648), including injecting scripts + styles from this render back into client-side DOM. As part of this, we only build CSS from server-components into client build (which is required), meaning the code from server-components won't be present in your client bundle.

Next steps
- [ ] The key next step is to review to see if we want to make any changes to RFC or spec.
- [ ] Update documentation with details about server (+ client) components
Future improvement ideas
- 'Batching' server component updates
- Detect 'dependencies' of server components so entire state doesn't need to be pushed
- Detect 'effects' of server components so entire state doesn't need to be returned from renderer
- Move server-only component CSS out of manifest (but this can also be handled as part of solution to https://github.com/nuxt/framework/issues/4475)
📝 Checklist
- [x] I have linked an issue or discussion.
- [ ] I have updated the documentation accordingly.
Deploy Preview for nuxt3-docs canceled.
| Name | Link |
|---|---|
| Latest commit | 345e9c40946f3b49fdac66854c3021c3f1bd43f0 |
| Latest deploy log | https://app.netlify.com/sites/nuxt3-docs/deploys/62bed304f120080008b6c557 |
Happy to review when not in draft anymore (cannot wait BTW!)
:+1: This is waiting for merge of https://github.com/nuxt/framework/pull/5689.
Will this be included in rc14?
This is waiting on https://github.com/nuxt/framework/pull/5689.
This is waiting on nuxt/framework#5689.
not anymore :)
any progress ?
So this is coming in 3.1? When should we expect to be able to start trying this out?
3.1 will be coming imminently. 👀
But you can always try things out in the edge channel, and in fact we really appreciate people testing the edge to catch regressions early.