iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🚴

Rust-based JavaScript Tools 2023: Non-essential Trivia

に公開

I will briefly introduce some Rust-based frontend-related tools I found while browsing the web.

This is some trivia I planned to publish in 2023. I'm releasing it now because I lost interest in writing it. The content might be a bit outdated.

CSS

servo/rust-cssparser

https://github.com/servo/rust-cssparser
A CSS parser written in Rust. It is mainly used in servo, a browser engine written in Rust.

lightningcss

https://github.com/parcel-bundler/lightningcss
It serves as not only a parser but also a minifier and transformer. A project under the Parcel umbrella.
As announced by Lee Robinson, VPoE at Vercel, Next.js is migrating from swc_css to lightningcss.
https://twitter.com/leeerob/status/1740124461683409042
Also, though not mentioned above, the CSS-related parts of swc plugins might all move to lightningcss as well.

The parser used inside Next.js was swc_css. However, the original main maintainer, Alexander Akait, has already left Vercel, and they seem to have judged that future maintenance would be difficult. Going forward, in addition to Next.js, swc plugins and Turbopack will likely be ported to lightningcss.
https://diary.kdy1.dev/2023-8-9-droping-swc-css

railwind

https://github.com/pintariching/railwind
Believe it or not, a Rust version of the Tailwind CSS compiler! It is not currently being updated much.

Transpiler

swc

https://github.com/swc-project/swc
The well-known Rust-based Parser, Transpiler, and Minifier. Actually, there was a bundling feature called swcpack a while ago, but it is no longer being developed (as Turbopack exists).

Bundler

rspack

https://github.com/web-infra-dev/rspack
A tool developed mainly by ByteDance's Web Infra team, aiming to be a drop-in replacement for webpack.

turbopack

https://github.com/vercel/turbo
The successor tool to webpack, being developed at Vercel by Tobias Koppers, the creator of webpack.

rolldown

https://github.com/rolldown-rs/rolldown
A Rust version of rollup. If I recall correctly, when rspack was released, it was called rolldown_legacy and served as a PoC for rspack.
It became open source in March 2024.

farm

https://github.com/farm-fe/farm
A Rust version of Vite. Since it's vite-compatible, it seems plugins and such can be used as they are. Refer to the documentation for differences from Vite and development motivations.
https://farm-fe.github.io/docs/why-farm/

mako

A bundling tool reportedly being developed internally at Alipay. The repository is not public.
https://twitter.com/boshen_c/status/1719596594985681275

Formatter

dprint

https://github.com/dprint/dprint
The core of deno fmt. It is used in the repositories for TypeScript and DefinitelyTyped.
https://github.com/microsoft/TypeScript/pull/54820
https://github.com/DefinitelyTyped/DefinitelyTyped/pull/66235

biome

https://github.com/biomejs/biome
Currently, it features a Formatter and Linter for JavaScript and TypeScript. Recently, it also became capable of formatting and linting within script tags for Vue, Svelte, and Astro. Support for CSS is currently in progress.
https://biomejs.dev/blog/roadmap-2024/#expand-biomes-language-support

An attempt is being made to use it in the Node.js repository.
https://github.com/nodejs/node/pull/50672

Linter

rslint

https://github.com/rslint/rslint
Currently not under active development. Biome uses some of its implementation as a reference.
https://biomejs.dev/internals/credits/#forks

deno_lint

https://github.com/denoland/deno_lint
The core of deno lint.

Oxc

https://github.com/oxc-project/oxc
Formerly a hobby project by Boshen. Currently, the Parser, Linter, and Resolver are under development.

Package manager

pacquet

https://github.com/pnpm/pacquet
An experimental Rust-based package manager being developed under the pnpm umbrella.

volt

https://github.com/dimensionhq/volt
Another Rust-based package manager. Development has currently stopped.

Type Checker

ezno

https://github.com/kaleidawave/ezno
A TypeScript type checker written in Rust. However, it does not aim for full tsc compatibility (e.g., handling of any is different).
https://kaleidawave.github.io/posts/a-preview-of-the-checker/
Currently, it can also be used experimentally through Oxc.

stc

https://github.com/dudykr/stc
A project aiming for full tsc compatibility. Development has stopped because the author is busy.

Bonus

TypeRunner

https://github.com/marcj/TypeRunner
This is a TypeScript type checker written in C++, not Rust. Its approach is different: TypeRunner converts TypeScript into bytecode and performs type checking on a VM. Unfortunately, it has not been updated for about two years.

tyvm

https://github.com/zackradisic/tyvm
An experimental project focused exclusively on type-level TypeScript. It seems to use a compiler written in Rust to convert code into bytecode and execute it on a VM written in Zig.

Discussion