Skip to content

RFC: Server-Side Features#825

Draft
ubugeeei wants to merge 1 commit intovuejs:masterfrom
ubugeeei-forks:server-side-props
Draft

RFC: Server-Side Features#825
ubugeeei wants to merge 1 commit intovuejs:masterfrom
ubugeeei-forks:server-side-props

Conversation

@ubugeeei
Copy link
Copy Markdown
Member

@ubugeeei ubugeeei commented Mar 6, 2026

WIP!

By the way, Evan announced VOID in the keynote at VueJS Amsterdam, and it included several server-side features.
With the stabilization of Suspense in mind, it seems worthwhile to further discuss Vue’s server-side capabilities in terms of the VOID backend, Vue’s semantics as a DSL, and runtime-level handling.

My RFC is still far from being thoroughly reviewed, and if there are any new ideas, I would love to discuss them with the team.

@posva
Copy link
Copy Markdown
Member

posva commented Mar 6, 2026

I don't think this makes sense as a core feature in vue because in order for it to be useful it requires build-time optimizations that can strip off the runtime code from the client. Because of this, opinionated solutions (like Nuxt) seems to be a better fit

@ubugeeei
Copy link
Copy Markdown
Member Author

ubugeeei commented Mar 6, 2026

This is still a work in progress, but similar to RSC, there seem to be cases where it would be useful for Vue to have non-hydrating components that run only on the server side (including at build time).
Also, meta frameworks such as Nuxt could potentially build on top of that foundation.

@ubugeeei
Copy link
Copy Markdown
Member Author

ubugeeei commented Mar 6, 2026

Also, I’m not a fan of use server or use client.
Since Vue is a DSL, if we could provide first-class support through something like custom blocks or compiler macros, we might be able to cover these use cases.

@ubugeeei
Copy link
Copy Markdown
Member Author

ubugeeei commented Mar 6, 2026

This feature is also related to Suspense.
Providing first-class support for async resolution like defineServerSideProps, including at the runtime level, should be quite valuable.
If the argument is that it’s sufficient for Nuxt to wrap such features, then things like Suspense shouldn’t be included in Vue’s core either.
#822

@ubugeeei ubugeeei changed the title feat: server side props Server-Side Props Mar 7, 2026
@ubugeeei ubugeeei changed the title Server-Side Props RFC: Server-Side Props Mar 7, 2026
@asip
Copy link
Copy Markdown

asip commented Mar 10, 2026

I don't think it's smart to introduce defineServerSideProps for server-side data fetching and separate client-side and server-side concerns.

If <script server> is introduced for server functions, then instead of introducing defineServerSideProps for server components, it would be smarter to use <script server setup> for server components.

I feel that defineServerSideProps is too heavily influenced by Next.js's getServerSideProps.

@ubugeeei
Copy link
Copy Markdown
Member Author

My intention is to take advantage of the semantics where Vue has compiler-informed mechanisms through defineXXX, and use that as a foundation to bring in things like Next.js-style reserved export words and React-style directives within Vue’s own semantics.

Rather than being strongly inspired by those API shapes themselves, it is closer to using Vue’s ability to introduce its own semantics as a trump card, and cleanly organizing APIs that other ecosystems are forcing onto plain JavaScript syntax.

@ubugeeei ubugeeei changed the title RFC: Server-Side Props RFC: Server-Side Features Mar 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants