Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to generate JS AST #1382

Merged
merged 1 commit into from
Dec 18, 2020
Merged

Refactor to generate JS AST #1382

merged 1 commit into from
Dec 18, 2020

Commits on Dec 18, 2020

  1. Refactor to generate JS AST

    This PR changes the internals of the core `@mdx-js/mdx` package to generate a
    JavaScript syntax tree instead of a string.
    This fixes escaping issues such as #1219.
    It makes `mdx-hast-to-jsx` much more palatable.
    It also prevents several Babel parses.
    It paves the way for passing in Babel plugins, which is useful for users, but
    also for us to compile to `React.createElement`, `_jsx`, or Vue’s `h` calls
    directly and make MDX’s output directly usable.
    
    * `babel-plugin-apply-mdx-type-props`: add `parentType`
    * `mdx`: use `rehype-minify-whitespace` to remove superfluous whitespace
    * `mdx`: use `hast-util-to-estree` to transform hast to estree
    * `mdx`: use `estree-to-babel` to transform estree to Babel
    * `mdx`: generate estree/Babel instead of strings
    * `mdx`: use `@babel/generator` to serialize Babel AST
    * `vue`: stop supporting the react transform: (it doesn’t make sense)
    * `vue`: fix support for props to components
    
    Related to GH-741.
    Related to GH-1152.
    
    Closes GH-606.
    Closes GH-1028.
    Closes GH-1219.
    wooorm committed Dec 18, 2020
    Configuration menu
    Copy the full SHA
    04a85f7 View commit details
    Browse the repository at this point in the history