The Best JavaScript Dev Tools in 2022
The Best JavaScript Dev Tools in 2022

The Best JavaScript Dev Tools in 2022

A breakdown of the most important JS dev tools in 2022, including their most relevant tradeoffs, and some opinionated advice sprinkled on top.
 
In the world of software engineering, it’s important to have a firm understanding of the tools at your disposal.
But the landscape of JS tooling is always changing at such a rapid pace.
And 2022 is no different.
So I decided to break down the most important dev tools that you should be aware of in 2022.
We’ll start with the lowest-level tools and work our way up to higher-level tools from there. Let’s get started 💪
 

Compilers

Compilers are responsible for transforming your input code into some target output format. For our purposes, we’re focusing on compilers which support transpiling modern JavaScript and TypeScript into specific versions of ECMAscript that are compatible with browsers and recent versions of Node.js.
Name
Description
Stars
Language
Speed
Maturity
License
Official TS compiler
79,300
TS
slow
very mature
Apache 2.0
JS compiler (TS w/ plugin)
40,700
JS
slow
very mature
MIT
Fast JS / TS compiler
31,200
Go
fast
mature
MIT
Fast JS / TS compiler
21,300
Rust
fast
mature
Apache 2.0
The most important thing to understand about this space is that it’s in the middle of undergoing a massive shift from compilers like tsc and babel, which are written in higher-level interpreted languages, to compilers like swc and esbuild, which are written in much faster, compiled languages.
This shift results in 10-100x faster compilation times as shown in this esbuild demo.
Source: esbuild
Source: esbuild
If you’re updating your devtools stack or starting a new project in 2022, then you’ll want to consider using one of these next-gen compilers under the hood. They may not be as mature as the official typescript compiler or babel, but the benefits of having 100x faster builds cannot be understated.
Note that neither swc nor esbuild perform type checking. They simply transpile code into the desired output format as quickly and efficiently as possible. For the time being, if you’re working with TypeScript, you’ll almost always need to have the official TypeScript compiler as part of your toolchain to guarantee that you’re getting the most out of TypeScript’s static type checking. It’s also worth mentioning that the author of swc, kdy1dev is working on porting tsc to Go in order to remove the need for tsc in many cases, as it tends to be the bottleneck in most toolchains.
 

SWC vs esbuild

swc and esbuild are both excellent, blazing fast, open source JS / TS compilers. They have comparable performance and are both used regularly in production by some of the world’s largest companies.
It’s likely that your choice between the two will be dictated more by the higher-level tools built on top of these compilers as opposed to choosing between them directly.
 
💡
In software engineering, convenient statements such as “technology A is better than technology B” rarely hold much value. Rather, you should try to always keep context in mind. In this case, there are many scenarios where you’d be better off using tsc or babel. Becoming a better software engineer often boils down to thoroughly understanding the tradeoffs involved with these types of decisions, and balancing those tradeoffs against the particular constraints of your project, team, and business’ needs.
 

Bundlers

Source: Webpack
Source: Webpack
Bundlers are responsible for taking all of your input source files and bundling them together into an easy-to-consume output format. The two most common use cases for bundlers are bundling libraries and bundling resources for web applications.
Name
Description
Stars
Optimized For
Compiler(s)
License
Industry standard bundler
60,100
web apps
libraries
babel
tsc
swc
esbuild
MIT
Bundler aimed at libraries
21,400
libraries
babel
tsc
swc
esbuild
MIT
Zero-config build tool for the web
41,000
web apps
libraries
swc
MIT
Bundlers like webpack and rollup are the swiss-army knives of modern JS toolchains. They are both extremely extensible, with well-maintained plugins covering major use cases. It’s relatively straightforward, for example, to use any of the popular compilers listed above to transpile TS code with either webpack or rollup.
Parcel, on the other hand, provides a mostly zero-config approach to bundling. It focuses on simplicity as opposed to extensibility and uses swc as a compiler under the hood.
Note that swc and esbuild both provide basic bundling capabilities as well, though compared with these alternatives, they’re not full-featured enough to be included on this list.
For a much more detailed comparison of these bundlers, check out tooling.report.
 

Package Managers

Package managers are responsible for managing dependencies in the form of NPM packages.
Name
Description
Stars
License
The default package manager for JS
5,700
Artistic License 2.0
Fast, disk space efficient package manager
16,100
MIT
Yarn v1; entered maintenance mode in 2020
40,600
BSD-2
Fast, reliable, secure dependency management
4,900
BSD-2
There’s a lot of history here, but the TL;DR is:
  • All of these package managers have similar features and perf nowadays, so don’t be too worried about which one you’re using.
  • pnpm seems to be gaining a lot of traction very quickly. 💪
  • The way yarn berry was rolled out and the subsequent deprecation of yarn v1 turned a lot of people off from using yarn, though yarn berry has come a long way in the past few years.
  • yarn plug’n’play is an interesting approach, but in practice, it has only seen adoption in cases with very large monorepos.
    • I can’t tell you the number of times I’ve wanted to inspect or add console.log statements to my node_modules, and not being able to do so is a real disadvantage.

