Repository navigation
Void Server Components RFC - #871
kossnocorp wants to merge 1 commit into
Conversation
🚀 Deploying Preview to Cloudflare 🚀Preview URL: https://server-components-void-cloud.voidzero-docs.workers.dev (commit 469aab0)This URL reflects your latest Preview deploymentPreview Deployments by commit
|
|
Hey @kossnocorp ! This is super interesting. The follows are my thoughts:
|
|
@yusukebe thank you for the feedback!
Yeah, sorry I didn't see
Definetely!
I loved how easy it was to implement it using
I think islands would be the most logical way to go. I at least would be pleased if I could stick to static and add sprinkles of JS where needed for docs and such. But switching is also fine since Hono JSX is pretty standard, and we can even provide a skill to help the transition. |
|
Thanks! Also, I haven't measured it yet, but I think the server-side bundle size will be much smaller than React or other libraries. |
|
I like the idea behind this proposal, but I'm a little concerned about using Hono JSX as a foundation for Void. While looking through the Hono JSX source code, I noticed several potential bugs and design issues. I appreciate the ongoing fixes, but I'm still unsure whether it's mature enough for Void to rely on long-term. I'm especially concerned about My main concern is that these issues could become significant technical debt for Void over time. It might be worth exploring other approaches, including a solution designed specifically for Void, before committing to Hono JSX. |
This PR is a follow-up for the discussion with @cpojer in #843. It also overlaps with #731 by @yusukebe that implements Hono JSX adapter but takes different direction.
It is a proposal to add built-in Void Server Components that would allow exporting a JSX component from
pages/**/*.server.tsx. The implementation is based onhono/jsxand enables server-only rendering without any client JS or even installing a view framework such as React or Vue.The body of the component becomes the loader:
But explicit loaders are also supported, so the API is consistent.
It also supports all the regular page features like
layout,prerender, CSS, error pages, etc.The idea is to provide a complete experience out-of-box and allow users build static pages before opting into using a heavier view framework.
The PR doesn't cover using islands and include client components yet. If we have an agreement on direction, we should definitely think it through how to approach it and provide great DX for people mixing server and client components without falling into the same traps as Next.js did.