TNS
VOXPOP
Where are you using WebAssembly?
Wasm promises to let developers build once and run anywhere. Are you using it yet?
At work, for production apps
0%
At work, but not for production apps
0%
I don’t use WebAssembly but expect to when the technology matures
0%
I have no plans to use WebAssembly
0%
No plans and I get mad whenever I see the buzzword
0%
Frontend Development / JavaScript / Software Development

JavaScript in 2023: Signals, React’s RSC, and Full-Stack JS

More JavaScript frameworks adopted Signals in 2023; while in the React world, React Server Components found their footing.
Dec 21st, 2023 8:54am by
Featued image for: JavaScript in 2023: Signals, React’s RSC, and Full-Stack JS
Image by Diana Gonçalves Osterfeld

The big news for JavaScript in 2023 was the broader adoption of Signals by frameworks and, in the React world, React Server Components (RSC).

The number of meta frameworks that leverage Signals continue to grow, said Solid creator Ryan Carniato. Angular introduced Signals in May with version 16. Preact and Qwik had already adopted Signals and Vue also has signals-based rendering, Carniato said. And recently, Svelte 5’s previews show that the framework will also adopt Signals-based rendering, he added.

“The whole JavaScript ecosystem, minus React, moved to Signals — so big, big topic,” Carniato told The New Stack.

Meanwhile, React developers took the year to explore RSC, he added.

“In the React World, the big topic was Next.js and react server components,” he said. “We saw the core team come out and actually do a lot of talks and come to a lot of events this year, which we hadn’t seen in a few years, to actually engage [with] the community.”

Signals Catch on

Signals are reactive primitives that manage application states. Signals allow developers to easily manage and respond to changes in their applications. The addition of Signals has the potential to revolutionize the way developers approach reactive programming and make it more accessible to a wider range of developers, frontend developer Alyssa Nicoll told The New Stack earlier this year.

Signals consist of “a getter, setter, and a value,” Carniato explained in a 2021 article. Signals historically have also been called Observables, Atoms, Subjects, or Refs, he noted. They work in tandem with Reactions, which are also called Effects, Autoruns, Watches, or Computeds. Reactions observe Signals and re-run them every time their value updates, he explained.  “The important thing is these Signals can carry any sort of data and the reactions can do anything with it,” he wrote. The updates happen synchronously, he added. “Before we can log the next instruction the Reaction has already run.”

His blog post explains it in more detail and with code, but essentially, Signals and Reactions give developers the pieces they need to create fine-grained reactivity, he said.

React Server Components

Eli White, engineering manager on React, agreed that the big news for React in 2023 was the RSC.

“In 2023, we’ve loved seeing the community embrace React Server Components,” White told The New Stack. “RSCs have been a major change for most people to what they think of as the scope of React; from just a UI layer, to having more of an influence on the way you architect your application for the best user and developer experience — especially for applications where SPAs [single page applications] weren’t good enough. In 2024 I expect to see more framework adoption of RSCs, bringing this capability to more developers.”

This year, Next.js provided one path forward with its new app server, which supports React server components and server actions.

“By far the largest thing in the past year of Next JS was the stabilization of the app router,” said Lee Robinson, head of product at Vercel, which created Next.js. “We wanted to build a new foundation that, at the same time, supported the existing pages router and can live simultaneously. That would allow developers to incrementally move over to some of these new features and performance improvements that we want to land without causing a big ecosystem shift.”

React server components try to take the best parts of the client model React has and merge that with taking advantage of the server for streaming UI, Robinson explained. That gives developers the ability to show users something faster and prevents sending additional JavaScript to the client — which can be important for those on slower networks or lower-powered devices, he said.

It’s not about choosing one approach over another, he added.

“It’s not all server/no client or all client/no server,” he said. “The model invites both and wants both.”

There are few good reasons not to try React server actions and RSC, argued Andrew Clark, a software engineer at Vercel. For instance, if you aren’t running JavaScript on your server, that would be a good reason not to embrace RSCs — although, he also suggested developers reconsider that choice. He’s not the only one who thinks JavaScript is ready for the backend.

Full-Stack JavaScript

JavaScript is becoming more of a full-stack language, according to Ed Huang, CTO at distributed SQL database company PingCAP.

“It’s not just for those frontend party tricks anymore,” Huang said. “The rise of full-stack JavaScript, particularly Node.js, has blurred the lines between front and backend development, permitting the use of a single language across the board.”

“Moreover, the advent of JavaScript-friendly serverless hosting platforms grant developers rapid development and deployment, alongside real-time previews, vastly improving the dev experience,” Huang added. “These tools and technologies have bolstered the JavaScript ecosystem, positioning it as one of the most productive and creative tech landscapes.”

Group Created with Sketch.
THE NEW STACK UPDATE A newsletter digest of the week’s most important stories & analyses.