Adoption by popular projects

A breakdown of the package managers chosen by popular projects. This image is from Sebastian Weber’s excellent package manager deep dive. Note that at the time of this writing, none of these projects are using Yarn PnP.
A breakdown of the package managers chosen by popular projects. This image is from Sebastian Weber’s excellent package manager deep dive. Note that at the time of this writing, none of these projects are using Yarn PnP.
 

Library Development

These tools are meant to help library authors bundle and publish modern NPM packages.
Name
Description
Stars
Compiler
Bundler
License
Fast TypeScript library bundler powered by esbuild
1,800
esbuild
rollup
MIT
Zero-config CLI for TS package development
9,500
babel
rollup
MIT
Zero-config bundler for tiny modules
6,800
babel
rollup
MIT
Smart, Fast and Extensible Build System
11,800
swc
rollup
webpack
Next generation frontend tooling (library mode)
40,000
esbuild
rollup
MIT
Dev and build your code painlessly in monorepos
720
babel
rollup
MIT
Unified javascript build system
440
esbuild
rollup
MIT
If you’re developing a new library in 2022, you’ll likely want to use one of these higher-level tools to simplify your workflow.
  • If you have a TS package and want to take advantage of extremely fast build times courtesy of esbuild, then tsup is a great option.
  • If you have a TS package and need some additional features, then tsdx is a great option.
  • If you have a TS or JS package, then microbundle is also a great option.
  • Vite is mainly a tool for building frontend web apps, but it also includes support for outputting libraries and is a very solid all-around option.
  • For monorepos, nx looks really promising.
My personal preference will be to use tsup for TS packages, mainly because once you’ve experienced 100x faster builds, it’s really difficult to consider switching back to anything else.

More Info

Most of these tools don’t currently provide great support for TS monorepos which take advantage of composite project references. For the time being, my recommendation for this case is to use tsc for type checking and generating .d.ts typings (with emitDeclarationOnly: true) and tsup for compiling code in each of the sub-packages. For an example of this approach, check out the react-notion-x monorepo (one of my OSS projects).
Publishing modern NPM packages is a nuanced topic that goes well beyond the scope of this article. For more info on ESM, commonjs, dual-package publishing, exports, and more see:
 

Web App Development

These higher-level tools and frameworks are intended to help developers build modern web applications without worrying about all the details.
Name
Description
Stars
Compiler
Bundler
Frameworks
License
The React framework for production
84,000
swc
webpack
react
MIT
The intuitive Vue framework
39,000
esbuild
rollup
vue
MIT
Zero-config build tool for the web
41,000
swc
custom
react
vue
MIT
Next generation frontend tooling
40,000
esbuild
rollup
react
vue
svelte
MIT
Full stack react web framework
15,100
esbuild
custom
react
MIT
ESM-powered frontend build tool
20,000
esbuild
custom
react
vue
svelte
MIT
Modern web apps with one command
94,000
babel
webpack
react
MIT
The fastest way to build Svelte apps
7,700
esbuild
rollup
svelte
MIT
If you’re developing a new web app in 2022 using React, then I would highly recommend using Next.js. It has the best support, the most active community, and close integration with Vercel, the world’s leading deployment platform for modern web apps.
Remix provides a really compelling alternative to Next.js. It’s from the makers of react-router, and though it’s relatively new, they’re definitely a framework to keep an eye on.
If you’re developing a new web app using Vue, then Nuxt.js and Vite are both great options.
And last, but certainly not least, if you want something more light-weight, then give Parcel a try. 🤗
💡
There seems to be a roughly equal number of projects building on top of swc and esbuild. The same observation goes for webpack and rollup.
 

Conclusion

Modern web development has evolved significantly over the past 10 years. Developers today are lucky to have such a wide range of amazing, well-maintained tools to choose from.
This is, however, by no means a comprehensive list of dev tools. If there’s something missing that you’d like to see added, let me know on twitter.
Hopefully this breakdown has helped you parse the most important aspects of the current JS / TS dev tools landscape, and hopefully it’ll help you to make more informed decisions going forwards.
 

Resources

 

 
👉
Follow me on twitter for more awesome stuff like this @transitive_bs