Skip to content

Migrate babylon to @babel/parser #272

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

Merged
merged 2 commits into from
Jun 6, 2018
Merged

Migrate babylon to @babel/parser #272

merged 2 commits into from
Jun 6, 2018

Conversation

danez
Copy link
Collaborator

@danez danez commented Jun 6, 2018

Add option to switch back to legacy decorators parsing

This is a breaking change as it will by default only parse the latest decorators spec which changed the syntax.

@danez danez merged commit ee8a535 into v3-dev Jun 6, 2018
@danez danez deleted the babylon branch June 6, 2018 13:33
@oktak
Copy link

oktak commented Jul 4, 2018

Hello,
Will this migration would support dynamic import() ?

Issue:
I've got SyntaxError: 'import' and 'export' may only appear at the top level when I use import() within the React Component class definition.

I've seen that the error is raised from babylon\lib\parser\statement.js
And I see that there is similar error message in babel-parser too:
https://github.com/babel/babel/blob/master/packages/babel-parser/src/parser/statement.js#L151

I would like to ask if React-docgen could add the options for Parser that allowImportExportEverywhere could set to the value that would eliminate the SyntaxError mentioned above.

Thank you!

Version and Platform:

  • react-docgen: 2.21.0 (npm view react-docgen version)
  • node v8.9.4
  • npm v5.6.0
  • windows 7 64bit

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants