JavaScript Package Registry and React 19

JavaScript Package Registry and React 19

Newsletter

JSJam Live, Wednesday at 12pm PT

Join us today at 12pm PT for another open mic episode of Javascript Jam Live. We'll be covering the topics discussed in this week's newsletter including the JavaScript Package Registry and the upcoming release of React 19. Last time on JavaScript Jam Live, we discussed the release of Million v3 and Amazon's new LLRT (Low Latency Runtime) project.

Story of the Week

JSR - JavaScript Package Registry

The JavaScript ecosystem is experiencing a wave of excitement with the introduction of JSR, a new package registry developed by the team behind Deno. Deno, established by Ryan Dahl, the creator of Node.js, represents a rethinking of JavaScript runtimes using the V8 engine. Aimed at providing a more secure and efficient environment for JavaScript, TypeScript, and WebAssembly, Deno, written in Rust, has evolved with a focus on compatibility with Node/npm.

The launch of Deno Land Inc. in 2021 has propelled the development of Deno further. JSR is the latest initiative by Deno to innovate within the JavaScript package registry space. It offers improvements over npm, the long-standing package registry leader and was unofficially introduced at SeattleJS Conf 2023. JSR emphasizes:

  • A TypeScript-first approach
  • Secure module access via HTTPS
  • Enhanced performance and usability for developers

Kevin Whinnery from Deno explained the rationale behind JSR, highlighting the limitations of npm within the Deno ecosystem and the desire for a registry that addresses these issues directly. JSR aims to ensure a higher quality and more secure package ecosystem with features such as editorial control over content, semantic versioning, and TypeScript awareness.

This initiative reflects Deno's commitment to leveraging web's decentralized nature for module distribution, moving away from the centralized model exemplified by npm. Developers who have had early access to JSR shared their insights, noting its potential to solve existing problems while integrating smoothly with the broader JavaScript ecosystem.

Despite some concerns about ecosystem fragmentation and the direct association with Deno, the response suggests JSR could significantly impact the JavaScript community by offering a viable alternative to npm, especially for TypeScript devs. As JSR navigates these challenges, its commitment to npm/Node compatibility indicates an understanding of the need for coexistence within the diverse JavaScript ecosystem.

The intention is not to replace npm but to complement it, ensuring that developers can benefit from JSR's advancements without losing access to the extensive resources available through npm. This approach may help mitigate concerns about community fragmentation, offering a pathway towards a more integrated and innovative JavaScript development landscape.

React 19 - The One With the Compiler

The recently published blog post titled React Labs: What We've Been Working On – February 2024 from the React team, provides a comprehensive update on the latest advancements in React development. The team highlights their ongoing efforts in research and development including the transition of the React Compiler from a research project to a production-ready tool, now powering Instagram.com. This advancement addresses the issue of excessive re-renders in React.

It does this by automating the memoization process, thus optimizing UI updates without the need for manual intervention. The React Compiler achieves optimization by adhering to the rules of JavaScript and React, such as component idempotency and the prohibition against mutating props or state values. The team is testing the compiler extensively within Meta's diverse codebase to ensure broad compatibility and is also enhancing developer tools to help enforce React's rules.

The introduction of Actions is another significant update meant to simplify client-server communication. Supporting both data handling in client-only applications and server interactions, this feature allows developers to define functions that handle form submissions and data updates with React managing the lifecycle of these actions. Furthermore, the use of async functions in transitions and the introduction of the useOptimistic hook for optimistic state updates are notable enhancements.

The post also introduces the concept of React Canaries, a development strategy that involves the community in the finalization of new features before their stable release. This approach has led to the inclusion of React Server Components, Asset Loading, Document Metadata, and Actions in the React Canary channel. The team emphasizes the importance of releasing these features as a cohesive set to ensure they work well together in production environments.

Looking ahead, the team announces that React 19 will be the next major version, incorporating all the features discussed, along with improvements that necessitate breaking changes, such as support for Web Components. The React team is focused on finalizing these changes and preparing for the release of React 19, promising more details on what it includes and guidance on adopting the new features.

New Podcasts

One More Thing

I've been a longtime fan of Honeypot's developer centric documentaries and am looking forward to their upcoming film on the history of Node.js. Check out the trailer here:

JavaScript Jam on the Web

Find us online at the following links: