Dev News: React 19 Beta and Redwood Tests React Server Components

React 19 beta released Thursday and it includes all of the React Server Components features from the canary channel.

New features in this beta include:

The team also explained a bit more about React Server Components. They are a new option the “allows rendering components ahead of time, before bundling, in an environment separate from your client or SSR server,” the team wrote. The separate environment is the “server” and server components can run once at build time on a CI server or they can be run for each request using a web server, the team explained.

“This means libraries that ship with Server Components can now target React 19 as a peer dependency with a react-server export condition for use in frameworks that support the Full-stack React Architecture,” the team noted.

While React Server Components are stable and won’t break between major visions, alas the underlying API used to implement the components bundler or framework “do not follow server and may break between minors in React 19.x,” the team wrote.

“To support React Server Components as a bundler or framework, we recommend pinning to a specific React version, or using the Canary release,” the blog post about the release stated. “We will continue working with bundlers and frameworks to stabilize the APIs used to implement React Server Components in the future.”

Redwood.js Tests React Server Components

While we’re on the topic, Redwood.js, a JavaScript framework, is tinkering with React Server Components by building out documentation. Redwood.js added support for the components in late March.

The team wanted to see how it’d be to build out a documentation site with React Server Component. The resulting document app is called Docwood. They set the following requirements for the project:

The team explains how to create a new Redwood app from scratch and how to handle routing and navigation. They found that the application was relatively fast considering how much computation is happening under the hood.

“RSC is still being actively developed and new features added every day, so we expect the experience to improve quite a bit between now and the real release of RedwoodJS Bighorn,” the team wrote.

TypeScript 5.5 Beta Includes Long List of New Features

The beta of TypeScript 5.5 became available Thursday.

The first in a long list of new features is inferred type predicates, implemented by developer Dan Vanderkam, who explained that TypeScript can now infer a type predicate for the filter function. He writes that TypeScript will infer a function returns a type predicate if:

  1. The function does not have an explicit return type or type predicate annotation.
  2. The function has a single return statement and no implicit returns.
  3. The function does not mutate its parameter.
  4. The function returns a boolean expression that’s tied to a refinement on the parameter.

Vanderkam wrote in depth about his experience volunteering with TypeScript, with an explanation of how he came to find ideas about how to contribute.

Among the new features added in this beta:

This beta also includes a number of improvements to performance and size, wrote Daniel Rosenwasser, the senior program manager of TypeScript.

“In TypeScript 5.0, we ensured that our Node and Symbol objects had a consistent set of properties with a consistent initialization order,” Rosenwasser explained. “Doing so helps reduce polymorphism in different operations, which allows runtimes to fetch properties more quickly.”

That led to “impressive speed wins in the compiler,” he added.

“In TypeScript 5.5, the same monomorphization work has been done for the language service and public API,” he continued. “What this means is that your editor experience, and any build tools that use the TypeScript API, will get a decent amount faster.”

In benchmarks, that’s led to a 5 to 8% speedup in build times when using the public TypeScript API’s allocators, and language service operations became 10 to 20% faster, he wrote.

“While this does imply an increase in memory, we believe that tradeoff is worth it and hope to find ways to reduce that memory overhead.” Rosenwasser said. “Things should feel a lot snappier now.”

The package size was also significantly reduced by making tserver.js and typingsInstaller.js import from a common API library, rather than each producing a standalone bundles. That led to size on disk decreasing from 30.2 MB to 20.4 MB, and reduced the package size from 5.5 MB to 3.7 MB, he noted.

The team has also published an iteration schedule with target release dates.

Group Created with Sketch.

 

 

 

 

Top