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
[@babel/parser] Add "allowUndeclaredExports" option #9864
[@babel/parser] Add "allowUndeclaredExports" option #9864
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10697/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for me (and for Meteor)! Thanks @nicolo-ribaudo!
We (Marko) are working on integrating babel to parse the JavaScript sections of our templates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍, docs on this too
Anything I can do to move this along? Happy to write the docs if I can get a quick checklist of places to look. 🙏 |
I'm writing the release blog post, hopefully I will release this PR in the following days.
❤️ ❤️ ❤️ |
Documents the changes from babel/babel#9864 implemented by @nicolo-ribaudo.
@nicolo-ribaudo done! |
Documents the changes from babel/babel#9864 implemented by @nicolo-ribaudo.
babel/babel#9864 This hack narrowly targets @babel/parser@7.4.x by tricking Array.from(this.scope.undefinedExports) into returning an empty array, thereby simulating the effect of enabling the allowUndeclaredExports option (which will become available in @babel/parser@7.5.0).
If you need any additional motivation to get this shipped, check out the unholy workaround I came up with in benjamn/reify#230. 😉 |
) babel/babel#9864 This hack narrowly targets @babel/parser@7.4.x by tricking Array.from(this.scope.undefinedExports) into returning an empty array, thereby simulating the effect of enabling the allowUndeclaredExports option (which will become available in @babel/parser@7.5.0).
* docs(@babel/parser): Document allowUndeclaredExports option. Documents the changes from babel/babel#9864 implemented by @nicolo-ribaudo. * Clarify when allowUndeclaredExports is intended to be used.
After updating @babel/parser to version 7.5.0, I can verify that the monkey-patching changes in PR #230 are no longer necessary, though it doesn't hurt to leave them in place, since the interception logic is restricted to versions in the 7.4.x range. The allowUndeclaredExports option is now required, as anticipated: babel/babel#9864
Now that @babel/parser@7.5.0 is out, we no longer need to simulate the effect of babel/babel#9864. See also benjamn/reify#230.
This should have been included in #9864 but was not.
Ref: https://github.com/babel/notes/blob/master/2019/04/09.md#export-changes-in-scope-pr-break-meteor-issue
cc @benjamn Would this work for meteor?