mdast-util-mdx-expression is an mdast extension that parses and serializes MDX or MDX.js expression syntax inside markdown, such as `{Math.PI}` or `{true}`. It provides `mdxExpressionFromMarkdown()` for use with mdast-util-from-markdown, and `mdxExpressionToMarkdown()` for use with mdast-util-to-markdown, turning expressions into `mdxFlowExpression` or `mdxTextExpression` nodes (optionally including an ESTree `Program` in `data.estree`).
Project status
- The source
syntax-tree/mdast-util-mdx-expressionappears to be under active maintenance, with an upstream push on 2025-11-19 (close to today, 2026-06-09), though the most recent published update in the provided history is 2.0.1 (2024-09-13). - Update cadence looks low, roughly “about once per year or less” in the recent major/minor history (2.0.1 in 2024, 2.0.0 in 2023), and then a gap in the provided update list after 2.0.1 despite the later upstream push.
AI summary generated
Recent updates
2.0.1
Release 2.0.1 makes a small formatting fix for MDX expression serialization, specifically adding indentation to generated markdown expressions. It also updates type declaration generation (declaration maps) and refactors type imports to use `@import` syntax.
2.0.0
Release 2.0.0 modernizes mdast-util-mdx-expression for a new major ecosystem baseline, requiring Node.js 16 and switching the public exports to an exports-map. It also changes the API exports for the markdown extensions from exported objects to functions that must be called (adding parentheses), and updates the TypeScript types accordingly.
Breaking1.3.2
Release 1.3.2 is described as a documentation update, a code-style/refactor pass, and a tsconfig.json change. However, the actual diff includes a substantial refactor of how the package exports TypeScript types and how the runtime entrypoint is wired.
1.3.1
Release 1.3.1 is primarily aimed at fixing TypeScript type import behavior under Node16 module resolution. The changes focus on updating how complex type modules are imported, along with a small TypeScript compiler configuration tweak.
1.3.0
Release 1.3.0 updates the project for newer tooling and a TypeScript typing dependency. The release notes mention only an `@types/estree-jsx` update, but the code diff shows additional dependency and CI matrix changes.
1.2.1
Release 1.2.1 is primarily a type fix related to how MDX expression nodes are represented in hast element typings, plus a documentation refresh. The only code-relevant changes visible in the diff are in TypeScript declaration mappings and updated test expectations.
1.2.0
Release 1.2.0 updates the TypeScript type registry so mdx expression nodes are represented in the `hast` typings. It also adds coverage for markdown to mdast to markdown roundtripping whitespace behavior for flow and text expressions.
BreakingFeatures1.1.1
Release 1.1.1 changes how mdxFlowExpression whitespace is handled during parse and serialization. It removes the previous de-indenting (dedent) and re-indenting (indent) logic for flow expression values, adjusting output formatting.
1.1.0
Release 1.1.0 updates the package typings to add MDX expression node types into the mdast node type registry. The code diff also refactors internal JSDoc typing for flow and text expressions to align with the new type declarations.
1.0.0
Release 1.0.0 primarily modernizes the package to ESM, adds JSDoc-based types, and improves documentation. The implementation changes are more substantial than the release notes suggest, including a public API export rename and packaging changes.
BreakingFeatures