-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Enable import attributes parsing by default #16850
Enable import attributes parsing by default #16850
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
@@ -8,6 +8,7 @@ async_arrow_functions/with_type_parameters_types_disabled.js | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should throw an ImportCallArity
?
@@ -0,0 +1,31 @@ | |||
{ |
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.
Let's change the file name or the input.
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 can be just removed 👍
e99cefe
to
d8026e4
Compare
Fixes #1, Fixes #2
It 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 theimportAttributes
plugin (because it won't be needed anymore).This PR also has some changes relevant for Babel 8:
importAssertions
parser plugin now throws, as it's removed and not supported anymore[importAttributes, { deprecatedAssertSyntax: true }]
parser plugin now throws, telling you to usedeprecatedImportAssert
instead (unless you are already using that plugin, in which case we simply ignore the old one)@babel/generator
defaults to printing attributes aswith { x: "foo" }
instead ofwith x: "foo"
.