WIP: feat: use Sätteri as the MDX processor#31367
Conversation
|
This pull request requires reviews from CODEOWNERS as it changes files that match the following patterns:
|
|
CI run failed: build logs |
There was a problem hiding this comment.
1 inline comment posted.
- HIGH
src/plugins/rehype/heading-slugs.ts:32-35—element.children.with(-2, text)is dead code.Array.prototype.withreturns a new array without mutating the original, and the return value is discarded. Becausetextalready references the same object at index-2, this call has no effect. Remove the.with()block instead of adding a type cast.
- Add @astrojs/markdown-satteri and satteri-expressive-code
- Wire expressiveCode() as a hastPlugin so TypeScriptExample, WranglerConfig,
etc. continue to find the Expressive Code copy button in rendered HTML
- Fix {" "} JSX space expressions in 16 content files (oxc rejects these)
- Strip trailing whitespace from MDX files (space-only blank lines trigger
an oxc parse error in certain frontmatter+import contexts)
- Fix type error in src/plugins/rehype/heading-slugs.ts surfaced by updated
hast types in @astrojs/mdx@6.0.2
|
/bonk please review |
Broken LinksFound 156 broken link(s) across 77 file(s).
|
There was a problem hiding this comment.
CRITICAL: Link validation failure — 156 broken links across 77 files are blocking merge. The errors are mostly in files linking to standard pages (, , , etc.) that definitely exist. This suggests is not correctly resolving pages built with the Sätteri processor, or the custom processor is somehow excluding pages from the validator's graph. This needs investigation before merge.
**Fixed: Dead code in ** — Removed the no-op call as noted by a previous reviewer. The call returned a new array that was immediately discarded; the preceding already achieves the intended mutation.
MEDIUM: MDX formatting churn — ~96 MDX files have whitespace-only diffs (trailing spaces removed, JSX whitespace expressions collapsed). These appear benign, but confirm they are expected Sätteri serialization behavior.
|
CRITICAL: Link validation failure — 156 broken links across 77 files are blocking merge. The errors are mostly in Fixed: Dead code in MEDIUM: MDX formatting churn — ~96 MDX files have whitespace-only diffs (trailing spaces removed, JSX whitespace expressions collapsed). These appear benign, but confirm they are expected Sätteri serialization behavior. |
Co-authored-by: mvvmm <mvvmm@users.noreply.github.com>
|
Posted a review on PR #31367 and fixed one issue directly. What I fixed:
What I flagged as a merge blocker:
What I noted as acceptable:
Review links: |
Summary
Switches the MDX processor to Sätteri — a Rust-based Markdown/MDX engine with a JavaScript plugin layer — using the new
processoroption added in@astrojs/mdx@6.0.0. The existing remark/rehype pipeline continues to handle.mdfiles unchanged; only.mdxfiles use Sätteri.Also fixes a type error in
src/plugins/rehype/heading-slugs.tssurfaced by the updated hast types that ship with@astrojs/mdx@6.0.2.Note:
@astrojs/markdown-satteri@0.3.0(published today) is blocked by the repo's supply-chain minimum-age policy. This PR uses0.2.2; a follow-up bump to0.3.0can land once the cutoff passes.