Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Dec 8, 2025

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link babel/website#3146
Any Dependency Changes?
License MIT

This PR cleans up babel-parser logics on import assertions and JSON modules. We also removed all decorators plugin options as Babel 8 only supports two versions: legacy and 2023-11.

@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release Spec: Decorators PR: Needs Docs labels Dec 8, 2025

@(foo + bar) method2() {}

@(this.foo)(bar) method3() {}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test was extracted into a new test: invalid-parenthesized-callexpression because the production is invalid per 2023-11 spec.

@JLHwung JLHwung marked this pull request as draft December 8, 2025 19:04
@babel-bot
Copy link
Collaborator

babel-bot commented Dec 8, 2025

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60410

this.raise(Errors.ImportReflectionNotBinding, specifiers[0].loc.start);
}
// @ts-expect-error comparing undefined and number
if (node.assertions?.length > 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nicolo-ribaudo The current spec https://tc39.es/proposal-source-phase-imports/#sec-imports does not allow withClause after the fromClause when there is an import phase. If this is intentional, we should add a similar check to the .attributes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No it's just that it hasn't been rebased after import attributes was merged. The PR in the spec repo supports both.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 8, 2025

Open in StackBlitz

commit: ce154ab

@JLHwung JLHwung marked this pull request as ready for review December 8, 2025 21:52
@dec(0)
@globalThis.dec(0)
@(globalThis["dec"])(0)
@((globalThis["dec"])(0))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this expected?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, now you cannot have a parenthesized expression followed by call arguments. The whole thing needs to be in the parentheses.

@nicolo-ribaudo nicolo-ribaudo merged commit 87890c6 into babel:main Dec 12, 2025
54 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the parser-cleanup branch December 12, 2025 17:25
coderaiser added a commit to putoutjs/babel that referenced this pull request Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: generator pkg: parser PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release Spec: Decorators

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants