π Patch Changes
-
#16955
9a93d68Thanks @Princesseuh! - Updates SΓ€tteri processor to v0.8.0. See its changelog for details on bugs fixed and features added. -
Updated dependencies [
9a93d68]:- @astrojs/markdown-satteri@0.2.2
#16955 9a93d68 Thanks @Princesseuh! - Updates SΓ€tteri processor to v0.8.0. See its changelog for details on bugs fixed and features added.
Updated dependencies [9a93d68]:
#16848 f732f3c Thanks @Princesseuh! - Adds a new markdown.processor configuration option, allowing you to choose an alternative Markdown processor.
Websites with many Markdown/MDX files tend to be slow to build because the unified ecosystem (e.g., remark, rehype) is slow to process. This feature introduces the ability to replace this part of the build pipeline with another processor.
The default processor is unified(). This means that existing configurations remain unchanged and your remark/rehype plugins continue to work.
import { defineConfig } from 'astro/config';import { unified } from '@astrojs/markdown-remark';import remarkToc from 'remark-toc';
export default defineConfig({ markdown: { processor: unified({ remarkPlugins: [remarkToc], }), },});In addition to this new configuration option, Astro provides a new alternative processor based on Rust: SΓ€tteri. You can choose to use it now by installing @astrojs/markdown-satteri, importing the satteri() processor, and adapting your existing configuration:
import { defineConfig } from 'astro/config';import { satteri } from '@astrojs/markdown-satteri';
export default defineConfig({ markdown: { processor: satteri({ features: { directive: true }, }), },});This processor does not support the remark and rehype plugins. This means you may need to convert them to MDAST or HAST plugins to retain your current functionality.
The existing top-level markdown.remarkPlugins, markdown.rehypePlugins, markdown.remarkRehype, markdown.gfm, and markdown.smartypants options still work, but are now deprecated and will be removed in a future major update. The matching remarkPlugins, rehypePlugins, and remarkRehype options on the MDX integration are also deprecated for the same reason. To anticipate their removal, move them onto unified({...}) (or your preferred plugin processor) :
import { defineConfig } from 'astro/config';import remarkToc from 'remark-toc';import rehypeSlug from 'rehype-slug'; import { unified } from '@astrojs/markdown-remark';
export default defineConfig({ markdown: { processor: unified({ remarkPlugins: [remarkToc], rehypePlugins: [rehypeSlug], remarkRehype: true, gfm: true, smartypants: true, }), remarkPlugins: [remarkToc], rehypePlugins: [rehypeSlug], remarkRehype: true, gfm: true, smartypants: true, },});For more information on enabling and using this feature in your project, see our Markdown guide. To give feedback on this new Rust processor, see the Native Markdown / MDX parsing and processing RFC.
#16848 f732f3c Thanks @Princesseuh! - Adds support for using @astrojs/markdown-satteri to parse .mdx files.
import { defineConfig } from 'astro/config';import mdx from '@astrojs/mdx';import { satteri } from '@astrojs/markdown-satteri';
export default defineConfig({ markdown: { processor: satteri({ features: { directive: true }, }), }, integrations: [mdx()],});Note that the recmaPlugins option is not supported when using SΓ€tteri as your MDX processor. If you would like to use SΓ€tteri for Markdown files, but still use Unified for MDX, you can pass a different Markdown processor to the MDX integration:
import { defineConfig } from 'astro/config';import mdx from '@astrojs/mdx';import { satteri } from '@astrojs/markdown-satteri';import { unified } from '@astrojs/markdown-remark';import myPlugin from './my-recma-plugin.js';
export default defineConfig({ markdown: { processor: satteri({ features: { directive: true }, }), }, integrations: [ mdx({ recmaPlugins: [myPlugin], processor: unified(), }), ],});49e10e3 Thanks @igor-koop! - Fixes an issue where the smartypants option was ignored.9256345]:
f3485c3]:
10a1a5a]:
#15864 d3c7de9 Thanks @florian-lefebvre! - Removes temporary support for Node >=20.19.1 because Stackblitz now uses Node 22 by default
Updated dependencies []:
6f8f0bc Thanks @ematipico! - Updates the Astro peerDependencies#astro to be 6.0.0.#14494 727b0a2 Thanks @florian-lefebvre! - Updates Markdown heading ID generation - (v6 upgrade guidance)
#14427 e131261 Thanks @florian-lefebvre! - Increases minimum Node.js version to 22.12.0 - (v6 upgrade guidance)
#14445 ecb0b98 Thanks @florian-lefebvre! - Astro v6.0 upgrades to Vite v7.0 as the development server and production bundler - (v6 upgrade guidance)
#15475 36fc0e0 Thanks @delucis! - Fixes edge cases where an export const components = {...} declaration would fail to be detected with the optimize option enabled
#15264 11efb05 Thanks @florian-lefebvre! - Lower the Node version requirement to allow running on Stackblitz until it supports v22
Updated dependencies [bbb5811, cb99214, 80f0225, 727b0a2, 1fa4177, 7c55f80, 6f19ecc, f94d3c5]:
1fa4177]:
84d6efd Thanks @ematipico! - Changes how styles applied to code blocks are emitted to support CSP - (v6 upgrade guidance)84d6efd]:
80f0225]: