- Daishi Kato's Read the Code
- Posts
- Waku Gains Vite RSC Support
Waku Gains Vite RSC Support
It Was a Long Journey to Get Here
Hi,
I’ve been developing Waku for about 2.5 years now. Waku is a minimal React framework focusing on React Server Components. When I started building it, there was no tech stack I could rely on. I began with a naive Node.js solution using two workers, because the second worker was required to handle the react-server
condition.
Moving to a single JS runtime
Later, I wanted to avoid a Node.js dependency, and moved to code transformation so that everything could run on a single JS runtime, not necessarily Node.js. That’s when Hono and Vite came into the picture.
At that point, Waku’s dev server still used two Vite processes for the react-server
condition.
Vite’s RSC plugin to the rescue
The long-awaited breakthrough arrived with Vite’s official RSC plugin, including the Environment API. With the Environment API, Waku’s dev server runs on a single Vite instance, and all bundler-specific features are provided by the RSC plugin. This was a great move, because my motivation was never about bundler internals, even though we spent several years building our own Vite-based bundler to support RSC.
Waku’s core and what’s next
With Vite handling RSC natively, most bundler-specific logic lives outside of Waku itself. Waku’s core is now just a minimal API layer. Beyond this core, Waku provides:
a handy CLI
an extensible server
an opinionated router based on the minimal API
Now that Vite handles RSC, we can explore more features around React Server Components.
Happy coding.
Reply