Skip to content

Commit

Permalink
Update mdx (gatsbyjs#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandernanberg authored and ChristopherBiscardi committed Jun 27, 2019
1 parent 4d115e8 commit d92a819
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`mdx-loader snapshot with body 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const _frontmatter = {};
Expand All @@ -27,7 +27,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with frontmatter 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const _frontmatter = {
Expand Down Expand Up @@ -55,7 +55,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with frontmatter-layout 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const _frontmatter = {
Expand Down Expand Up @@ -85,7 +85,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with frontmatter-layout-namedExports 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const meta = {
Expand Down Expand Up @@ -119,7 +119,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with frontmatter-namedExports 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const meta = {
Expand Down Expand Up @@ -151,7 +151,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with layout 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const _frontmatter = {};
Expand All @@ -177,7 +177,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with layout-namedExports 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const meta = {
Expand Down Expand Up @@ -207,7 +207,7 @@ MDXContent.isMDXComponent = true;
exports[`mdx-loader snapshot with namedExports 1`] = `
import React from "react";
/* @jsx mdx */
import mdx from "@mdx-js/react/create-element";
import { mdx } from "@mdx-js/react";
/* @jsx mdx */
export const meta = {
Expand Down
3 changes: 1 addition & 2 deletions packages/gatsby-plugin-mdx/mdx-renderer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const React = require("react");
const { withMDXComponents } = require("@mdx-js/react");
const mdx = require("@mdx-js/react/create-element");
const { withMDXComponents, mdx } = require("@mdx-js/react");
const { withMDXScope } = require("./context");

module.exports = withMDXScope(
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"test": "jest"
},
"peerDependencies": {
"@mdx-js/mdx": "^1.0.0-alpha.16",
"@mdx-js/react": "^1.0.0-alpha.16"
"@mdx-js/mdx": "^1.0.0-alpha.17",
"@mdx-js/react": "^1.0.0-alpha.17"
},
"dependencies": {
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-mdx/utils/gen-mdx.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const _frontmatter = ${JSON.stringify(data)}`;
});

results.rawMDXOutput = `/* @jsx mdx */
import mdx from '@mdx-js/react/create-element';
import { mdx } from '@mdx-js/react';
${code}`;

if (!isLoader) {
Expand Down

0 comments on commit d92a819

Please sign in to comment.