Enable import attributes parsing by default#16850
Enable import attributes parsing by default#16850nicolo-ribaudo merged 30 commits intobabel:mainfrom
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58236 |
bc5c5e9 to
4b411ae
Compare
|
This reached consensus for stage 4. |
4b411ae to
c81d348
Compare
| class_method_kinds/polymorphic_getter.js | ||
| class_properties/migrated_0026.js | ||
| comment_interning/declare_variable.js | ||
| dynamic_import/migrated_0005.js |
There was a problem hiding this comment.
This is testing that dynamic import does not accept a second argument
fecbca9 to
fc0e5cd
Compare
|
Aside: Now that JSON module also reaches stage 4, should we rename |
|
We should definitely rename it, but I'm a bit hesitant about adding it by default to preset-env because it can change existing behavior when transforming modules. For example, if you have Maybe we could enable it only when not compiling modules? |
0f16dab to
e5d28bd
Compare
|
One day CI for this PR will be green, I promise. |
|
CI is finally green. I updated the PR description to reflect the current state of the PR :) |
4de6ca1 to
6230a31
Compare
|
Ughh rebasing broke it |
90803dc to
dacba13
Compare
|
The failure is a bug in Babel that, when fixed, triggers a bug in Node.js. I'll open a PR with a workaround soon. |
| @@ -1,3 +1,3 @@ | |||
| { | |||
| "throws": "This experimental syntax requires enabling the parser plugin: \"importAttributes\". (1:16)" | |||
| "throws": "Unexpected token, expected \")\" (1:25)" | |||
There was a problem hiding this comment.
It should throw an ImportCallArity?
| @@ -0,0 +1,31 @@ | |||
| { | |||
There was a problem hiding this comment.
Let's change the file name or the input.
There was a problem hiding this comment.
This can be just removed 👍
e99cefe to
d8026e4
Compare
Fixes #1, Fixes #2It got consensus for Stage 4 at the October 2024 TC39 meeting.
This PR adds a
"deprecatedImportAssert"parser plugin, as a replacement for["importAttributes", { "depreatedAssertSyntax": true }]so that we can remove theimportAttributesplugin (because it won't be needed anymore).This PR also has some changes relevant for Babel 8:
importAssertionsparser plugin now throws, as it's removed and not supported anymore[importAttributes, { deprecatedAssertSyntax: true }]parser plugin now throws, telling you to usedeprecatedImportAssertinstead (unless you are already using that plugin, in which case we simply ignore the old one)@babel/generatordefaults to printing attributes aswith { x: "foo" }instead ofwith x: "foo".