惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

小众软件
小众软件
WordPress大学
WordPress大学
IT之家
IT之家
G
Google Developers Blog
Vercel News
Vercel News
阮一峰的网络日志
阮一峰的网络日志
博客园 - 三生石上(FineUI控件)
Engineering at Meta
Engineering at Meta
Martin Fowler
Martin Fowler
V
V2EX
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
V
Visual Studio Blog
有赞技术团队
有赞技术团队
I
InfoQ
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
月光博客
月光博客
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网

The Astro Blog

Astro 6.4 Astro 6.3 Starlight 0.39 Astro 6.2 What's new in Astro - April 2026 What's new in Astro - March 2026 Astro 6.1 CloudCannon Joins Astro as an Official CMS Partner Astro 6.0 What's new in Astro - February 2026 What's new in Astro - January 2026 Astro 5.17 Supporting the future of Astro The Astro Technology Company joins Cloudflare Astro 6 Beta What's new in Astro - December 2025 What's new in Astro - November 2025 Astro 5.16 Stainless Sponsors Astro, Launches Astro-Powered Docs Platform What's new in Astro - October 2025 Astro 5.15 Spirit of Astro: meet the winning designs What's new in Astro - September 2025 Astro 5.14 Cloudflare Donates $150,000 to Support Astro's Open Source Mission Webflow Donates $150,000 to Support Astro's Open Source Mission Mux: Our Official Video Partner Unleashing creativity: How CodeTV built a video streaming platform with Astro and Mux | Astro What's new in Astro - August 2025 Astro 5.13
Astro 0.21 Preview: Vite + WASM = ⚡️
Fred Schott · 2021-10-06 · via The Astro Blog

Astro v0.21.0 will be our biggest release yet. At a high-level, it includes:

  • A new build engine, powered by Vite
  • A new WASM compiler, written in Go
  • Brand new features, like Components-in-Markdown
  • A new system for HTML live-updating via HMR

You can try out our latest release today in the browser or by running npm install astro@next--compiler in a new project directory on your machine.

Astro is quickly becoming the production-ready framework for building faster, content-focused websites. To celebrate this milestone, here are some highlights and details on what you can expect in Astro v0.21.0 and beyond.

Hello, Vite!

Astro 0.21 is getting an internal build engine upgrade, replacing Snowpack with Vite going forward.

We ran some early experiments with Vite and came away extremely impressed. Vite is well-maintained, well-documented, a bit faster, has great error messages, and has been building clear community buy-in across multiple frameworks. SSR handling can be a bit flakey, but the Vite team is aware of this and actively working on it.

So now, when Evan You tweets about some great performance optimization that they’re making in Vite you can be certain that the same speed is coming to Astro as well.

The reverse is also true: we can now contribute fixes and improvements back to the larger Vite community. Now, when we fix an SSR bug in Astro (like adding support for ESM-only npm packages) we’re also fixing it for every other Vite user, including SvelteKit.

There’s one other huge benefit to choosing Vite: Rollup plugins. Starting in v0.21.0, you’ll be able to connect the entire ecosystem of Rollup plugins to Astro. Enable new features like image optimizations and icon loading with just a few simple plugins. Magic!

This switch from Snowpack to Vite might come as a surprise to some: Both Drew and myself are maintainers on both projects. This was a hard decision for us to make. But ultimately, after working with both tools I can confidently say that Vite will be a great choice for Astro’s future.

Hello, WASM!

Astro 0.21 features another huge low-level improvement: the brand new @astrojs/compiler. Astro’s new compiler is written in Go and distributed as WASM. You can run it right in your browser, or on the server in Node.js and Deno.

The new @astrojs/compiler unlocks:

  • Flexibility: Run the compiler anywhere with WASM.
  • Speed: Build sites faster with Go’s compiled-language performance.
  • Stability: Writing our own compiler allowed us to fix some long-standing bugs.

You can play with the new compiler today right in your browser at https://astro.build/play. This REPL is just one example of what is now possible when you have a fast, runs-anywhere compiler.

Shout out to Nate Moore who did an incredible job with this project.

Components in Markdown

Our most requested feature by far has been the ability to use components directly in Markdown. After months of work, we’re excited to announce that this feature is finally coming to Astro.

Starting in v0.21.0, you can import components inside of your Markdown frontmatter via an optional setup script. Once imported, your components can be used anywhere on the page:

---

title: "Astro 0.21 Early Preview"

setup: |

import Logo from '../components/Logo.astro';

import ReactCounter from '../components/Counter.jsx';

---

# Astro now supports components in Markdown!

<Logo />

- Back to markdown here.

- Supports static Astro components.

- Supports dynamic React/Vue/Svelte components!

<ReactCounter start={0} client:load />

This new setup script was designed for maximum flexibility. We’ll keep improving this API going forward with planned support for default components, default layouts, and markdown component overrides.

HMR, meet HTML

Starting in v0.21.0, Astro will support full HMR for Astro components and pages. Change any .astro file in your codebase, and watch the dev server update the page without a full refresh and without losing any client state.

Astro has always supported powerful HMR updates for client-side JavaScript components like React, Preact, Svelte, Vue, and Solid.js. But adding this for Astro was a fun challenge because Astro components are just static HTML. Our “Zero JavaScript” approach meant that there was no “Astro runtime” to hook into for updates. We had to get creative.

Now, Astro’s dev server sends HTML updates to the browser and then runs a small script to diff those updates against the current page. This creates a more granular, component-level HMR update that won’t impact the rest of the page.

Try it today

If you’ve read this far, we’d love your help trying out the latest release before launch. You can try out our latest release today in the browser or by running npm install astro@next--compiler in a new project directory. You can follow our progress and leave feedback in the next PR on GitHub: https://github.com/withastro/astro/pull/1406

Leave feedback, report bugs, and get involved with Astro’s development in our Discord server. You can also follow along on Twitter.