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
Fix moduleAttributesVersion errors with stage-0 preset in babel standalone #11631
Fix moduleAttributesVersion errors with stage-0 preset in babel standalone #11631
Conversation
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit a6336c8:
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/23060/ |
@@ -3,11 +3,11 @@ import { declare } from "@babel/helper-plugin-utils"; | |||
export default declare((api, { version }) => { | |||
api.assertVersion(7); | |||
|
|||
if (typeof version !== "string" || version !== "apr-2020") { | |||
if (typeof version !== "string" || version !== "may-2020") { |
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.
Good catch!
I now we don't have many tests for |
Sure! Would something like asserting that stage-0 doesn't throw when passing |
Added a small regression test 👍 |
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.
Thanks.
Changes:
moduleAttributesVersion
config option on thestage-0
preset for babel standalonemoduleAttributesVersion
onto the config forstage-1
presetmodule-attributes
plugin andplugin-utils
file (one was expectingversion: 'apr-2020'
and the other was expectingversion: 'may-2020'
, I assumed that may is the correct version here) See: https://github.com/babel/babel/blob/master/packages/babel-parser/src/plugin-utils.js#L95-L101example.htm
file for testing the changes locallyTesting steps:
make prepublish-build-standalone
npx serve ./packages/babel-standalone
examples/example.htm