acornjs / acorn-jsx

Alternative, faster React.js JSX parser
MIT License
646 stars 72 forks source link

Support JSXText node #73

Closed soda0289 closed 7 years ago

soda0289 commented 7 years ago

The Facebook JSX AST spec has recently changed. They now use JSXText nodes instead of Literal nodes to store strings inside of JSXElement nodes. https://github.com/facebook/jsx/blob/master/AST.md#jsx-text

This would be a breaking change, if Literal was changed to JSXText, but would allow this plugin to generate an AST that is more consistent with Babylon, Flow and ESPrima.

@RReverser Is this something that you would consider changing?

RReverser commented 7 years ago

👍 Can you please submit a PR so that it would go into the next major release?

soda0289 commented 7 years ago

Sure, will work on this tomorrow

soda0289 commented 7 years ago

It was pretty simple change I just used the same code for the literal nodes in acorn. https://github.com/RReverser/acorn-jsx/pull/74

RReverser commented 7 years ago

Published a new major version.