You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/release-notes/migrating-from-v4-to-v5.md
+2
Original file line number
Diff line number
Diff line change
@@ -265,6 +265,8 @@ The default setting for the `output` option changed from `/sitemap` to `/`. This
265
265
266
266
You can uninstall `remark-unwrap-images` from your project if you used it inside the `mdxOptions.remarkPlugins` array.
267
267
268
+
**Please note:** If you haven't done the [migration from v3 to v4 for `gatsby-plugin-mdx`](/plugins/gatsby-plugin-mdx/#migrating-from-v3-to-v4), please be aware that you'll **need to** go through that migration process if you want to use the latest version of `gatsby-plugin-mdx` with Gatsby 5.
269
+
268
270
## Future breaking changes
269
271
270
272
This section explains deprecations that were made for Gatsby 5. These old behaviors will be removed in v6, at which point they will no longer work. For now, you can still use the old behaviors in v5, but we recommend updating to the new signatures to make future updates easier.
Copy file name to clipboardExpand all lines: packages/gatsby-plugin-mdx/README.md
+10-4
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,10 @@
4
4
5
5
MDX is markdown for the component era. It lets you write JSX embedded inside markdown. It’s a great combination because it allows you to use markdown’s often terse syntax (such as `# heading`) for the little things and JSX for more advanced components.
6
6
7
-
## Table of contents
7
+
<details>
8
+
<summary><strong>Table of contents</strong></summary>
9
+
10
+
Table of contents
8
11
9
12
-[Installation](#installation)
10
13
-[Usage](#usage)
@@ -24,6 +27,8 @@ MDX is markdown for the component era. It lets you write JSX embedded inside mar
24
27
-[Why MDX?](#why-mdx)
25
28
-[Related](#related)
26
29
30
+
</details>
31
+
27
32
## Installation
28
33
29
34
```shell
@@ -554,13 +559,11 @@ Read more about injecting your own components in the [official MDX provider guid
554
559
555
560
`gatsby-plugin-mdx@^4.0.0` is a complete rewrite of the original plugin with the goal of making the plugin faster, compatible with [MDX v2](https://mdxjs.com/blog/v2/), leaner, and more maintainable. While doing this rewrite we took the opportunity to fix long-standing issues and remove some functionalities that we now think should be handled by the user, not the plugin. In doing so there will be of course breaking changes you'll have to handle – but with the help of this migration guide and the codemods you'll be on the new version in no time!
556
561
557
-
**Please Note:** Loading MDX from other sources as the file system is not yet supported in `gatsby-plugin-mdx@^4.0.0`.
If you used any related plugins like `gatsby-remark-images`, also update them to their `@latest` version.
@@ -715,6 +718,8 @@ In our testing, most of the time the issue were curly brackets that needed to be
715
718
+ You can upload this to `Git{Hub,Lab}`
716
719
```
717
720
721
+
You can also use [`eslint-mdx`](https://github.com/mdx-js/eslint-mdx) to find all culprits and in some cases automatically fix them through ESLint.
722
+
718
723
### Updating MDX nodes
719
724
720
725
Since most MDX nodes are moved to userland you'll have to [extend the GraphQL MDX nodes](#extending-the-graphql-mdx-nodes) and update your queries accordingly. However, you can [alias your `fields`](https://www.gatsbyjs.com/docs/reference/graphql-data-layer/schema-customization/#aliasing-fields) to have them at the root of the GraphQL node.
- Removed `timeToRead`, `rawBody`, `slug`, `headings`, `html`, `mdxAST`, `wordCount`, `fileAbsolutePath` from the query result. You can check [Extending the GraphQL MDX nodes](#extending-the-graphql-mdx-nodes) to learn how to re-implement some of them on your own. Also check [Updating MDX nodes](#updating-mdx-nodes) for guidance on changing your queries
779
784
-`gatsby-plugin-mdx` only applies to local files (that are sourced with `gatsby-source-filesystem`)
780
785
- Removed the ability to use `js` and `json` in frontmatter
786
+
- Loading MDX from other sources as the filesystem is not supported. If you have a need for that, please comment in the [GitHub Discussion](https://github.com/gatsbyjs/gatsby/discussions/25068)
781
787
- All [MDX v2 migration](https://mdxjs.com/migrating/v2/) notes apply
782
788
783
789
As mentioned above the `html` field was removed from the GraphQL node. We know that some of you used this for e.g. `gatsby-plugin-feed`. Unfortunately, for compatibility and performance reasons we had to remove it. We recommend using the `excerpt` field in the meantime until we find a feasible solution to provide MDX rendered as HTML. If you have any suggestions, please comment on the [GitHub Discussion](https://github.com/gatsbyjs/gatsby/discussions/25068).
0 commit comments