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. |
|
Thank you for the comment! Regarding it, I have an option that I will sort out by tomorrow. Please wait a bit. |
|
@kossnocorp @kotarotaniguchi0523 First, I say again that I agree with the direction of this PR. I think we should move forward with this PR instead of #731 and #843. This means focusing only on server-side rendering and providing built-in views using Hono JSX. As @kotarotaniguchi0523 pointed out, the quality of As a side note, if we want to add client-side interactivity, such as Islands, in the future, we could use a simpler mechanism like Signals instead of React-style hooks. I think this would help us keep the implementation simple and maintain good quality. So, how about moving forward with this PR? @kossnocorp |
|
@yusukebe Great!
I don't think it's a problem, and we will simply fix any bugs in Hono JSX we will find. It will be a new addition to Void, so we don't risk anything for existing users. If you need, I'm happy to help with Hono and its JSX module.
I agree, good think we don't have to commit to any interactivity implementation right now and keep our options open.
Let's do this! I can work on polishing its implementation and docs. You are also welcome to take over or reimplement it as you sit it fit, as you know Hono better than any of us. Just tell me. |
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.