@astrojs/mdx
πΏ Minor Changes
-
#11741
6617491Thanks @bluwy! - Updates adapter server entrypoint to use@astrojs/mdx/server.jsThis is an internal change. Handling JSX in your
.mdxfiles has been moved from Astro internals and is now the responsibility of this integration. You should not notice a change in your project, and no update to your code is required.
-
π Patch Changes
- Updated dependencies [
49b5145]:- @astrojs/markdown-remark@5.2.0
- Updated dependencies [
π Patch Changes
- Updated dependencies [
b6afe6a]:- @astrojs/markdown-remark@5.1.1
- Updated dependencies [
πΏ Minor Changes
-
#11144
803dd80Thanks @ematipico! - The integration now exposes a function calledgetContainerRenderer, that can be used inside the Container APIs to load the relative renderer.import { experimental_AstroContainer as AstroContainer } from 'astro/container';import ReactWrapper from '../src/components/ReactWrapper.astro';import { loadRenderers } from 'astro:container';import { getContainerRenderer } from '@astrojs/react';test('ReactWrapper with react renderer', async () => {const renderers = await loadRenderers([getContainerRenderer()]);const container = await AstroContainer.create({renderers,});const result = await container.renderToString(ReactWrapper);expect(result).toContain('Counter');expect(result).toContain('Count: <!-- -->5');});
-
β¨ Major Changes
-
#10935
ddd8e49Thanks @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
ddd8e49Thanks @bluwy! - Allows integrations after the MDX integration to updatemarkdown.remarkPluginsandmarkdown.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/mdxwithextendMarkdownConfig: falseand explicitly specify anyremarkPluginsandrehypePluginsoptions instead. -
#10935
ddd8e49Thanks @bluwy! - Renames theoptimize.customComponentNamesoption tooptimize.ignoreElementNamesto better reflect its usecase. Its behaviour is not changed and should continue to work as before. -
#10935
ddd8e49Thanks @bluwy! - Replaces the internalremark-images-to-componentplugin withrehype-images-to-componentto let users use additional rehype plugins for images
π Patch Changes
-
#10935
ddd8e49Thanks @bluwy! - Simplifies plain MDX components as hast element nodes to further improve HTML string inlining for theoptimizeoption -
#10935
ddd8e49Thanks @bluwy! - Allows Vite plugins to transform.mdxfiles before the MDX plugin transforms it -
#10935
ddd8e49Thanks @bluwy! - Updates theoptimizeoption to group static sibling nodes as a<Fragment />. This reduces the number of AST nodes and simplifies runtime rendering of MDX pages. -
#10935
ddd8e49Thanks @bluwy! - Tags the MDX component export for quicker component checks while rendering -
#10935
ddd8e49Thanks @bluwy! - Fixesexport const componentskeys detection for theoptimizeoption -
#10935
ddd8e49Thanks @bluwy! - Improvesoptimizehandling for MDX components with attributes and inline MDX components
-
π Patch Changes
-
#10754
3e7a12c8532411e580fcfdb8445cad8fc8499291Thanks @rishi-raj-jain! - Fixes an issue where images in MDX required a relative specifier (e.g../)Now, you can use the standard
syntax in MDX files for images colocated in the same folder: no relative specifier required!There is no need to update your project; your existing images will still continue to work. However, you may wish to remove any relative specifiers from these MDX images as they are no longer necessary:
<!-- This dog lives in the same folder as my article! --> -
#10770
88ee63a3ba4488c60348cb821034e6d4a057efd0Thanks @bluwy! - Removes internal MDX processor onbuildEndto free up memory
-
πΏ Minor Changes
-
#10689
683d51a5eecafbbfbfed3910a3f1fbf0b3531b99Thanks @ematipico! - Deprecate support for versions of Node.js older thanv18.17.1for Node.js 18, older thanv20.0.3for Node.js 20, and the complete Node.js v19 release line.This change is in line with Astroβs Node.js support policy.
π Patch Changes
- Updated dependencies [
ccafa8d230f65c9302421a0ce0a0adc5824bfd55]:- @astrojs/markdown-remark@5.1.0
-
π Patch Changes
- #10673
db7f9c87035a0de780536d95cdd9facff00c3c08Thanks @bluwy! - Removes unnecessary internalrecmaInjectImportMetaEnvplugin
- #10673
π Patch Changes
- Updated dependencies [
2cf116f80cb5e421ab5cc5eb4a654e7b78c1b8de,374efcdff9625ca43309d89e3b9cfc9174351512]:- @astrojs/markdown-remark@5.0.0
- Updated dependencies [
π Patch Changes
- Updated dependencies [
c585528f446ccca3d4c643f4af5d550b93c18902]:- @astrojs/markdown-remark@4.3.2
- Updated dependencies [
π Patch Changes
- Updated dependencies [
19e42c368184013fc30d1e46753b9e9383bb2bdf]:- @astrojs/markdown-remark@4.3.1
- Updated dependencies [
πΏ Minor Changes
-
#10104
a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18Thanks @remcohaszing! - Changes Astroβs internal syntax highlighting to use rehype plugins instead of remark plugins. This provides better interoperability with other rehype plugins that deal with code blocks, in particular with third party syntax highlighting plugins andrehype-mermaid.This may be a breaking change if you are currently using:
- a remark plugin that relies on nodes of type
html - a rehype plugin that depends on nodes of type
raw.
Please review your rendered code samples carefully, and if necessary, consider using a rehype plugin that deals with the generated
elementnodes instead. You can transform the AST of raw HTML strings, or alternatively usehast-util-to-htmlto get a string from arawnode. - a remark plugin that relies on nodes of type
π Patch Changes
- Updated dependencies [
c081adf998d30419fed97d8fccc11340cdc512e0,5a9528741fa98d017b269c7e4f013058028bdc5d,a31bbd7ff8f3ec62ee507f72d1d25140b82ffc18]:- @astrojs/markdown-remark@4.3.0
-
π Patch Changes
- Updated dependencies [
44c957f893c6bf5f5b7c78301de7b21c5975584d]:- @astrojs/markdown-remark@4.2.1
- Updated dependencies [
πΏ Minor Changes
- #9753
df37366556d46f7abdf82b09e33b08bd94e631b3Thanks @OliverSpeir! - Allows remark plugins to pass options specifying how images in .mdx files will be optimized
- #9753
π Patch Changes
- Updated dependencies [
53c69dcc82cdf4000aff13a6c11fffe19096cf45,2f81cffa9da9db0e2802d303f94feaee8d2f54ec,a505190933365268d48139a5f197a3cfb5570870]:- @astrojs/markdown-remark@4.2.0
- Updated dependencies [