The State of React Tooling

Rate this content
Bookmark
Slides

Emerging build tools such as Bun, ESBuild, SWC and Rome will transform how we work with React in the future. Let's take a look at their current state, look at what's needed to adopt them and predict how the landscape will evolve.

This talk has been presented at React Day Berlin 2022, check out the latest edition of this React Conference.

FAQ

ReMotion is a framework that enables developers to create videos programmatically using React. It allows users to write components, animate them, and generate real MP4 videos. This framework is designed for creating applications that leverage programmatic video creation.

The main categories of JavaScript tools mentioned include transpilers, bundlers, runtimes, linters, test runners, type checkers, formatters, and package managers.

A transpiler converts a single file written in a syntax that cannot be run on a runtime or in a browser into something executable, while a bundler takes multiple transpiled files and combines them into one file.

For new projects, SWC and ESBuild are recommended as they are much faster and more stable compared to older transpilers like Babel. SWC is especially recommended as it is the default in Next.js and has significant industry support.

Sucrase is noted for its speed but it is not fully spec compliant and is deemed experimental. It might produce invalid JavaScript files if given invalid code. Additionally, it lacks a logo, which can impact its adoption and recognition in the community.

TypeScript is essential for generating .d.ts TypeScript definition files, making it the only viable option for libraries or back-end applications that require these definitions. It is highly recommended for such use cases.

Bunn is a new runtime that aims to be faster than Node and compatible with existing code. It seeks to allow developers to run their existing code faster without modifications. There is significant excitement and backing for Bunn, indicating potential for substantial impact.

Package managers manage dependencies and ensure consistent, reproducible project environments. Using multiple package managers in the same project is discouraged to avoid conflicts and bugs. Core Pack can help manage different package managers within a single project.

Jonny Burger
Jonny Burger
29 min
02 Dec, 2022

Comments

Sign in or register to post your comment.

Video Summary and Transcription

The Talk discusses over 20 JavaScript tools commonly used by developers, including transpilers and bundlers. It highlights the pros and cons of various tools such as Sucrase, Babel, SWC, and ESBuild. The importance of TypeScript, linters like eslint, and the emergence of new tools like Rome are also mentioned. The Talk delves into the future of JavaScript, the challenges of bundling UI libraries, and the corporate era of JavaScript libraries with the backing of companies.

1. Introduction to JavaScript Tools

Short description:

Hey Berlin! My name is Jonny Burger. I'm the maintainer of ReMotion, a framework for making videos in React. I'll be talking about over 20 JavaScript tools commonly used by developers, organized into different categories. Let's go through them and I'll give you my unbiased opinion. Babel, the original transpiler, is still a staple for React Native. SWC is the new default in Next.js and has industry support. ESBuild, the default in Vite, is fast and robust with great industry support.

Hey Berlin! I hope you're all doing good. My name is Jonny Burger. I am from a place called Zurich, Switzerland, which means that I am able to understand the Germans, while the Germans are not able to understand me. So I'm very happy to have this superpower and be here in Berlin.

And my talk is going to be... wait, first let me tell you about the project that I'm doing. I'm the maintainer of ReMotion, which is a framework that allows you to make videos in React. So you can write the component, animate it, create real MP4 videos, and even create applications that leverage programmatic video.

And for that framework, I have to use a lot of different tools. There's so many tools out there and I'm so confused. And if just somebody could help me navigate, somebody unbiased, tell me what all these tools are for, because a new one is coming out every week, well, I got you. And these are over 20 JavaScript tools that developers use commonly and I have organized them into transpilers, bundlers, runtimes, linters, test runners, type checkers, formatters, and package managers. I know that's a lot and we need to acknowledge that it does not make sense that one knows all the tools at once. But I think in general, you should use one tool from each category.

I'm going to run through all the tools in 20 minutes to tell you a little bit about them and give you an unbiased opinion. It's going too fast. Okay, Babel, it is the original transpiler originally called 6to5. It has a good run for 10 years. It is the most flexible. It has the most transforms. But people have been complaining about its speed for some while. So new ones have come up in the meanwhile and I would not recommend that you use it for a new project except for React Native, where it is pretty much still a staple.

SWC is the Rust kid on the block, and it's the new default in Next.js. It has also big industry support behind it with Vercel that you have just heard about. So not much can go wrong if you use it. It is very stable and just much faster than Babel.

ESBuild is a transpiler that is written in Go and is the default in Vite. So if you use Vite, you are using ESBuild under the hood to bundle your production app. And Vite is also very fast and very robust. Has great industry support, especially because Vite uses it.

2. Sucrase: A Fast and Experimental Transpiler

Short description:

Sucrase is a less known transpiler that is written in TypeScript and is the fastest. However, it has some practical problems and is not fully spec compliant. It describes itself as experimental and fun, but it may produce invalid JavaScript files.

And I can also recommend you to use it. Now let's go into one that is a bit less known. It's called Sucrase, which is actually the fastest transpiler. And it is written in TypeScript. So you'd think it is slower than the compilers that are written in Go or in Rust. But no, actually, it does not matter. And it compiles very fast. But it also has some problems that prohibit me from recommending it to you. It does not have as its goal to be fully spec compliant, rather practical. It describes itself as experimental and fun, which does really sound fun. And one interesting thing about it is that if you throw invalid code at it, it might just spit out an invalid JavaScript file, which is not what you might want. And also, it has no logo, really, as a JavaScript tool. So I cannot recommend it, unfortunately.

QnA