2022 started with the chaos when two very popular packages were intentionally broken by their creator: Faker.js and colors.js sabotaged.
The fragility of the huge eco-system was demonstrated again when Lerna a popular tool for mono-repos was declared as un-maintained... until Nrwl, the company behind Nx, announced it was taking over stewardship of Lerna.
JavaScript is eating the world, you may have heard of this prophecy from 2009:
Any application that can be written in JavaScript, will eventually be written in JavaScript
...or in TypeScript we could add 13 years later as TypeScript is becoming the de-facto standard to write JavaScript (first class support by Deno and Bun, default setup of Next.js, out of the box support by Vite...).
The place taken by JavaScript in the code base and the tooling comes with some issues, for both developers and end-users:
- build times go out of control in large code bases
- the average size of JavaScript keeps increasing leading to poor performance
In 2022, we saw great innovations to solve these two types of problem at different layers of the stack.
The tooling improved with these solutions:
- Bun, the champion of the year takes a drastic approach to speed installations and build times
- Rome is now a linter and a formatter that aims to be the single tool to manage applications written in JS/TS.
- The building tool Vite
For the performance in the browser, different patterns compete:
- Zero baseline JavaScript frameworks to deliver nearly no JS to the browser (Qwik is leading the charge)
- Partial hydration to provide islands of interactivity to static pages (Astro)
- React Server Components (implemented by Next.js 13 and Gatsby) to delegate more work on the server side.
- The Progressively Enhanced Single Page Apps architecture implemented by Remix provides both great DX and performance in the browser without compromising any dynamic behavior
There is no silver bullet to solve these issue as the spectrum from static "pages" to fully dynamic "apps" is large.
The JavaScript landscape was once very fragmented: multiple browsers on one side, Node.js with its own CommonJS module system and its own APIs on the other side.
With the rise of the edge computing, there is now a strong trend to use everywhere the same subset of standardized APIs (fetch, HTTP Request and Response...).
Our guest writer Lee Robinson wrote a great summary of this trend in the article Why I'm Optimistic About JavaScript's Future.
And we share the optimism of his conclusion!
What an incredible time to be a web developer.
Overall winner: Bun 🏆
The trendiest project of the year is Bun: a new JavaScript runtime that is all about performance and great DX. Its popularity exploded this summer with the first Beta release: +20,000 stars on GitHub in one month. We have never seen such an explosion since we started tracking projects at Best of JS.
So what makes Bun special? Like Deno, the overall winner two years ago, it provides first-class support for TypeScript.
But Bun is not just a runtime. It's also:
So Bun can install your dependencies reading your package.json. Bun can also run your scripts. It does everything faster than anything else.
Bun is a fresh take on many aspects of the JavaScript ecosystem, focusing on performance.
It prioritizes standard Web APIs like Fetch. It supports many of the Node.js APIs, making it compatible with most NPM packages. It may not be "production-ready" (lack of Windows support) yet, but it's a very promising tool. Compared to Deno, the ecosystem is pretty new, but it already has a web framework called Elysia that claims to be the fastest HTTP framework.
The most incredible thing about Bun is that its creator, Jarred Sumner implemented all those features from scratch using a low-level language called Zig.
Check A Complete Overhaul of the JavaScript Ecosystem to get more details.
Tauri
In fifth in 2021, Tauri was even more popular in 2022 with 30,000 new stargazers. It's a project written in Rust to create cross-platform desktop applications using web technologies.
The version 1.0 was released in June.
It's built with security and performance in mind. Compared to Electron, it has a small footprint as the developer has to specify the API and capabilities required by the application.
React and Next.js
In third and forth React and Next.js got similar numbers, with almost 20,000 new stargazers.
Next.js 13, released in October, leverages the React Server Components introduced by React 17 in 2020.
Andrew Clark, one of the maintainers of React made a bold statement about their adoption in the future in this thread:
Vite
In fifth Vite is the trendiest tool to build applications based on web technologies while providing an amazing developer experience.
It had two major releases this year (v3 in July and v4 in December).
It powers more and more projects including the frameworks SvelteKit and Qwik and the test runner Vitest.