Skip to content

Releases: mdx-js/mdx

v0.16.1

20 Nov 12:02
Compare
Choose a tag to compare
  • remove unused dependencies
  • update remark and other dependencies
  • prevent unnecessary remounting of user-defined layouts (#307)

v0.16.0

06 Nov 15:21
Compare
Choose a tag to compare
  • add all missing dependencies to MDX packages, now they should work with Yarn Plug'n'Play
  • get rid of React warning about metaString prop by renaming it to lowercase metastring instead
  • remove a lot of unnecessary dependencies for modern React environments in @mdx-js/tag
    • ⚠️ this is a breaking change for React < 16.3

v0.15.7

03 Nov 16:56
Compare
Choose a tag to compare
  • add missing dependency detab to @mdx-js/mdx (#296)

v0.15.6

30 Oct 16:09
Compare
Choose a tag to compare
  • add support for remark and rehype plugins to @mdx-js/runtime

    <MDX
      components={components}
      mdPlugins={[slug, autolinkHeadings]}
      hastPlugins={[[addClasses, { h1: 'title' }]]}
      children="# Hello world!"
    />
  • Formidable released spectacle-boilerplate-mdx!

  • fix bug where a semicolon would break an export default statement (#277)

v0.15.5

02 Oct 19:17
Compare
Choose a tag to compare
  • move @mdx-js/mdx from devDependencies to dependencies in @mdx-js/loader (#276)
  • @azz released eslint-plugin-mdx!
  • fix webpack error when importing @mdx-js/runtime in create-react-app v1 (#281, #283)

v0.15.4

24 Sep 18:54
Compare
Choose a tag to compare

Fix edge case with multiline default exports

The following export statement used to cause a syntax error if it was at the end of the MDX file:

export default ({ children }) => (
  <Layout>
    {children}
  </Layout>
)

This has now been fixed. (#188)

Better error upon encountering a named default export

The following exporting default via named exports used to cause an error that there are duplicate default exports (#205):

export { default } from './Layout'

Now it throws a better error, suggesting to use the default export statement instead:

import Layout from './Layout'
export default Layout

v0.15.3

20 Sep 17:00
Compare
Choose a tag to compare

Fix translating style, aria-* and data-* properties to JSX

Some plugins like rehype-katex add style and aria-* properties. These properties need to be handled differently in JSX, so now we convert all style properties from string to object syntax, and all aria-* and data-* property names from camelCase to param-case. (#261)

Info string

Both CommonMark and GFM support adding additional text after language definition in fenced code blocks, a.k.a. the info string. Now MDX passes this data as props:

```js repl
console.log('Hello world!')
```

The above compiles roughly to:

<MDXTag name="pre" components={components}>
  <MDXTag
    name="code"
    components={components}
    parentName="pre"
    props={{
      className: 'language-js',
      metaString: 'repl',
      repl: true,
    }}
  >
    {`console.log('Hello world!');`}
  </MDXTag>
</MDXTag>

One use case for this is adding props for Prism's line-highlight plugin:

```js data-line=2
function doSomething() {
  throw new Error('Something went wrong') // this line will be highlighted!
}
```

More stable support for comments

Our support for comments was a spotty (#244, #256), but now we're taking advantage of remark's ability to recognize comments, which should take care of all edge cases.

Nested comments

We used to support Markdown-like comments nested in JSX:

## Heading

<MyComp>
  <!-- this is a comment?! -->
</MyComp>

This was odd and misleading because the rest of the comment wasn't being interpreted as MDX. We removed this feature, so if you were relying on this behavior, simply use JSX comments instead:

## Heading

<MyComp>
  {/* now that's a comment! */}
</MyComp>

Add filepath info to the loader

07 Sep 19:15
Compare
Choose a tag to compare

Whitespace is now properly preserved in code blocks

07 Sep 18:02
Compare
Choose a tag to compare

Improve import/export parsing

10 Aug 22:13
Compare
Choose a tag to compare
  • String interpolation and other syntax is now correctly handled with imports and exports
  • Props passed in are now also exposed to JSX block
  • skipExport option
  • Examples improvements
  • Parcel plugin now handles .md files
  • npm init mdx