feat: move MDX into the processors themselves - #17262
Conversation
🦋 Changeset detectedLatest commit: 6b9f915 The changes in this PR will be included in the next version bump. This PR includes changesets to release 440 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Merging this PR will regress 1 benchmark
Warning Please fix the performance issues or acknowledge them on CodSpeed. Performance Changes
Tip Investigate this regression by commenting Comparing |
6e33a93 to
9998e43
Compare
| "@astrojs/internal-helpers": "workspace:*", | ||
| "@astrojs/markdown-remark": "workspace:*", | ||
| "@mdx-js/mdx": "^3.1.1", | ||
| "acorn": "^8.16.0", | ||
| "es-module-lexer": "^2.0.0", | ||
| "estree-util-visit": "^2.0.0", | ||
| "hast-util-to-html": "^9.0.5", | ||
| "piccolore": "^0.1.3", | ||
| "rehype-raw": "^7.0.0", | ||
| "remark-gfm": "^4.0.1", | ||
| "remark-smartypants": "^3.0.2", | ||
| "source-map": "^0.7.6", | ||
| "unist-util-visit": "^5.1.0", | ||
| "vfile": "^6.0.3" |
70c3b19 to
bd9721f
Compare
6bf99f8 to
6a936bd
Compare
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@astrojs/mdx': major | |||
There was a problem hiding this comment.
I'm not happy about the fact that this ends up being a MDX integration major, however since someone could have the packages installed directly, and some package managers don't enforce the peer deps version update, well this ends up being breaking due to needing those updates.
ArmandPhilippot
left a comment
There was a problem hiding this comment.
Looks great! I've left a few suggestions around changesets, and for a broken link I spotted.
re docs:
N/A, there's no actual API change for end users and the new version limitation is (rarely) shown into an error message.
Because mdx({ recmaPlugins: [] }) is now deprecated, we should add a deprecation warning on https://docs.astro.build/en/guides/integrations-guide/mdx/#recmaplugins (this is under MDX configuration options).
And, this means we should document how to use recma plugins using the processor now... I don't yet know what the best course of action is. We have a few options:
- "Built-in features" in the Markdown guide: this is where we document processor features. For now, we are only presenting the common features... We could rework this section. However, this is a bit annoying, because Sätteri offers more (and we don't want to duplicate their docs), and Unified now has "recma" plugins (useful only with MDX). And, maybe not everything deserves a guide.
- "MDX in Astro" in the MDX integration or nested under
processorin the MDX integration (since this is only relevant for MDX users): we could add a new section and inrecmaPlugins, we link to that section. - Maybe
@astrojs/markdown-satteriand@astrojs/markdown-remarkdeserve their own reference now:- The Markdown guide continues to show common features, but refers to the references for the full list of features.
- The Sätteri reference can link to Sätteri docs (ie. a bit like
zfromastro/zod) - The
recmaPluginssection in the MDX guide can link to the Unified reference
So, even though the previous way is still working, there is an API change: users should pass their recma plugins to the processor. We want to document the current/recommended way.
For now, if you want to update the docs, I think we could go with option 2: this is what require the less changes. NWTWWHB!
I still think we might need to improve our docs around features (ie. there are more of them!), but this requires more work and is not directly related to your changes. So, I can try something on my side later.
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
Co-authored-by: Armand Philippot <git@armand.philippot.eu>
82219cd to
6b9f915
Compare
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@astrojs/markdown-remark](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/markdown/remark)) | [`7.2.4` → `7.3.0`](https://renovatebot.com/diffs/npm/@astrojs%2fmarkdown-remark/7.2.4/7.3.0) |  |  | | [astro](https://astro.build) ([source](https://github.com/withastro/astro/tree/HEAD/packages/astro)) | [`7.2.9` → `7.2.10`](https://renovatebot.com/diffs/npm/astro/7.2.9/7.2.10) |  |  | --- ### Release Notes <details> <summary>withastro/astro (@​astrojs/markdown-remark)</summary> ### [`v7.3.0`](https://github.com/withastro/astro/blob/HEAD/packages/markdown/remark/CHANGELOG.md#730) [Compare Source](https://github.com/withastro/astro/compare/@astrojs/markdown-remark@7.2.4...@astrojs/markdown-remark@7.3.0) ##### Minor Changes - [#​17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Adds MDX rendering to the `unified()` and `satteri()` processors. Both processors now compile `.mdx` files themselves. You still need to install `@astrojs/mdx` to add MDX support to your project. - [#​17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Adds a `recmaPlugins` option to `unified()` for adding recma (estree/JSX) plugins to the MDX compiler. ##### Patch Changes - Updated dependencies \[[`f8e9458`](withastro/astro@f8e9458)]: - [@​astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.11.0 </details> <details> <summary>withastro/astro (astro)</summary> ### [`v7.2.10`](https://github.com/withastro/astro/blob/HEAD/packages/astro/CHANGELOG.md#7210) [Compare Source](https://github.com/withastro/astro/compare/astro@7.2.9...astro@7.2.10) ##### Patch Changes - [#​17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@​Princesseuh](https://github.com/Princesseuh)! - Fixes `@astrojs/markdown-remark` being pinned to an exact version. - [#​17874](withastro/astro#17874) [`10c7e63`](withastro/astro@10c7e63) Thanks [@​astro-factory](https://github.com/apps/astro-factory)! - Fixes SSR manifest placeholder not being replaced when the server build is minified, which caused a runtime `Invalid URL` crash at server boot - [#​17869](withastro/astro#17869) [`2548abf`](withastro/astro@2548abf) Thanks [@​ematipico](https://github.com/ematipico)! - Fixes a case where the logger was improperly initialized at runtime in dev. - [#​17878](withastro/astro#17878) [`76eff3d`](withastro/astro@76eff3d) Thanks [@​ematipico](https://github.com/ematipico)! - Fixes browser heuristic caching for cached responses that include `Last-Modified` or `ETag` validators - [#​17833](withastro/astro#17833) [`413a6e7`](withastro/astro@413a6e7) Thanks [@​astro-factory](https://github.com/apps/astro-factory)! - Fixes prerender conflict warnings to correctly identify the route that first rendered a duplicate pathname, instead of misattributing the conflict to an unrelated route that merely matches the URL pattern - [#​17872](withastro/astro#17872) [`f7191cc`](withastro/astro@f7191cc) Thanks [@​jx-grxf](https://github.com/jx-grxf)! - Fixes Markdown images in content collections rendering an empty `srcset` attribute when no responsive candidates are generated. - [#​17755](withastro/astro#17755) [`157c500`](withastro/astro@157c500) Thanks [@​matthewp](https://github.com/matthewp)! - Fixes a bug where editing a content collection entry during `astro dev` on Windows kept serving stale content until the dev server was restarted. The data store now notifies the dev server directly after each write instead of relying only on the file watcher, which can miss the atomic rename that commits the write on some platforms. - Updated dependencies \[[`f8e9458`](withastro/astro@f8e9458), [`f8e9458`](withastro/astro@f8e9458)]: - [@​astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.11.0 - [@​astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.4.0 </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate CLI](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC41OS4zIiwidXBkYXRlZEluVmVyIjoiNDQuNTkuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
##### [v8.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#800) ##### Major Changes - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Moves MDX file processing to the Markdown processors. '[@astrojs/mdx](https://github.com/astrojs/mdx)' is still required to add MDX support to your project. However, it now delegates the MDX files processing to Markdown processors. ##### What should I do? If you haven't explicitly installed a Markdown processor, you don't need to do anything. Otherwise, ensure that your configured Markdown processor uses the following version: - `@astrojs/markdown-satteri` 0.4.0 or later if you use `satteri()` - `@astrojs/markdown-remark` 7.3.0 or later if you use `unified()` ##### Patch Changes - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes `.mdx` files still using `markdown.processor` when `extendMarkdownConfig` is `false`. They now use a clean default processor instead; pass `mdx({ processor })` to choose one explicitly. - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a warning when the deprecated `remarkPlugins`, `rehypePlugins`, `recmaPlugins` and `remarkRehype` options are ignored because your Markdown processor does not run them. They still apply when your processor is `unified()`, and were previously dropped silently otherwise. - Updated dependencies \[[`f8e9458`](withastro/astro@f8e9458), [`f8e9458`](withastro/astro@f8e9458)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.11.0 - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.4.0 ##### [v7.0.8](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#708) ##### Patch Changes - [#17757](withastro/astro#17757) [`660991c`](withastro/astro@660991c) Thanks [@astro-factory](https://github.com/apps/astro-factory)! - Fixes build errors showing wrong file location, missing line:col, and misleading hints when a plugin error (e.g. from MDX) is wrapped by Vite's build error - [#17766](withastro/astro#17766) [`0762a83`](withastro/astro@0762a83) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes Sätteri processor option types to accept all plugin entries supported by Sätteri v0.10.3. ##### [v7.0.7](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#707) ##### Patch Changes - [#17731](withastro/astro#17731) [`bc171af`](withastro/astro@bc171af) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.10.3. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#0103--2026-08-19) for details on bugs fixed and features added. - Updated dependencies \[[`05763a0`](withastro/astro@05763a0)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.4 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.4 ##### [v7.0.6](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#706) ##### Patch Changes - Updated dependencies \[[`8c193f6`](withastro/astro@8c193f6)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.3 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.3 ##### [v7.0.5](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#705) ##### Patch Changes - Updated dependencies \[[`c895b12`](withastro/astro@c895b12)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.2 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.2 ##### [v7.0.4](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#704) ##### Patch Changes - [#17514](withastro/astro#17514) [`41a00dd`](withastro/astro@41a00dd) Thanks [@gtritchie](https://github.com/gtritchie)! - Fixes a bug where the integration was emitting React-cased attribute names. ##### [v7.0.3](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#703) ##### Patch Changes - [#17341](withastro/astro#17341) [`64b0d66`](withastro/astro@64b0d66) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes custom `pre` components not applying to syntax-highlighted code blocks when using the Sätteri Markdown processor with MDX. ##### [v7.0.2](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#702) ##### Patch Changes - Updated dependencies \[[`eb6f97e`](withastro/astro@eb6f97e)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.1 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.1 ##### [v7.0.1](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#701) ##### Patch Changes - [#17249](withastro/astro#17249) [`02b73b0`](withastro/astro@02b73b0) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where the `peerDependencies` field used incorrect dependencies. ##### [v7.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#700) ##### Major Changes - [#15819](withastro/astro#15819) [`cafec4e`](withastro/astro@cafec4e) Thanks [@delucis](https://github.com/delucis)! - Upgrade to Vite v8 ##### Minor Changes - [#17093](withastro/astro#17093) [`4585fe5`](withastro/astro@4585fe5) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Replaces the import entrypoint of `getContainerRenderer()` A new `container-renderer` entrypoint exporting `getContainerRenderer()` has been added to the following integrations: React, Preact, Svelte, SolidJS, Vue, and MDX. This prevents bundlers from trying to bundle unrelated exports from the package root when only the Container API is used. If you are using the Container API, update your import statements to use the new entrypoint. The following example updates the `getContainerRenderer()` import for React: ```diff - import { getContainerRenderer } from '@astrojs/react'; + import { getContainerRenderer } from '@astrojs/react/container-renderer'; ``` Importing `getContainerRenderer()` from the package root still works, but is now deprecated and logs a warning. - [#17129](withastro/astro#17129) [`ff7b718`](withastro/astro@ff7b718) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for [modifying frontmatter programmatically](https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically) with the default Markdown processor. A Sätteri plugin can now read and mutate `ctx.data.astro.frontmatter`, and Astro uses the result as the page's frontmatter, in both Markdown and MDX. ##### Patch Changes - [#17124](withastro/astro#17124) [`7e7ab87`](withastro/astro@7e7ab87) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates `satteri` to `0.9.0`. See the [Sätteri changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md) for details. - [#17027](withastro/astro#17027) [`241250b`](withastro/astro@241250b) Thanks [@ocavue](https://github.com/ocavue)! - Triggers beta prereleases for packages that are still on alpha ##### [v6.0.3](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#603) ##### Patch Changes - [#16969](withastro/astro#16969) [`4a31f90`](withastro/astro@4a31f90) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting `markdown.syntaxHighlight` to `'prism'` now highlights your code blocks with Prism. ```js // astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, }); ``` ##### [v6.0.2](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#602) ##### Patch Changes - [#16955](withastro/astro#16955) [`9a93d68`](withastro/astro@9a93d68) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.8.0. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#080--2026-06-03) for details on bugs fixed and features added. - Updated dependencies \[[`9a93d68`](withastro/astro@9a93d68)]: - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.2 ##### [v6.0.1](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#601) ##### Patch Changes - Updated dependencies \[[`eeb064c`](withastro/astro@eeb064c)]: - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.1 ##### [v6.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#600) ##### Major Changes - [#16848](withastro/astro#16848) [`f732f3c`](withastro/astro@f732f3c) Thanks [@Princesseuh](https://github.com/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. ```js // astro.config.mjs 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](https://satteri.bruits.org/). You can choose to use it now by installing `@astrojs/markdown-satteri`, importing the `satteri()` processor, and adapting your existing configuration: ```js // astro.config.mjs 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](https://satteri.bruits.org/docs/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) : ```diff // astro.config.mjs 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](https://docs.astro.build/en/guides/markdown-content/). To give feedback on this new Rust processor, see the [Native Markdown / MDX parsing and processing RFC](withastro/roadmap#1364). ##### Minor Changes - [#16848](withastro/astro#16848) [`f732f3c`](withastro/astro@f732f3c) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for using [`@astrojs/markdown-satteri`](https://www.npmjs.com/package/@astrojs/markdown-satteri) to parse `.mdx` files. ```js // astro.config.mjs 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](https://docs.astro.build/en/guides/integrations-guide/mdx/#recmaplugins) 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: ```js // astro.config.mjs 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(), }), ], }); ``` ##### Patch Changes - Updated dependencies \[[`f732f3c`](withastro/astro@f732f3c), [`f732f3c`](withastro/astro@f732f3c), [`f732f3c`](withastro/astro@f732f3c)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.0 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.0 - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.0 ##### [v5.0.6](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#506) ##### Patch Changes - [#16579](withastro/astro#16579) [`49e10e3`](withastro/astro@49e10e3) Thanks [@igor-koop](https://github.com/igor-koop)! - Fixes an issue where the `smartypants` option was ignored. ##### [v5.0.5](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#505) ##### Patch Changes - Updated dependencies \[[`9256345`](withastro/astro@9256345)]: - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.1.2
##### [v8.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#800) ##### Major Changes - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Moves MDX file processing to the Markdown processors. '[@astrojs/mdx](https://github.com/astrojs/mdx)' is still required to add MDX support to your project. However, it now delegates the MDX files processing to Markdown processors. ##### What should I do? If you haven't explicitly installed a Markdown processor, you don't need to do anything. Otherwise, ensure that your configured Markdown processor uses the following version: - `@astrojs/markdown-satteri` 0.4.0 or later if you use `satteri()` - `@astrojs/markdown-remark` 7.3.0 or later if you use `unified()` ##### Patch Changes - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes `.mdx` files still using `markdown.processor` when `extendMarkdownConfig` is `false`. They now use a clean default processor instead; pass `mdx({ processor })` to choose one explicitly. - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a warning when the deprecated `remarkPlugins`, `rehypePlugins`, `recmaPlugins` and `remarkRehype` options are ignored because your Markdown processor does not run them. They still apply when your processor is `unified()`, and were previously dropped silently otherwise. - Updated dependencies \[[`f8e9458`](withastro/astro@f8e9458), [`f8e9458`](withastro/astro@f8e9458)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.11.0 - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.4.0 ##### [v7.0.8](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#708) ##### Patch Changes - [#17757](withastro/astro#17757) [`660991c`](withastro/astro@660991c) Thanks [@astro-factory](https://github.com/apps/astro-factory)! - Fixes build errors showing wrong file location, missing line:col, and misleading hints when a plugin error (e.g. from MDX) is wrapped by Vite's build error - [#17766](withastro/astro#17766) [`0762a83`](withastro/astro@0762a83) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes Sätteri processor option types to accept all plugin entries supported by Sätteri v0.10.3. ##### [v7.0.7](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#707) ##### Patch Changes - [#17731](withastro/astro#17731) [`bc171af`](withastro/astro@bc171af) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.10.3. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#0103--2026-08-19) for details on bugs fixed and features added. - Updated dependencies \[[`05763a0`](withastro/astro@05763a0)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.4 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.4 ##### [v7.0.6](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#706) ##### Patch Changes - Updated dependencies \[[`8c193f6`](withastro/astro@8c193f6)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.3 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.3 ##### [v7.0.5](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#705) ##### Patch Changes - Updated dependencies \[[`c895b12`](withastro/astro@c895b12)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.2 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.2 ##### [v7.0.4](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#704) ##### Patch Changes - [#17514](withastro/astro#17514) [`41a00dd`](withastro/astro@41a00dd) Thanks [@gtritchie](https://github.com/gtritchie)! - Fixes a bug where the integration was emitting React-cased attribute names. ##### [v7.0.3](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#703) ##### Patch Changes - [#17341](withastro/astro#17341) [`64b0d66`](withastro/astro@64b0d66) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes custom `pre` components not applying to syntax-highlighted code blocks when using the Sätteri Markdown processor with MDX. ##### [v7.0.2](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#702) ##### Patch Changes - Updated dependencies \[[`eb6f97e`](withastro/astro@eb6f97e)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.1 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.1 ##### [v7.0.1](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#701) ##### Patch Changes - [#17249](withastro/astro#17249) [`02b73b0`](withastro/astro@02b73b0) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where the `peerDependencies` field used incorrect dependencies. ##### [v7.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#700) ##### Major Changes - [#15819](withastro/astro#15819) [`cafec4e`](withastro/astro@cafec4e) Thanks [@delucis](https://github.com/delucis)! - Upgrade to Vite v8 ##### Minor Changes - [#17093](withastro/astro#17093) [`4585fe5`](withastro/astro@4585fe5) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Replaces the import entrypoint of `getContainerRenderer()` A new `container-renderer` entrypoint exporting `getContainerRenderer()` has been added to the following integrations: React, Preact, Svelte, SolidJS, Vue, and MDX. This prevents bundlers from trying to bundle unrelated exports from the package root when only the Container API is used. If you are using the Container API, update your import statements to use the new entrypoint. The following example updates the `getContainerRenderer()` import for React: ```diff - import { getContainerRenderer } from '@astrojs/react'; + import { getContainerRenderer } from '@astrojs/react/container-renderer'; ``` Importing `getContainerRenderer()` from the package root still works, but is now deprecated and logs a warning. - [#17129](withastro/astro#17129) [`ff7b718`](withastro/astro@ff7b718) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for [modifying frontmatter programmatically](https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically) with the default Markdown processor. A Sätteri plugin can now read and mutate `ctx.data.astro.frontmatter`, and Astro uses the result as the page's frontmatter, in both Markdown and MDX. ##### Patch Changes - [#17124](withastro/astro#17124) [`7e7ab87`](withastro/astro@7e7ab87) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates `satteri` to `0.9.0`. See the [Sätteri changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md) for details. - [#17027](withastro/astro#17027) [`241250b`](withastro/astro@241250b) Thanks [@ocavue](https://github.com/ocavue)! - Triggers beta prereleases for packages that are still on alpha ##### [v6.0.3](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#603) ##### Patch Changes - [#16969](withastro/astro#16969) [`4a31f90`](withastro/astro@4a31f90) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting `markdown.syntaxHighlight` to `'prism'` now highlights your code blocks with Prism. ```js // astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, }); ``` ##### [v6.0.2](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#602) ##### Patch Changes - [#16955](withastro/astro#16955) [`9a93d68`](withastro/astro@9a93d68) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.8.0. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#080--2026-06-03) for details on bugs fixed and features added. - Updated dependencies \[[`9a93d68`](withastro/astro@9a93d68)]: - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.2 ##### [v6.0.1](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#601) ##### Patch Changes - Updated dependencies \[[`eeb064c`](withastro/astro@eeb064c)]: - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.1 ##### [v6.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#600) ##### Major Changes - [#16848](withastro/astro#16848) [`f732f3c`](withastro/astro@f732f3c) Thanks [@Princesseuh](https://github.com/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. ```js // astro.config.mjs 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](https://satteri.bruits.org/). You can choose to use it now by installing `@astrojs/markdown-satteri`, importing the `satteri()` processor, and adapting your existing configuration: ```js // astro.config.mjs 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](https://satteri.bruits.org/docs/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) : ```diff // astro.config.mjs 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](https://docs.astro.build/en/guides/markdown-content/). To give feedback on this new Rust processor, see the [Native Markdown / MDX parsing and processing RFC](withastro/roadmap#1364). ##### Minor Changes - [#16848](withastro/astro#16848) [`f732f3c`](withastro/astro@f732f3c) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for using [`@astrojs/markdown-satteri`](https://www.npmjs.com/package/@astrojs/markdown-satteri) to parse `.mdx` files. ```js // astro.config.mjs 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](https://docs.astro.build/en/guides/integrations-guide/mdx/#recmaplugins) 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: ```js // astro.config.mjs 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(), }), ], }); ``` ##### Patch Changes - Updated dependencies \[[`f732f3c`](withastro/astro@f732f3c), [`f732f3c`](withastro/astro@f732f3c), [`f732f3c`](withastro/astro@f732f3c)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.0 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.0 - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.0 ##### [v5.0.6](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#506) ##### Patch Changes - [#16579](withastro/astro#16579) [`49e10e3`](withastro/astro@49e10e3) Thanks [@igor-koop](https://github.com/igor-koop)! - Fixes an issue where the `smartypants` option was ignored. ##### [v5.0.5](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#505) ##### Patch Changes - Updated dependencies \[[`9256345`](withastro/astro@9256345)]: - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.1.2
##### [v8.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#800) ##### Major Changes - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Moves MDX file processing to the Markdown processors. '[@astrojs/mdx](https://github.com/astrojs/mdx)' is still required to add MDX support to your project. However, it now delegates the MDX files processing to Markdown processors. ##### What should I do? If you haven't explicitly installed a Markdown processor, you don't need to do anything. Otherwise, ensure that your configured Markdown processor uses the following version: - `@astrojs/markdown-satteri` 0.4.0 or later if you use `satteri()` - `@astrojs/markdown-remark` 7.3.0 or later if you use `unified()` ##### Patch Changes - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes `.mdx` files still using `markdown.processor` when `extendMarkdownConfig` is `false`. They now use a clean default processor instead; pass `mdx({ processor })` to choose one explicitly. - [#17262](withastro/astro#17262) [`f8e9458`](withastro/astro@f8e9458) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds a warning when the deprecated `remarkPlugins`, `rehypePlugins`, `recmaPlugins` and `remarkRehype` options are ignored because your Markdown processor does not run them. They still apply when your processor is `unified()`, and were previously dropped silently otherwise. - Updated dependencies \[[`f8e9458`](withastro/astro@f8e9458), [`f8e9458`](withastro/astro@f8e9458)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.11.0 - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.4.0 ##### [v7.0.8](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#708) ##### Patch Changes - [#17757](withastro/astro#17757) [`660991c`](withastro/astro@660991c) Thanks [@astro-factory](https://github.com/apps/astro-factory)! - Fixes build errors showing wrong file location, missing line:col, and misleading hints when a plugin error (e.g. from MDX) is wrapped by Vite's build error - [#17766](withastro/astro#17766) [`0762a83`](withastro/astro@0762a83) Thanks [@HiDeoo](https://github.com/HiDeoo)! - Fixes Sätteri processor option types to accept all plugin entries supported by Sätteri v0.10.3. ##### [v7.0.7](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#707) ##### Patch Changes - [#17731](withastro/astro#17731) [`bc171af`](withastro/astro@bc171af) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.10.3. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#0103--2026-08-19) for details on bugs fixed and features added. - Updated dependencies \[[`05763a0`](withastro/astro@05763a0)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.4 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.4 ##### [v7.0.6](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#706) ##### Patch Changes - Updated dependencies \[[`8c193f6`](withastro/astro@8c193f6)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.3 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.3 ##### [v7.0.5](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#705) ##### Patch Changes - Updated dependencies \[[`c895b12`](withastro/astro@c895b12)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.2 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.2 ##### [v7.0.4](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#704) ##### Patch Changes - [#17514](withastro/astro#17514) [`41a00dd`](withastro/astro@41a00dd) Thanks [@gtritchie](https://github.com/gtritchie)! - Fixes a bug where the integration was emitting React-cased attribute names. ##### [v7.0.3](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#703) ##### Patch Changes - [#17341](withastro/astro#17341) [`64b0d66`](withastro/astro@64b0d66) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Fixes custom `pre` components not applying to syntax-highlighted code blocks when using the Sätteri Markdown processor with MDX. ##### [v7.0.2](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#702) ##### Patch Changes - Updated dependencies \[[`eb6f97e`](withastro/astro@eb6f97e)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.1 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.1 ##### [v7.0.1](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#701) ##### Patch Changes - [#17249](withastro/astro#17249) [`02b73b0`](withastro/astro@02b73b0) Thanks [@ematipico](https://github.com/ematipico)! - Fixes an issue where the `peerDependencies` field used incorrect dependencies. ##### [v7.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#700) ##### Major Changes - [#15819](withastro/astro#15819) [`cafec4e`](withastro/astro@cafec4e) Thanks [@delucis](https://github.com/delucis)! - Upgrade to Vite v8 ##### Minor Changes - [#17093](withastro/astro#17093) [`4585fe5`](withastro/astro@4585fe5) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Replaces the import entrypoint of `getContainerRenderer()` A new `container-renderer` entrypoint exporting `getContainerRenderer()` has been added to the following integrations: React, Preact, Svelte, SolidJS, Vue, and MDX. This prevents bundlers from trying to bundle unrelated exports from the package root when only the Container API is used. If you are using the Container API, update your import statements to use the new entrypoint. The following example updates the `getContainerRenderer()` import for React: ```diff - import { getContainerRenderer } from '@astrojs/react'; + import { getContainerRenderer } from '@astrojs/react/container-renderer'; ``` Importing `getContainerRenderer()` from the package root still works, but is now deprecated and logs a warning. - [#17129](withastro/astro#17129) [`ff7b718`](withastro/astro@ff7b718) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for [modifying frontmatter programmatically](https://docs.astro.build/en/guides/markdown-content/#modifying-frontmatter-programmatically) with the default Markdown processor. A Sätteri plugin can now read and mutate `ctx.data.astro.frontmatter`, and Astro uses the result as the page's frontmatter, in both Markdown and MDX. ##### Patch Changes - [#17124](withastro/astro#17124) [`7e7ab87`](withastro/astro@7e7ab87) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates `satteri` to `0.9.0`. See the [Sätteri changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md) for details. - [#17027](withastro/astro#17027) [`241250b`](withastro/astro@241250b) Thanks [@ocavue](https://github.com/ocavue)! - Triggers beta prereleases for packages that are still on alpha ##### [v6.0.3](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#603) ##### Patch Changes - [#16969](withastro/astro#16969) [`4a31f90`](withastro/astro@4a31f90) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for Prism syntax highlighting to the Sätteri Markdown and MDX processors. Setting `markdown.syntaxHighlight` to `'prism'` now highlights your code blocks with Prism. ```js // astro.config.mjs import { satteri } from '@astrojs/markdown-satteri'; export default defineConfig({ markdown: { processor: satteri(), syntaxHighlight: 'prism', }, }); ``` ##### [v6.0.2](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#602) ##### Patch Changes - [#16955](withastro/astro#16955) [`9a93d68`](withastro/astro@9a93d68) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updates Sätteri processor to v0.8.0. See [its changelog](https://github.com/bruits/satteri/blob/main/packages/satteri/CHANGELOG.md#080--2026-06-03) for details on bugs fixed and features added. - Updated dependencies \[[`9a93d68`](withastro/astro@9a93d68)]: - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.2 ##### [v6.0.1](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#601) ##### Patch Changes - Updated dependencies \[[`eeb064c`](withastro/astro@eeb064c)]: - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.1 ##### [v6.0.0](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#600) ##### Major Changes - [#16848](withastro/astro#16848) [`f732f3c`](withastro/astro@f732f3c) Thanks [@Princesseuh](https://github.com/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. ```js // astro.config.mjs 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](https://satteri.bruits.org/). You can choose to use it now by installing `@astrojs/markdown-satteri`, importing the `satteri()` processor, and adapting your existing configuration: ```js // astro.config.mjs 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](https://satteri.bruits.org/docs/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) : ```diff // astro.config.mjs 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](https://docs.astro.build/en/guides/markdown-content/). To give feedback on this new Rust processor, see the [Native Markdown / MDX parsing and processing RFC](withastro/roadmap#1364). ##### Minor Changes - [#16848](withastro/astro#16848) [`f732f3c`](withastro/astro@f732f3c) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Adds support for using [`@astrojs/markdown-satteri`](https://www.npmjs.com/package/@astrojs/markdown-satteri) to parse `.mdx` files. ```js // astro.config.mjs 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](https://docs.astro.build/en/guides/integrations-guide/mdx/#recmaplugins) 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: ```js // astro.config.mjs 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(), }), ], }); ``` ##### Patch Changes - Updated dependencies \[[`f732f3c`](withastro/astro@f732f3c), [`f732f3c`](withastro/astro@f732f3c), [`f732f3c`](withastro/astro@f732f3c)]: - [@astrojs/internal-helpers](https://github.com/astrojs/internal-helpers)@0.10.0 - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.2.0 - [@astrojs/markdown-satteri](https://github.com/astrojs/markdown-satteri)@0.2.0 ##### [v5.0.6](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#506) ##### Patch Changes - [#16579](withastro/astro#16579) [`49e10e3`](withastro/astro@49e10e3) Thanks [@igor-koop](https://github.com/igor-koop)! - Fixes an issue where the `smartypants` option was ignored. ##### [v5.0.5](https://github.com/withastro/astro/blob/HEAD/packages/integrations/mdx/CHANGELOG.md#505) ##### Patch Changes - Updated dependencies \[[`9256345`](withastro/astro@9256345)]: - [@astrojs/markdown-remark](https://github.com/astrojs/markdown-remark)@7.1.2
Changes
Fixes #17030
Fixes #17371
As the title says, this PR moves MDX processing into the first-party processors themselves. While this might seems backward for remark (there's MDX code in the remark package now, even if you don't use MDX!), for our default story with Sätteri it ends up making more sense:
In effect, this isolates remark into its own package as much as possible, removing from what I can see, 150 deps for people not using remark.
Testing
Tests should pass
Docs
N/A, there's no actual API change for end users and the new version limitation is (rarely) shown into an error message.