Astro 6.4 | Astro
Skip to content
Show Menu
Astro 6.4 is here! On today’s menu: a pluggable Markdown pipeline, a new Rust-based Markdown processor for you to try, and helpers to facilitate the use of experimental advanced routing with Cloudflare.
Explore what’s new in this release:
New markdown.processor API
Faster Markdown builds with Sätteri
Cloudflare helpers for advanced routing
To upgrade an existing project, use the automated @astrojs/upgrade CLI tool. Alternatively, upgrade manually by running the upgrade command for your package manager:
# Recommended:
npx @astrojs/upgrade
# Manual:
npm install astro@latest
pnpm upgrade astro --latest
yarn upgrade astro --latest
New markdown.processor API
Astro’s Markdown pipeline has always been built around unified (remark, rehype, and friends). That ecosystem is powerful, having thousands of plugins available, but perhaps it’s not up to your taste. Astro 6.4 adds a new markdown.processor configuration option that lets you swap that pipeline out entirely.
The default processor is still unified(), so existing projects keep working without any changes. Your remark and rehype plugins continue to behave the same, but they are now configured directly on the processor, instead of in the top-level markdown config:
astro.config.mjsimport { defineConfig } from 'astro/config';
import { unified } from '@astrojs/markdown-remark';
import remarkToc from 'remark-toc';
export default defineConfig({
markdown: {
processor: unified({
remarkPlugins: [remarkToc],
}),
},
});
The existing top-level markdown.remarkPlugins, markdown.rehypePlugins, markdown.remarkRehype, markdown.gfm, and markdown.smartypants options still work, but they’re now deprecated in favor of passing them to unified({...}), and will be removed in Astro 8.0.
For more information, see the updated Markdown guide.
Faster Markdown builds with Sätteri
A pluggable processor API also means Astro can ship other Markdown processors. Astro 6.4 introduces a new @astrojs/markdown-satteri package, with a new processor based on Sätteri, a Markdown and MDX pipeline written in Rust.
Sätteri is much faster than the default unified-based pipeline, and it implements many Markdown features natively that previously required plugins. In our own testing, switching the Astro and Cloudflare docs site to Sätteri shaved over a minute off their respective build time. To try it out, install the package and set it as your processor:
npm install @astrojs/markdown-satteri
astro.config.mjsimport { defineConfig } from 'astro/config';
import { satteri } from '@astrojs/markdown-satteri';
export default defineConfig({
markdown: {
processor: satteri({
features: { directive: true },
}),
},
});
Sätteri doesn’t run remark or rehype plugins. If you depend on plugins from the unified ecosystem, you’ll need to either stay on unified() for now or port them to Sätteri MDAST or HAST plugins.
We hope to make Sätteri the default Markdown processor in a future major version of Astro. To give feedback on the Rust processor and the new API, see the Native Markdown / MDX RFC.
Cloudflare helpers for advanced routing
If you’re using experimental advanced routing (added in Astro 6.3) on Cloudflare, @astrojs/cloudflare now ships a cf() helper that wires up the Cloudflare-specific bits for you: SESSION KV binding injection, static asset serving via the ASSETS binding, locals.cfContext, client address from cf-connecting-ip, waitUntil, and prerendered error pages.
With a custom fetch handler, use cf() from @astrojs/cloudflare/fetch:
src/app.tsimport { astro, FetchState } from 'astro/fetch';
import { cf } from '@astrojs/cloudflare/fetch';
export default {
async fetch(request: Request, env: Env, ctx: ExecutionContext) {
const state = new FetchState(request);
const asset = await cf(state, env, ctx);
if (asset) return asset;
return astro(state);
},
};
With Hono, use cf() from @astrojs/cloudflare/hono as middleware.
src/app.tsimport { Hono } from 'hono';
import { actions, middleware, pages, i18n } from 'astro/hono';
import { cf } from '@astrojs/cloudflare/hono';
const app = new HonoBindings: Env }>();
app.use(cf());
app.use(actions());
app.use(middleware());
app.use(pages());
app.use(i18n());
export default app;
();app.use(cf());app.use(actions());app.use(middleware());app.use(pages());app.use(i18n());export default app;">
Other improvements
For a complete list of bug fixes and smaller improvements, see the full changelog.
Community
The Astro core team is:
Alexander Niebuhr
Armand Philippot
Chris Swithinbank
Emanuele Stoppa
Erika
Florian Lefebvre
Fred Schott
HiDeoo
Luiz Ferraz
Matt Kane
Matthew Phillips
Reuben Tier
Sarah Rainsberger<br>, and
Yan Thomas
Thanks to all the other contributors who helped make Astro 6.4 possible with code and docs additions and improvements, including:
Alexander Flodin, Alexis Aguilar, Arnas Donauskas, Barry, David Large, divyeshb13, Dor Alagem, Eli Kent...