Skip to content

Commit d421cf8

Browse files
authored
chore(gatsby-plugin-mdx): Upgrade MDX and snapshots (#26143)
Starting in version 1.6.16, the makeShortcode function is only added to compiled MDX when it is needed. This caused the gatsby-plugin-mdx snapshots to fall out of date. MDX is no bumped to 1.6.16 with the snapshots updated. Related: - #24595 (comment) - mdx-js/mdx#1088
1 parent f1bfd53 commit d421cf8

File tree

3 files changed

+293
-104
lines changed

3 files changed

+293
-104
lines changed

packages/gatsby-plugin-mdx/loaders/__snapshots__/mdx-loader.test.js.snap

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,6 @@ import { mdx } from "@mdx-js/react";
77
/* @jsx mdx */
88
99
export const _frontmatter = {};
10-
11-
const makeShortcode = (name) =>
12-
function MDXDefaultShortcode(props) {
13-
console.warn(
14-
"Component " +
15-
name +
16-
" was not imported, exported, or provided by MDXProvider as global scope"
17-
);
18-
return <div {...props} />;
19-
};
20-
2110
const layoutProps = {
2211
_frontmatter,
2312
};
@@ -51,17 +40,6 @@ export const _frontmatter = {
5140
three: 4,
5241
array: [1, 2, 3],
5342
};
54-
55-
const makeShortcode = (name) =>
56-
function MDXDefaultShortcode(props) {
57-
console.warn(
58-
"Component " +
59-
name +
60-
" was not imported, exported, or provided by MDXProvider as global scope"
61-
);
62-
return <div {...props} />;
63-
};
64-
6543
const layoutProps = {
6644
_frontmatter,
6745
};
@@ -95,17 +73,6 @@ export const _frontmatter = {
9573
three: 4,
9674
array: [1, 2, 3],
9775
};
98-
99-
const makeShortcode = (name) =>
100-
function MDXDefaultShortcode(props) {
101-
console.warn(
102-
"Component " +
103-
name +
104-
" was not imported, exported, or provided by MDXProvider as global scope"
105-
);
106-
return <div {...props} />;
107-
};
108-
10976
const layoutProps = {
11077
_frontmatter,
11178
};
@@ -144,17 +111,6 @@ export const _frontmatter = {
144111
three: 4,
145112
array: [1, 2, 3],
146113
};
147-
148-
const makeShortcode = (name) =>
149-
function MDXDefaultShortcode(props) {
150-
console.warn(
151-
"Component " +
152-
name +
153-
" was not imported, exported, or provided by MDXProvider as global scope"
154-
);
155-
return <div {...props} />;
156-
};
157-
158114
const layoutProps = {
159115
meta,
160116
_frontmatter,
@@ -194,17 +150,6 @@ export const _frontmatter = {
194150
three: 4,
195151
array: [1, 2, 3],
196152
};
197-
198-
const makeShortcode = (name) =>
199-
function MDXDefaultShortcode(props) {
200-
console.warn(
201-
"Component " +
202-
name +
203-
" was not imported, exported, or provided by MDXProvider as global scope"
204-
);
205-
return <div {...props} />;
206-
};
207-
208153
const layoutProps = {
209154
meta,
210155
_frontmatter,
@@ -235,17 +180,6 @@ import { mdx } from "@mdx-js/react";
235180
/* @jsx mdx */
236181
237182
export const _frontmatter = {};
238-
239-
const makeShortcode = (name) =>
240-
function MDXDefaultShortcode(props) {
241-
console.warn(
242-
"Component " +
243-
name +
244-
" was not imported, exported, or provided by MDXProvider as global scope"
245-
);
246-
return <div {...props} />;
247-
};
248-
249183
const layoutProps = {
250184
_frontmatter,
251185
};
@@ -280,17 +214,6 @@ export const meta = {
280214
author: "chris",
281215
};
282216
export const _frontmatter = {};
283-
284-
const makeShortcode = (name) =>
285-
function MDXDefaultShortcode(props) {
286-
console.warn(
287-
"Component " +
288-
name +
289-
" was not imported, exported, or provided by MDXProvider as global scope"
290-
);
291-
return <div {...props} />;
292-
};
293-
294217
const layoutProps = {
295218
meta,
296219
_frontmatter,
@@ -326,17 +249,6 @@ export const meta = {
326249
author: "chris",
327250
};
328251
export const _frontmatter = {};
329-
330-
const makeShortcode = (name) =>
331-
function MDXDefaultShortcode(props) {
332-
console.warn(
333-
"Component " +
334-
name +
335-
" was not imported, exported, or provided by MDXProvider as global scope"
336-
);
337-
return <div {...props} />;
338-
};
339-
340252
const layoutProps = {
341253
meta,
342254
_frontmatter,

packages/gatsby-plugin-mdx/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
"unist-util-visit": "^1.4.1"
5757
},
5858
"devDependencies": {
59-
"@mdx-js/mdx": "^1.6.6",
60-
"@mdx-js/react": "^1.6.6",
59+
"@mdx-js/mdx": "^1.6.16",
60+
"@mdx-js/react": "^1.6.16",
6161
"jest": "^24.9.0",
6262
"js-combinatorics": "^0.5.5",
6363
"react-test-renderer": "^16.13.1"

0 commit comments

Comments
 (0)