React Server Components has a minimal framework called Waku, which means “frame or framework” in Japanese. Although not recommended for production yet, the authors say it is ready for developers who want to experiment with RSC's capabilities.
In addition to Waku, Daishi Kato created Zustand (a state management library for React applications) and Jotai (another state management tool for which he built a library). Waku is being actively developed towards production level, he said.
“At this point, you're ready to try it out. That means you can try and learn how RSC works, implement new apps with RSC functionality, or try migrating existing apps to Waku. We can,” Kato told The New Stack. “However, as the API is still subject to change, we do not officially recommend it for use in production environments yet.”
Why use another JS framework?
Another JavaScript framework. However, this React-specific framework serves some specific purposes.
“I want to learn RSC, and RSC is often tied to other features within a framework,” Kato explains. “I want to separate them, and I hope this will help people learn and understand the RSC.”
Developers also want a minimal framework, he said, adding that React's use cases are wide-ranging.
“SPA remains one of the key use cases,” he said. “A richer framework provides more functionality that is not needed in a SPA.”
Additionally, Kato wanted to add RSC support to Zustand and Jotai. He didn't want to wait for other frameworks to create that opportunity, so he decided to create his own.
According to the Bytes newsletter, the JavaScript framework Next.js supports RSC, but the minimal API is tied to specific routers. This is an important issue because RSC does the rendering on the server. Because Waku is not tied to a specific router, Bytes explains, he can do more experimentation from the rest of the React ecosystem, and because Waku is built on top of his Vite. , added that there are no node-dependent APIs.
“RSC still relies on frameworks, or at least bundlers, for implementation. However, frameworks introduce RSC in addition to existing static site generation (SSG) and server-side rendering (SSR) capabilities. This makes learning and experimenting with how to develop applications and libraries using only RSC features a little more complex,” Kato explained. This is a site about and developed by Waku.
Waku allows developers to explore core RSC features and RSC best practices “independently from traditional SSG/SSR strategies, which are optional opt-in features,” he wrote.
But what developers learn about RSC using Waku should be transferable to other frameworks, he told The New Stack.
“The good news is that Waku's original API is very minimal, so much of what you learn about RSC is common between Waku and other frameworks,” he said.
Contents of work
To use Waku, developers must be familiar with React and have a basic understanding of RSC. Both can be obtained from the React and Next.js documentation, he said.
Bytes pointed out that Waku provides a server API, a client API, and routing that comes with an optional client-side router and server-side router.
Kato wasn't interested in building a bundler, so he did what other JavaScript frameworks are starting to do and turned to Vite, a local development server.
“Vite is a bundle and is quite scalable,” he said. “Vite also provides a development server, which is also a fundamental feature to improve your DX.”
Waku allows developers to experiment with RSC outside of Vercel, which manages Next.js. Vercel sponsors Waku via GitHub, allowing you to deploy it on Vercel's platform.
“Vercel supports the deployment of any front-end framework,” Kato writes on Waku's site. “We can use their Build Output API to generate output from Waku and deploy it to Vercel.”
Waku is open sourced under the MIT License. The documentation is still under construction, but there is a discussion on GitHub and his Discord link in the menu of the Waku site where developers can learn more.
YouTube.COM/THENEWSTACK
Technology moves fast, so don't miss an episode. Stream all our podcasts, interviews, demos, and more by subscribing to our YouTube channel.
subscribe