From 9f0cf9f0f43d892811ddb31fcff4f09730f365e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benedikt=20R=C3=B6tsch?= Date: Wed, 27 Jul 2022 10:36:18 +0200 Subject: [PATCH] MDXv2: update example using-mdx (#36009) * WIP * WIP#2 * ensure loader actually picks up mdx file path and prepare query parsing * avoid issue with false-flag query duplicates * properly inject compiled MDX as children * fix: chunk names now should no more exceed max file path length * fix too long chunk names * fix: ensure page component validation uses clear path * fix: properly set clean path on all page component validations * test: add unit test for chunk name shortening * fix: improve chunk name shortening * refactor: apply breaking changes to using-mdx * Restore js-chunk-names.ts * Restore index.d.ts * Restore blog-post.js * update example * rename dir * baseline * more setup * finish * broken state with head api * update * add mdx test case * fix head api bug * formatting Co-authored-by: LekoArts --- docs/docs/how-to/routing/mdx.md | 2 +- .../mdx/importing-and-using-components.md | 2 +- examples/using-MDX/README.md | 60 --- examples/using-MDX/gatsby-config.js | 44 -- examples/using-MDX/package.json | 54 --- examples/using-MDX/src/components/image.js | 30 -- examples/using-MDX/src/images/gatsby-icon.png | Bin 21212 -> 0 bytes examples/using-MDX/src/pages/chart-info.mdx | 432 ------------------ examples/using-MDX/src/pages/index.js | 19 - examples/using-mdx/.prettierignore | 3 + examples/using-mdx/README.md | 49 ++ examples/using-mdx/content/posts/blog-1.mdx | 14 + examples/using-mdx/content/posts/blog-2.mdx | 18 + .../content/posts}/gatsby-astronaut.png | Bin examples/using-mdx/gatsby-browser.jsx | 6 + examples/using-mdx/gatsby-config.js | 43 ++ examples/using-mdx/gatsby-node.js | 50 ++ examples/using-mdx/gatsby-ssr.jsx | 6 + examples/using-mdx/package.json | 36 ++ .../src/components/header.jsx} | 15 +- .../src/components/layout.css | 2 + .../src/components/layout.jsx} | 19 +- .../using-mdx/src/components/shortcodes.jsx | 29 ++ .../404.js => using-mdx/src/pages/404.jsx} | 8 +- examples/using-mdx/src/pages/chart-info.mdx | 154 +++++++ examples/using-mdx/src/pages/index.jsx | 35 ++ examples/using-mdx/src/templates/posts.jsx | 27 ++ packages/gatsby-plugin-mdx/src/gatsby-node.ts | 14 +- .../fixtures/remove-apis/mdx/input.mjs | 27 ++ .../fixtures/remove-apis/mdx/output.mjs | 27 ++ 30 files changed, 546 insertions(+), 679 deletions(-) delete mode 100644 examples/using-MDX/README.md delete mode 100644 examples/using-MDX/gatsby-config.js delete mode 100644 examples/using-MDX/package.json delete mode 100644 examples/using-MDX/src/components/image.js delete mode 100644 examples/using-MDX/src/images/gatsby-icon.png delete mode 100644 examples/using-MDX/src/pages/chart-info.mdx delete mode 100644 examples/using-MDX/src/pages/index.js create mode 100644 examples/using-mdx/.prettierignore create mode 100644 examples/using-mdx/README.md create mode 100644 examples/using-mdx/content/posts/blog-1.mdx create mode 100644 examples/using-mdx/content/posts/blog-2.mdx rename examples/{using-MDX/src/images => using-mdx/content/posts}/gatsby-astronaut.png (100%) create mode 100644 examples/using-mdx/gatsby-browser.jsx create mode 100644 examples/using-mdx/gatsby-config.js create mode 100644 examples/using-mdx/gatsby-node.js create mode 100644 examples/using-mdx/gatsby-ssr.jsx create mode 100644 examples/using-mdx/package.json rename examples/{using-MDX/src/components/header.js => using-mdx/src/components/header.jsx} (73%) rename examples/{using-MDX => using-mdx}/src/components/layout.css (99%) rename examples/{using-MDX/src/components/layout.js => using-mdx/src/components/layout.jsx} (66%) create mode 100644 examples/using-mdx/src/components/shortcodes.jsx rename examples/{using-MDX/src/pages/404.js => using-mdx/src/pages/404.jsx} (73%) create mode 100644 examples/using-mdx/src/pages/chart-info.mdx create mode 100644 examples/using-mdx/src/pages/index.jsx create mode 100644 examples/using-mdx/src/templates/posts.jsx create mode 100644 packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/input.mjs create mode 100644 packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/output.mjs diff --git a/docs/docs/how-to/routing/mdx.md b/docs/docs/how-to/routing/mdx.md index 1be363c96f45f..d3ecf2765eb1b 100644 --- a/docs/docs/how-to/routing/mdx.md +++ b/docs/docs/how-to/routing/mdx.md @@ -2,7 +2,7 @@ title: Add components to content using MDX examples: - label: Using MDX - href: "https://github.com/gatsbyjs/gatsby/tree/master/examples/using-MDX" + href: "https://github.com/gatsbyjs/gatsby/tree/master/examples/using-mdx" --- ## Introduction diff --git a/docs/docs/mdx/importing-and-using-components.md b/docs/docs/mdx/importing-and-using-components.md index c1cf58658d5e0..ffe0acb07b77b 100644 --- a/docs/docs/mdx/importing-and-using-components.md +++ b/docs/docs/mdx/importing-and-using-components.md @@ -119,4 +119,4 @@ Here is a demo: ### Additional resources -- Follow this detailed [example on using MDX](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-MDX) to import and render components. +- Follow this detailed [example on using MDX](https://github.com/gatsbyjs/gatsby/tree/master/examples/using-mdx) to import and render components. diff --git a/examples/using-MDX/README.md b/examples/using-MDX/README.md deleted file mode 100644 index e898182d423e7..0000000000000 --- a/examples/using-MDX/README.md +++ /dev/null @@ -1,60 +0,0 @@ -

- - Gatsby logomark - -

-

- Using MDX Example -

- -This repository demonstrates how to add MDX pages to a new Gatsby site. - -In the pages directory of this example you will find the `chart-info.mdx` file which uses a variety of components to display interactive charts. - -## 🔧 Running locally - -The site can be run locally on your own computer as well by following these steps: - -1. Clone the `gatsby` repository - -```shell -git clone git@github.com:gatsbyjs/gatsby.git -``` - -2. Navigate to the example - -```shell -cd gatsby/examples/using-MDX -``` - -3. Install the dependencies for the application by running - -```shell - -npm install - -``` - -4. Run the Gatsby development server - -```shell -gatsby develop -``` - -The site is now running at `http://localhost:8000`, you can see the MDX example page at `http://localhost:8000/chart-info` - -## 🧰 Resources used to create this project - -- [Gatsby default starter repo](https://github.com/gatsbyjs/gatsby-starter-default) -- [Gatsby plugin MDX](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/) -- [Bar chart from Nivo Charts](https://nivo.rocks/bar/) -- [Line chart from Nivo Charts](https://nivo.rocks/line/) -- [Area Bump chart from Nivo Charts](https://nivo.rocks/area-bump/) - -## 🎓 More Guides for Learning Gatsby and MDX - -Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.com/). Here are some places to start: - -- **For most developers, it's recommended to start with the [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.com/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process. - -- **To dive straight into code samples, head [to the official Gatsby documentation](https://www.gatsbyjs.com/docs/).** In particular, check out the [MDX section of the sidebar](https://www.gatsbyjs.com/docs/mdx/). diff --git a/examples/using-MDX/gatsby-config.js b/examples/using-MDX/gatsby-config.js deleted file mode 100644 index d7472db9008a9..0000000000000 --- a/examples/using-MDX/gatsby-config.js +++ /dev/null @@ -1,44 +0,0 @@ -module.exports = { - siteMetadata: { - title: `Using MDX example`, - description: `Kick off your next, great Gatsby project with MDX.`, - author: `@pragmaticpat`, - }, - plugins: [ - `gatsby-plugin-react-helmet`, - { - resolve: `gatsby-source-filesystem`, - options: { - name: `images`, - path: `${__dirname}/src/images`, - }, - }, - `gatsby-transformer-sharp`, - `gatsby-plugin-sharp`, - { - resolve: `gatsby-plugin-manifest`, - options: { - name: `gatsby-starter-default`, - short_name: `starter`, - start_url: `/`, - background_color: `#663399`, - theme_color: `#663399`, - display: `minimal-ui`, - icon: `src/images/gatsby-icon.png`, // This path is relative to the root of the site. - }, - }, - { - resolve: `gatsby-plugin-mdx`, - options: { - defaultLayouts: { - default: require.resolve(`./src/components/layout.js`), - }, - }, - }, - `gatsby-plugin-image`, - - // this (optional) plugin enables Progressive Web App + Offline functionality - // To learn more, visit: https://gatsby.dev/offline - // `gatsby-plugin-offline`, - ], -} diff --git a/examples/using-MDX/package.json b/examples/using-MDX/package.json deleted file mode 100644 index 5c3e89311f6db..0000000000000 --- a/examples/using-MDX/package.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "name": "using-mdx-example", - "private": true, - "description": "A simple starter to get up and developing quickly with Gatsby", - "version": "0.1.0", - "author": "Kyle Mathews ", - "dependencies": { - "@mdx-js/mdx": "^1.6.18", - "@mdx-js/react": "^1.6.18", - "@nivo/bar": "0.78.0", - "@nivo/bump": "^0.79.1", - "@nivo/core": "0.78.0", - "@nivo/line": "0.78.0", - "gatsby": "next", - "gatsby-image": "next", - "gatsby-plugin-image": "^2.13.0", - "gatsby-plugin-manifest": "next", - "gatsby-plugin-mdx": "next", - "gatsby-plugin-offline": "next", - "gatsby-plugin-react-helmet": "next", - "gatsby-plugin-sharp": "next", - "gatsby-source-filesystem": "next", - "gatsby-transformer-sharp": "next", - "prop-types": "^15.7.2", - "react": "^18.0.0", - "react-charts": "^2.0.1", - "react-chat-elements": "^10.10.2", - "react-dom": "^18.0.0", - "react-helmet": "^5.2.1" - }, - "devDependencies": { - "prettier": "2.1.1" - }, - "keywords": [ - "gatsby" - ], - "license": "MIT", - "scripts": { - "build": "gatsby build", - "develop": "gatsby develop", - "format": "prettier --write \"**/*.{js,jsx,json,md}\"", - "start": "npm run develop", - "serve": "gatsby serve", - "clean": "gatsby clean", - "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/gatsbyjs/gatsby-starter-default" - }, - "bugs": { - "url": "https://github.com/gatsbyjs/gatsby/issues" - } -} diff --git a/examples/using-MDX/src/components/image.js b/examples/using-MDX/src/components/image.js deleted file mode 100644 index 6b2344f4e93d2..0000000000000 --- a/examples/using-MDX/src/components/image.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from "react" -import { useStaticQuery, graphql } from "gatsby" -import { GatsbyImage, getImage } from "gatsby-plugin-image" - -/* - * This component is built using `gatsby-image` to automatically serve optimized - * images with lazy loading and reduced file sizes. The image is loaded using a - * `useStaticQuery`, which allows us to load the image from directly within this - * component, rather than having to pass the image data down from pages. - * - * For more information, see the docs: - * - `gatsby-image`: https://gatsby.dev/gatsby-image - * - `useStaticQuery`: https://www.gatsbyjs.com/docs/use-static-query/ - */ - -const Image = () => { - const data = useStaticQuery(graphql` - query { - placeholderImage: file(relativePath: { eq: "gatsby-astronaut.png" }) { - childImageSharp { - gatsbyImageData(width: 300) - } - } - } - `) - const image = getImage(data.placeholderImage) - return -} - -export default Image diff --git a/examples/using-MDX/src/images/gatsby-icon.png b/examples/using-MDX/src/images/gatsby-icon.png deleted file mode 100644 index 908bc78a7f5596fab5a638d6ac07e331dc4c74d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 21212 zcmYg%byQT}`}G~VL6Pq6l5PZ~QyQd1q@=qCX+c0jx{(x+kcJsRN>IAHk?v;ZH~9I! zYrTK4n8iKuoG13)&*4tAmWCoO7C9CG0JzFZ@~;2@3GopLz(7O%I`^5l1%OwD%JMIC zeL(w**h)p4)Zi0MMZ4La!m2?ocIez9{Z!qjXOpt;2f5hdDhbJyB$j7je>UU zztw)va(Z&YR>?9M(EL=eiJ~Oor*9khnb>H|i?_!_3dao0d@*0!Ji{bgLcX>csjVr- zu5i5NjWY9~4<~VBKaw3w`?XV*&E!8J{4H`G>A{R>N zA$G%HqL1WyTN5J4X-O`t+{vf|suT?F}9wX)iG5gQ>X=%7U6ksYJg8l*;9)G}e*0^GR|oaj>tg40wDU*YG(l zaB}lWQe8kL+6LboQ3rqo-A{h^gm77Mve-3)_ZAfSwDq5G?>}n4O;F&Vej!=@_&-^zbei@l5fA zckcK}P%qktdTfeoGMao`{B>4(#KBY)si#McHFr{65YFT(o>b)pEjUPp~M8SSfCWQ_Kam0^=2? zaSxHl3TGT`OCVx6(@2yMjwPSM;N2J=F<+RFfM4dy6v84RTN!L_tKL07YZ;TYPV4%- zPEq9N0An7x%`vlrD{?-LvM}#QVb@+7?lDVTpbS)bO@JL~8*M(IYk|9PmdX;1yBEXru!M zy26;?dHyUBhzwxwje(1OC`xnye_z?SyU(YK0y#1Xl&8?xE!+7jnI8dZ8f0BBLY zN;?JTZoGJ*Mi(w7zp01@E_VfWUt`m0Cc?USxs#`DEy)1;pZb#04w$G3EI0SjDPWd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*$W#FpPT~Zz-egvBp!&K7COxKAEJkk22v9=dq(mqNiq;~T zmaqvgZAd36TApHX(3)#iD`{!B4eHT+5svBPvW~zAHFD-2L}0cv8Ul;qkVtRJr@*B~YRK5Ed3E<@&l-dajO!xImACR#ZNaAcZF?;VZv zUBFu2FT8P~l{ zT|QG2gTSmiHX)_Jfn@3szUwoD4MW$fQJ2U{)`W-#)Dq>UFokHlW>53O~nGyRi+NWMHDPms7Kl!%6G+_a?btikhYIK-(hGnHb(MN_x=L ze%&)wlZpsT?$=a)y=W~N?=fRNdsCCW>t1pziNhV9nQVCr@&RI~1s)PIzmV$7n#h3B zn0iF*cUa40rRNI{{pIm*`aS}6l-ciN8+ph06yA=C2Vl+G1?t|2L4^OpIQSfXc|a{! z!wQAG!k%FGdl#krm~ZY2J|~{%=Asz8#6w{h{5r_>aFy%A@`zp{w?)C|cif?;oaqT- zUD$)Vj{#3q%o+~Ls2Lvdzf#L#0^yeDccaH|&@Jt6Px9yFk#Jw-b(eTDH0Ofci?pG_ zN2t1WGVUcX$|aW!s|2;82AQXt66*#4=j!Q{_`A4WIxu#!Pa}=FYG`$ zF`6PP2Yx(^Zi-Q3z{W}&GcngDB&Be$O)Ux_53~AxgR@2}#Yl;kgxQeRv9Fix^gNod zC+T_cb-Ml)yujyeMp~_z(C0vbBcf}+qrhWYL^bQ3nb3Anif}6?U|U@Z@#wQdzgB^% z&o}?cCU9*fEBqLhNmMxFB~dnB4BJjSPFOO#~KgK z6V`!9{BKK%dzmdlh0Dm?ax&(U2Yc=^($}>?=Mc)Wj=%(Lc+ob}NGB;R;09IcVM2Lb_=1C>nDY>!x6L~zBy1TnhqRJQDeJCa0i_PM!L7==Y?0dn Pwx}U%bK8?;ra1Edyv(7f diff --git a/examples/using-MDX/src/pages/chart-info.mdx b/examples/using-MDX/src/pages/chart-info.mdx deleted file mode 100644 index 3ecd5c37d75c4..0000000000000 --- a/examples/using-MDX/src/pages/chart-info.mdx +++ /dev/null @@ -1,432 +0,0 @@ -import { ResponsiveBar } from "@nivo/bar" -import { ResponsiveLine } from "@nivo/line" -import { ResponsiveAreaBump } from "@nivo/bump" - -## Nivo Charts examples in MDX - -This file is written in MDX and has a live React component you can interact with; try hovering over the data to get more granular information. - -### Data represented in BarChart - -
- -
- -### Data represented in a Line Chart - -
- - - -
- - -### Data represented in AreaChart - -
- -
- -export const areaData = [ - { - id: "JavaScript", - data: [ - { - x: 2000, - y: 15, - }, - { - x: 2001, - y: 30, - }, - { - x: 2002, - y: 25, - }, - { - x: 2003, - y: 29, - }, - { - x: 2004, - y: 11, - }, - { - x: 2005, - y: 28, - }, - ], - }, - { - id: "ReasonML", - data: [ - { - x: 2000, - y: 14, - }, - { - x: 2001, - y: 26, - }, - { - x: 2002, - y: 16, - }, - { - x: 2003, - y: 16, - }, - { - x: 2004, - y: 12, - }, - { - x: 2005, - y: 12, - }, - ], - }, - { - id: "TypeScript", - data: [ - { - x: 2000, - y: 14, - }, - { - x: 2001, - y: 15, - }, - { - x: 2002, - y: 10, - }, - { - x: 2003, - y: 22, - }, - { - x: 2004, - y: 25, - }, - { - x: 2005, - y: 30, - }, - ], - }, - { - id: "Elm", - data: [ - { - x: 2000, - y: 24, - }, - { - x: 2001, - y: 13, - }, - { - x: 2002, - y: 22, - }, - { - x: 2003, - y: 28, - }, - { - x: 2004, - y: 22, - }, - { - x: 2005, - y: 11, - }, - ], - }, - { - id: "CoffeeScript", - data: [ - { - x: 2000, - y: 18, - }, - { - x: 2001, - y: 27, - }, - { - x: 2002, - y: 27, - }, - { - x: 2003, - y: 17, - }, - { - x: 2004, - y: 19, - }, - { - x: 2005, - y: 15, - }, - ], - }, -] -export const barData = [ - { - year: "2014", - InApp: 29, - Advertising: 17, - }, - { - year: "2015", - InApp: 30, - Advertising: 9, - }, - { - year: "2016", - InApp: 38, - Advertising: 10, - }, - { - year: "2017", - InApp: 36, - Advertising: 14, - }, - { - year: "2018", - InApp: 35, - Advertising: 12, - }, - { - year: "2019", - InApp: 32, - Advertising: 3, - }, - { - year: "2020", - InApp: 9, - Advertising: 4, - }, -] - -export const lineData = [ - { - id: "InApp", - data: [ - { - x: "2014", - y: 29, - }, - { - x: "2015", - y: 30, - }, - { - x: "2016", - y: 38, - }, - { - x: "2017", - y: 36, - }, - { - x: "2018", - y: 35, - }, - { - x: "2019", - y: 32, - }, - { - x: "2020", - y: 9, - }, - ], - }, - { - id: "Advertising", - data: [ - { - x: "2014", - y: 17, - }, - { - x: "2015", - y: 9, - }, - { - x: "2016", - y: 10, - }, - { - x: "2017", - y: 14, - }, - { - x: "2018", - y: 12, - }, - { - x: "2019", - y: 3, - }, - { - x: "2020", - y: 4, - }, - ], - }, -] diff --git a/examples/using-MDX/src/pages/index.js b/examples/using-MDX/src/pages/index.js deleted file mode 100644 index 1b89e847f8808..0000000000000 --- a/examples/using-MDX/src/pages/index.js +++ /dev/null @@ -1,19 +0,0 @@ -import React from "react" -import { Link } from "gatsby" - -import Layout from "../components/layout" -import Image from "../components/image" - -const IndexPage = () => ( - -

Hi people

-

Welcome to your new Gatsby site.

-

Now go build something great.

-
- -
- Go to the MDX page -
-) - -export default IndexPage diff --git a/examples/using-mdx/.prettierignore b/examples/using-mdx/.prettierignore new file mode 100644 index 0000000000000..4f2858c3c176a --- /dev/null +++ b/examples/using-mdx/.prettierignore @@ -0,0 +1,3 @@ +.cache +public +node_modules \ No newline at end of file diff --git a/examples/using-mdx/README.md b/examples/using-mdx/README.md new file mode 100644 index 0000000000000..e5e88a78b137e --- /dev/null +++ b/examples/using-mdx/README.md @@ -0,0 +1,49 @@ +# using-mdx + +This repository demonstrates how to use MDX with Gatsby. + +## 🔧 Running locally + +The site can be run locally on your own computer as well by following these steps: + +1. Clone the `gatsby` repository + +```shell +git clone git@github.com:gatsbyjs/gatsby.git +``` + +2. Navigate to the example + +```shell +cd gatsby/examples/using-mdx +``` + +3. Install the dependencies for the application by running + +```shell + +npm install + +``` + +4. Run the Gatsby development server + +```shell +gatsby develop +``` + +The site is now running at `http://localhost:8000`, you can see the MDX example page at `http://localhost:8000/chart-info` + +## 🧰 Learn more + +- [gatsby-plugin-mdx README](https://www.gatsbyjs.com/plugins/gatsby-plugin-mdx/) +- [Adding MDX Pages](https://www.gatsbyjs.com/docs/how-to/routing/mdx/) +- [Bar chart from Nivo Charts](https://nivo.rocks/bar/) + +## 🎓 More Guides for Learning Gatsby and MDX + +Looking for more guidance? Full documentation for Gatsby lives [on the website](https://www.gatsbyjs.com/). Here are some places to start: + +- **For most developers, it's recommended to start with the [in-depth tutorial for creating a site with Gatsby](https://www.gatsbyjs.com/tutorial/).** It starts with zero assumptions about your level of ability and walks through every step of the process. + +- **To dive straight into code samples, head [to the official Gatsby documentation](https://www.gatsbyjs.com/docs/).** In particular, check out [Adding MDX Pages](https://www.gatsbyjs.com/docs/how-to/routing/mdx/). diff --git a/examples/using-mdx/content/posts/blog-1.mdx b/examples/using-mdx/content/posts/blog-1.mdx new file mode 100644 index 0000000000000..63316dbee5e4e --- /dev/null +++ b/examples/using-mdx/content/posts/blog-1.mdx @@ -0,0 +1,14 @@ +--- +title: Blog Post 1 +slug: /blog-1 +--- + +export const Head = () => Blog Post 1 + +Trying out MDX. + +Some GFM features like tables: + +| Hello | World | | | | +|---------|-------|---|---|---| +| How are | you? | | | | \ No newline at end of file diff --git a/examples/using-mdx/content/posts/blog-2.mdx b/examples/using-mdx/content/posts/blog-2.mdx new file mode 100644 index 0000000000000..65fd05caf6940 --- /dev/null +++ b/examples/using-mdx/content/posts/blog-2.mdx @@ -0,0 +1,18 @@ +--- +title: Blog Post 2 +slug: /blog-2 +--- + +Gatsby is the best. + +Here's an image of an astronaut: + +![Gatsby Astronaut](./gatsby-astronaut.png) + +You can use the Collapsible shortcode here because you provide it in the src/templates/posts.jsx MDXProvider. + +Want to click on me?}> + +You'll find content here! + + \ No newline at end of file diff --git a/examples/using-MDX/src/images/gatsby-astronaut.png b/examples/using-mdx/content/posts/gatsby-astronaut.png similarity index 100% rename from examples/using-MDX/src/images/gatsby-astronaut.png rename to examples/using-mdx/content/posts/gatsby-astronaut.png diff --git a/examples/using-mdx/gatsby-browser.jsx b/examples/using-mdx/gatsby-browser.jsx new file mode 100644 index 0000000000000..e4d234354dd01 --- /dev/null +++ b/examples/using-mdx/gatsby-browser.jsx @@ -0,0 +1,6 @@ +import React from "react" +import { Layout } from "./src/components/layout" + +export const wrapPageElement = ({ element, props }) => { + return {element} +} diff --git a/examples/using-mdx/gatsby-config.js b/examples/using-mdx/gatsby-config.js new file mode 100644 index 0000000000000..0518389adc763 --- /dev/null +++ b/examples/using-mdx/gatsby-config.js @@ -0,0 +1,43 @@ +module.exports = { + siteMetadata: { + title: `Using MDX example`, + description: `Kick off your next, great Gatsby project with MDX.`, + author: `@pragmaticpat`, + }, + plugins: [ + { + resolve: `gatsby-source-filesystem`, + options: { + name: `pages`, + path: `${__dirname}/src/pages/`, + }, + }, + { + resolve: `gatsby-source-filesystem`, + options: { + name: `posts`, + path: `${__dirname}/content/posts/`, + }, + }, + `gatsby-plugin-sharp`, + { + resolve: `gatsby-plugin-mdx`, + options: { + mdxOptions: { + remarkPlugins: [ + require(`remark-gfm`), + require(`remark-unwrap-images`), + ], + }, + gatsbyRemarkPlugins: [ + { + resolve: `gatsby-remark-images`, + options: { + maxWidth: 690, + }, + }, + ], + }, + }, + ], +} diff --git a/examples/using-mdx/gatsby-node.js b/examples/using-mdx/gatsby-node.js new file mode 100644 index 0000000000000..53a14f3748c3c --- /dev/null +++ b/examples/using-mdx/gatsby-node.js @@ -0,0 +1,50 @@ +const path = require("path") + +exports.createPages = async ({ graphql, actions, reporter }) => { + const { createPage } = actions + + const result = await graphql(` + query { + allMdx { + nodes { + id + frontmatter { + slug + } + internal { + contentFilePath + } + } + } + } + `) + + if (result.errors) { + reporter.panicOnBuild("Error loading MDX result", result.errors) + } + + const posts = result.data.allMdx.nodes + + posts.forEach(node => { + // Don't create a page for src/pages/chart-info.mdx since this already gets created + if (node.frontmatter.slug !== `/chart-info`) { + if (node.frontmatter.slug === `/blog-1`) { + // For /blog-1 create a page without defining a contentFilePath and just using the layout defined in src/components/layout.jsx + createPage({ + path: node.frontmatter.slug, + component: node.internal.contentFilePath, + context: { id: node.id }, + }) + } else { + // For /blog-2 define a contentFilePath and thus have two layouts. The src/components/layout.jsx and nested inside that the src/templates/posts.jsx + createPage({ + path: node.frontmatter.slug, + component: `${path.resolve( + `./src/templates/posts.jsx` + )}?__contentFilePath=${node.internal.contentFilePath}`, + context: { id: node.id }, + }) + } + } + }) +} diff --git a/examples/using-mdx/gatsby-ssr.jsx b/examples/using-mdx/gatsby-ssr.jsx new file mode 100644 index 0000000000000..e4d234354dd01 --- /dev/null +++ b/examples/using-mdx/gatsby-ssr.jsx @@ -0,0 +1,6 @@ +import React from "react" +import { Layout } from "./src/components/layout" + +export const wrapPageElement = ({ element, props }) => { + return {element} +} diff --git a/examples/using-mdx/package.json b/examples/using-mdx/package.json new file mode 100644 index 0000000000000..b358e5f8fa03b --- /dev/null +++ b/examples/using-mdx/package.json @@ -0,0 +1,36 @@ +{ + "name": "using-mdx", + "private": true, + "description": "Showing how to use MDX in Gatsby", + "version": "0.0.1", + "author": "LekoArts", + "dependencies": { + "@mdx-js/react": "^2.1.2", + "@nivo/core": "^0.79.0", + "@nivo/line": "^0.79.1", + "gatsby": "next", + "gatsby-plugin-mdx": "next", + "gatsby-plugin-sharp": "next", + "gatsby-remark-images": "next", + "gatsby-source-filesystem": "next", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "remark-gfm": "^1", + "remark-unwrap-images": "^2" + }, + "devDependencies": { + "prettier": "^2.7.1" + }, + "keywords": [ + "gatsby" + ], + "license": "MIT", + "scripts": { + "build": "gatsby build", + "develop": "gatsby develop", + "format": "prettier --write \"**/*.{js,jsx,json,md}\"", + "serve": "gatsby serve", + "clean": "gatsby clean", + "test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1" + } +} diff --git a/examples/using-MDX/src/components/header.js b/examples/using-mdx/src/components/header.jsx similarity index 73% rename from examples/using-MDX/src/components/header.js rename to examples/using-mdx/src/components/header.jsx index 8990b7e31bb7a..81a7b2e787862 100644 --- a/examples/using-MDX/src/components/header.js +++ b/examples/using-mdx/src/components/header.jsx @@ -1,8 +1,7 @@ -import { Link } from "gatsby" -import PropTypes from "prop-types" import React from "react" +import { Link } from "gatsby" -const Header = ({ siteTitle }) => ( +export const Header = ({ siteTitle }) => (
(
) - -Header.propTypes = { - siteTitle: PropTypes.string, -} - -Header.defaultProps = { - siteTitle: ``, -} - -export default Header diff --git a/examples/using-MDX/src/components/layout.css b/examples/using-mdx/src/components/layout.css similarity index 99% rename from examples/using-MDX/src/components/layout.css rename to examples/using-mdx/src/components/layout.css index b6f63320fb8ae..4ee929d367d16 100644 --- a/examples/using-MDX/src/components/layout.css +++ b/examples/using-mdx/src/components/layout.css @@ -42,10 +42,12 @@ template { a { background-color: transparent; -webkit-text-decoration-skip: objects; + text-decoration: none; } a:active, a:hover { outline-width: 0; + text-decoration: underline; } abbr[title] { border-bottom: none; diff --git a/examples/using-MDX/src/components/layout.js b/examples/using-mdx/src/components/layout.jsx similarity index 66% rename from examples/using-MDX/src/components/layout.js rename to examples/using-mdx/src/components/layout.jsx index 67ae709096747..702975ad9e025 100644 --- a/examples/using-MDX/src/components/layout.js +++ b/examples/using-mdx/src/components/layout.jsx @@ -1,18 +1,9 @@ -/** - * Layout component that queries for data - * with Gatsby's useStaticQuery component - * - * See: https://www.gatsbyjs.com/docs/use-static-query/ - */ - import React from "react" -import PropTypes from "prop-types" import { useStaticQuery, graphql } from "gatsby" - -import Header from "./header" +import { Header } from "./header" import "./layout.css" -const Layout = ({ children }) => { +export const Layout = ({ children }) => { const data = useStaticQuery(graphql` query SiteTitleQuery { site { @@ -43,9 +34,3 @@ const Layout = ({ children }) => { ) } - -Layout.propTypes = { - children: PropTypes.node.isRequired, -} - -export default Layout diff --git a/examples/using-mdx/src/components/shortcodes.jsx b/examples/using-mdx/src/components/shortcodes.jsx new file mode 100644 index 0000000000000..8641503e7d470 --- /dev/null +++ b/examples/using-mdx/src/components/shortcodes.jsx @@ -0,0 +1,29 @@ +import * as React from "react" + +const Collapsible = ({ summary, children }) => { + return ( +
+ :firstOfType": { display: `inline` }, + }} + > + {summary} + + {children} +
+ ) +} + +export const components = { + Collapsible, +} diff --git a/examples/using-MDX/src/pages/404.js b/examples/using-mdx/src/pages/404.jsx similarity index 73% rename from examples/using-MDX/src/pages/404.js rename to examples/using-mdx/src/pages/404.jsx index 70bc752374a94..1c87297f9bb34 100644 --- a/examples/using-MDX/src/pages/404.js +++ b/examples/using-mdx/src/pages/404.jsx @@ -1,12 +1,12 @@ import React from "react" -import Layout from "../components/layout" - const NotFoundPage = () => ( - + <>

NOT FOUND

You just hit a route that doesn't exist... the sadness.

-
+ ) export default NotFoundPage + +export const Head = () => 404: Not Found diff --git a/examples/using-mdx/src/pages/chart-info.mdx b/examples/using-mdx/src/pages/chart-info.mdx new file mode 100644 index 0000000000000..91280c7801054 --- /dev/null +++ b/examples/using-mdx/src/pages/chart-info.mdx @@ -0,0 +1,154 @@ +--- +title: Chart Info +slug: /chart-info +--- + +export const Head = () => Chart Info + +import { ResponsiveLine } from "@nivo/line" + +## Nivo Charts examples in MDX + +This file is written in MDX and has a live React component you can interact with; try hovering over the data to get more granular information. + +You can also access data from the frontmatter. + +Title: {props.pageContext.frontmatter.title} + +### Data represented in a Line Chart + +
+ +
+ +export const lineData = [ + { + id: "InApp", + data: [ + { + x: "2014", + y: 29, + }, + { + x: "2015", + y: 30, + }, + { + x: "2016", + y: 38, + }, + { + x: "2017", + y: 36, + }, + { + x: "2018", + y: 35, + }, + { + x: "2019", + y: 32, + }, + { + x: "2020", + y: 9, + }, + ], + }, + { + id: "Advertising", + data: [ + { + x: "2014", + y: 17, + }, + { + x: "2015", + y: 9, + }, + { + x: "2016", + y: 10, + }, + { + x: "2017", + y: 14, + }, + { + x: "2018", + y: 12, + }, + { + x: "2019", + y: 3, + }, + { + x: "2020", + y: 4, + }, + ], + }, +] diff --git a/examples/using-mdx/src/pages/index.jsx b/examples/using-mdx/src/pages/index.jsx new file mode 100644 index 0000000000000..8020e2175581b --- /dev/null +++ b/examples/using-mdx/src/pages/index.jsx @@ -0,0 +1,35 @@ +import React from "react" +import { Link } from "gatsby" + +const IndexPage = () => ( + <> +

MDX Example

+

Overview of MDX pages:

+
    +
  • + + Page created from src/pages/chart-info. It shows how to use React + components from npm in MDX and how to use frontmatter in MDX directly + +
  • +
  • + + Programmatically created page that doesn't use __contentFilePath and + is only wrapped by src/components/layout.jsx + +
  • +
  • + + Programmatically created page that does use __contentFilePath and is + wrapped by src/components/layout.jsx and src/templates/posts.jsx. You + see the difference to the page above because there is an h1 with the + title + +
  • +
+ +) + +export default IndexPage + +export const Head = () => Index Page diff --git a/examples/using-mdx/src/templates/posts.jsx b/examples/using-mdx/src/templates/posts.jsx new file mode 100644 index 0000000000000..d733d1f5aa71a --- /dev/null +++ b/examples/using-mdx/src/templates/posts.jsx @@ -0,0 +1,27 @@ +import React from "react" +import { graphql } from "gatsby" +import { MDXProvider } from "@mdx-js/react" +import { components } from "../components/shortcodes" + +const PostsTemplate = ({ data, children }) => { + return ( + <> +

{data.mdx.frontmatter.title}

+ {children} + + ) +} + +export default PostsTemplate + +export const Head = ({ data }) => {data.mdx.frontmatter.title} + +export const query = graphql` + query ($id: String!) { + mdx(id: { eq: $id }) { + frontmatter { + title + } + } + } +` diff --git a/packages/gatsby-plugin-mdx/src/gatsby-node.ts b/packages/gatsby-plugin-mdx/src/gatsby-node.ts index 4b4e63d9192e6..3f9b032ded189 100644 --- a/packages/gatsby-plugin-mdx/src/gatsby-node.ts +++ b/packages/gatsby-plugin-mdx/src/gatsby-node.ts @@ -53,8 +53,11 @@ export const onCreateWebpackConfig: GatsbyNode["onCreateWebpackConfig"] = rules: [ { test: /\.mdx?$/, - use: [ - loaders.js(), + use: ({ resourceQuery, issuer }): Array => [ + loaders.js({ + isPageTemplate: /async-requires/.test(issuer), + resourceQuery, + }), { loader: path.join(__dirname, `gatsby-mdx-loader`), options: mdxLoaderOptions, @@ -64,8 +67,11 @@ export const onCreateWebpackConfig: GatsbyNode["onCreateWebpackConfig"] = { test: /\.[tj]sx?$/, resourceQuery: /__contentFilePath=.+\.mdx?(&export=.*)?$/, - use: [ - loaders.js(), + use: ({ resourceQuery, issuer }): Array => [ + loaders.js({ + isPageTemplate: /async-requires/.test(issuer), + resourceQuery, + }), { loader: path.join(__dirname, `gatsby-layout-loader`), options: layoutLoaderOptions, diff --git a/packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/input.mjs b/packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/input.mjs new file mode 100644 index 0000000000000..df23bbf395478 --- /dev/null +++ b/packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/input.mjs @@ -0,0 +1,27 @@ +import GATSBY_COMPILED_MDX from "/Users/lejoe/code/work/gatsby/examples/using-mdx/content/posts/blog-2.mdx" +import React from "react" +import {graphql} from "gatsby" +import {MDXProvider} from "@mdx-js/react" +import {components} from "../components/shortcodes" + +const PostsTemplate = ({data, children}) => { + return React.createElement(React.Fragment, null, React.createElement("h1", null, data.mdx.frontmatter.title), React.createElement(MDXProvider, { + components: components + }, children)) +} + +export default function GatsbyMDXWrapper(props) { + return React.createElement(PostsTemplate, props, React.createElement(GATSBY_COMPILED_MDX, props)) +} + +export const Head = ({data}) => React.createElement("title", null, data.mdx.frontmatter.title) + +export const query = graphql` + query($id: String!) { + mdx(id: { eq: $id }) { + frontmatter { + title + } + } + } +`; \ No newline at end of file diff --git a/packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/output.mjs b/packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/output.mjs new file mode 100644 index 0000000000000..f1402c2e45b5f --- /dev/null +++ b/packages/gatsby/src/utils/babel/__tests__/fixtures/remove-apis/mdx/output.mjs @@ -0,0 +1,27 @@ +import GATSBY_COMPILED_MDX from "/Users/lejoe/code/work/gatsby/examples/using-mdx/content/posts/blog-2.mdx"; +import React from "react"; +import { graphql } from "gatsby"; +import { MDXProvider } from "@mdx-js/react"; +import { components } from "../components/shortcodes"; + +const PostsTemplate = ({ + data, + children +}) => { + return React.createElement(React.Fragment, null, React.createElement("h1", null, data.mdx.frontmatter.title), React.createElement(MDXProvider, { + components: components + }, children)); +}; + +export default function GatsbyMDXWrapper(props) { + return React.createElement(PostsTemplate, props, React.createElement(GATSBY_COMPILED_MDX, props)); +} +export const query = graphql` + query($id: String!) { + mdx(id: { eq: $id }) { + frontmatter { + title + } + } + } +`;