Skip to content

Evaluate Sätteri (Rust markdown/MDX processor) as an Astro processor swap #9

Description

@ace139

Context

Evaluate whether to swap Astro's markdown/MDX engine from the default unified() (remark/rehype) to Sätteri"A Markdown pipeline forged in Rust for the JavaScript world." It's a Rust-based Markdown/MDX processor (not a site generator) exposing HAST/MDAST ASTs and a typed plugin API via napi-rs, with a WASM build.

Findings (as of 2026-06-29)

  • It's a supported swap. Astro 6.4.4 exposes a pluggable markdown.processor option, and there's an official @astrojs/markdown-satteri package. Astro core even has satteri-specific handling baked in. Adoption would be: markdown: { processor: satteri({ mdastPlugins: [...] }) }.
  • Maturity risk. @astrojs/markdown-satteri is v0.3.2 (published ~2026-06-23, pre-1.0, alpha/beta history).
  • Scope. Satteri only touches the content-rendering path (src/content/** → HTML). It does NOT replace scripts/generate-markdown.js, which converts HTML → Markdown (opposite direction) for the Accept: text/markdown agent feature.
  • Performance win is negligible at current scale (~10 posts); build-time markdown parsing is not a bottleneck.
  • Compatibility risk = the deciding factor. rehype-mermaid is a HAST/rehype plugin; Satteri uses its own mdastPlugins/native plugin API, so whether it runs unchanged is unverified. Dual-theme Shiki likely survives (Astro applies highlighting outside the processor) but needs a real build to confirm.

Decision so far

Stayed on unified() and migrated off the deprecated remarkPlugins/rehypePlugins config shape onto markdown.processor: unified({ rehypePlugins: [rehypeMermaid] }). The processor slot is now the clean seam to A/B Satteri later.

To revisit later

  • Re-check @astrojs/markdown-satteri maturity once it hits 1.0 / stabilizes.
  • On a branch, swap unified(...)satteri(...) and run bun run build; verify rehype-mermaid and dual-theme Shiki output.
  • Only adopt if the build is clean AND there's an actual reason (e.g. build-time pain at larger content scale).

Links: https://satteri.bruits.org/ · https://github.com/bruits/satteri · @astrojs/markdown-satteri on npm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions