Astro 7 Ships a Full Rust Toolchain, Replacing Go Across Compiler, Bundler, and Markdown
Rust Beats Go Again, Astro 7 Debuts — What Does "Everything Can Be Rustified" Mean?
👇 Today's Headlines
Breaking information barriers, getting closer to global frontend. Hello everyone, I'm Lin Yubing.
Rust literally translates to "rust." Rewriting software from other languages in Rust is jokingly called "rustification" (Rustify).
In frontend infrastructure, tech stacks originally based on Go are gradually being "rustified" by Rust. Rust increasingly shows a trend of "dimensional strike" against the Go language:
- The father of Node initially developed the Deno prototype in Go, but later Deno switched directly to Rust.
- Turborepo was initially based on Go, and was later refactored into a Rust port.
- Vite 7's build relied on Go-based
esbuild+ rollup, while Vite 8 switches to Rust-implemented Oxc + Rolldown.
Now, the Astro team has officially announced the release of its 7th major version. The biggest upgrade is that the compiler, originally implemented in Go, has also been "rustified" into a Rust-rewritten compiler...
The extreme performance of the Markdown engine and compiler is the biggest highlight of Astro 7. Let's take a look at how Rust "rustifies" Astro, making it the fastest version in history.
👉 New Rust Compiler
Astro 7 adopts a new compiler rewritten in Rust, replacing the previous Go-based compiler, to compile .astro format components with high performance.
The Rust compiler is based on Evan You's Oxc compiler under the hood, and uses Lightning CSS to handle CSS scoping — the CSS preprocessor Vite will adopt by default in the future. These are all tools that have already been "rustified" by Rust.
The new Rust compiler is currently largely backward-compatible with the old Go compiler, except for the following special cases:
- No more HTML error correction: The Go compiler would implicitly rewrite tags into "valid HTML" by rearranging elements and other operations. These unexpected actions often led to hard-to-debug bugs. The Rust compiler handles this directly.
- JSX strict mode: For unclosed tags and unterminated attributes like
<div class="text-white >Astro, the Rust compiler will now report an error, instead of implicitly correcting them and ignoring these real template bugs like the Go compiler did. - JSX whitespace handling: Whitespace between elements is now collapsed following JSX conventions, consistent with the behavior of React and other JSX frameworks.
For example, line breaks between inline elements no longer produce visible spaces:
The Rust compiler also follows Rolldown's model, publishing native binaries for different platforms, with a WASM (WebAssembly) fallback.
👉 Rust-Powered Vite 8
Astro 7 upgrades from Vite 7 to Vite 8, a revolutionary version of Vite because Vite 8 integrates the Rust-based Rolldown + Oxc under the hood, replacing the Go-based esbuild + rollup.
Rolldown's plugin system is compatible with the rollup API, but its speed is at least 10 times faster, up to 30 times.
Vite 8 includes a compatibility layer that can automatically convert legacy esbuild and rollupOptions configurations into Rolldown's equivalent configuration.
Therefore, after Astro 7 adopts Vite 8, most projects can upgrade seamlessly without changing configurations, directly enjoying faster build speeds.
👉 Markdown Rustification
Using Rust to rewrite frontend infrastructure might not be surprising anymore, but now more general development tech stacks are also starting to be "rustified."
Astro 7 defaults to using satteri as the processing pipeline for Markdown and MDX, which is also a Rust-based processor.
Under the hood, satteri uses pulldown-cmark to parse CommonMark syntax, and Oxc to parse MDX extended expressions. These are all Rust native libraries with astonishing performance.
But performance is not the only advantage. Some previously pluggable features are now directly implemented in Rust as built-in features, such as GitHub-flavored Markdown syntax, which no longer requires extra plugins.
For non-default features, you can configure whether to enable them in astro.config.js:
Furthermore, Astro's Markdown processing pipeline was originally based on unified, involving plugins from the Markdown ecosystem like remark and rehype. Not all of these plugins have been rewritten in Rust yet.
But you can implement them using satteri's plugin API, or use the original JS processing pipeline:
In fact, the performance improvement brought by Astro's new Rust compiler is not the main point. As a top-5 SSG (Static Site Generator) on GitHub, the performance improvement from rustifying the Markdown ecosystem is even more significant.
Taking the build of Astro's official documentation as an example, in isolation, the new Rust compiler's build speed improved by about 6% compared to the old Go compiler, because .astro compilation is generally not the performance bottleneck. Processing large amounts of Markdown is the real performance killer.
Now, Astro's Markdown processor has also been rustified. Combined with the Rust compiler, the superposition of both performances is even more obvious. Moreover, as website scale increases, sites using more Markdown will see more significant performance improvements.
👇 Key Summary
The Astro team officially announced the release of Astro 7, in which a large amount of Go and JS infrastructure has been rewritten in Rust ("rustified"), making it the fastest version in Astro's evolutionary history:
- A new Rust compiler replaces the old Go-based compiler.
- Astro upgrades from Vite 7 to Vite 8, with Rust-based Rolldown + Oxc replacing the Go-based
esbuild+ rollup. - Uses the Rust-implemented
satterias the default Markdown / MDX engine, with some pluggable features directly rewritten in Rust as built-in functions.
The Rust industrial revolution continues. This is not only happening in JS/TS-related frontend infrastructure but is also spreading to broader development tech stacks based on other languages like Go, squeezing out native performance to provide programmers with an extremely smooth development experience.
In the future, the mainstream of frontend infrastructure might no longer be "Go vs Rust," but "Go to Rust" (Everything can be rustified).
👍 That's all for this issue of Frontend Daily. If it helped you, feel free to like, check in, recommend, or share.
🙏 To my followers, see you in the next issue, bye bye~~~
👇 References:
- 🔗 Astro 7 Official Blog: https://astro.build/blog/astro-7
- 🔗 Markdown Rust Edition: https://mp.weixin.qq.com/s/P56zQxaGl5SWslJRnUSvgQ
- 🔗 satteri Official Site: https://satteri.bruits.org
Top 1 from juejin.cn, machine-translated. The original thread is authoritative.
1