github withastro/astro @astrojs/mdx@3.0.0

latest releases: @astrojs/svelte@6.0.1, astro@4.16.13, @astrojs/solid-js@4.4.3...
6 months ago

Major Changes

  • #10935 ddd8e49 Thanks @bluwy! - Refactors the MDX transformation to rely only on the unified pipeline. Babel and esbuild transformations are removed, which should result in faster build times. The refactor requires using Astro v4.8.0 but no other changes are necessary.

  • #10935 ddd8e49 Thanks @bluwy! - Allows integrations after the MDX integration to update markdown.remarkPlugins and markdown.rehypePlugins, and have the plugins work in MDX too.

    If your integration relies on Astro's previous behavior that prevents integrations from adding remark/rehype plugins for MDX, you will now need to configure @astrojs/mdx with extendMarkdownConfig: false and explicitly specify any remarkPlugins and rehypePlugins options instead.

  • #10935 ddd8e49 Thanks @bluwy! - Renames the optimize.customComponentNames option to optimize.ignoreElementNames to better reflect its usecase. Its behaviour is not changed and should continue to work as before.

  • #10935 ddd8e49 Thanks @bluwy! - Replaces the internal remark-images-to-component plugin with rehype-images-to-component to let users use additional rehype plugins for images

Patch Changes

  • #10935 ddd8e49 Thanks @bluwy! - Simplifies plain MDX components as hast element nodes to further improve HTML string inlining for the optimize option

  • #10935 ddd8e49 Thanks @bluwy! - Allows Vite plugins to transform .mdx files before the MDX plugin transforms it

  • #10935 ddd8e49 Thanks @bluwy! - Updates the optimize option to group static sibling nodes as a <Fragment />. This reduces the number of AST nodes and simplifies runtime rendering of MDX pages.

  • #10935 ddd8e49 Thanks @bluwy! - Tags the MDX component export for quicker component checks while rendering

  • #10935 ddd8e49 Thanks @bluwy! - Fixes export const components keys detection for the optimize option

  • #10935 ddd8e49 Thanks @bluwy! - Improves optimize handling for MDX components with attributes and inline MDX components

Don't miss a new astro release

NewReleases is sending notifications on new releases.