Skip to content
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 8] Adjust buildUndefinedNode and gatherSequenceExpressions #15822

Closed
wants to merge 2 commits into from

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Jul 30, 2023

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT
  1. Move buildUndefinedNode to @babel/types.
  2. Remove the second parameter of gatherSequenceExpressions.

@babel-bot
Copy link
Collaborator

babel-bot commented Jul 30, 2023

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

eslint.config.js Outdated
Comment on lines 197 to 204

if (config.processor) {
config.processor.meta = {
version: "jest/recommended",
name: "jest/recommended",
};
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Actually the previous eslint with cache was broken for the test file (exception in husky).
I'm not sure if this is correct, you might want to take a look! @JLHwung

Copy link
Contributor

Choose a reason for hiding this comment

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

The version is supposed to be what it is in the package.json of eslint-plugin-jest, and the name is likely jest/snapshot-processor. Anyway this change should have been applied on the upstream repo. We can leave a todo note to remove that once eslint-plugin-jest specifies such info.


export function buildUndefinedNode() {
return unaryExpression("void", numericLiteral(0), true);
}
Copy link
Member

Choose a reason for hiding this comment

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

Could you split this in a separate PR, that we can include in the changelog for the next Babel 7 minor, and only keep breaking changes in this one?

Copy link
Member

Choose a reason for hiding this comment

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

Hey, do you want to prepare this for 7.23.0? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

Of course, I will do it right away!

@@ -783,7 +783,7 @@ export default class Scope {
}

buildUndefinedNode() {
Copy link
Member

Choose a reason for hiding this comment

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

Do you think we could get rid of this in Babel 8?

Copy link
Contributor

Choose a reason for hiding this comment

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

Given that t.buildUndefinedNode will be likely introduced in the next minor, if we remove scope.buildUndefinedNode, it will break many plugins with very short transition period. I suggest we deprecate scope.buildUndefinedNode from the next minor and remove it in Babel 9, if Babel 8 is to be released soon.

@liuxingbaoyu liuxingbaoyu changed the title [babel8] Adjust buildUndefinedNode and gatherSequenceExpressions [babel 8] Adjust buildUndefinedNode and gatherSequenceExpressions Aug 1, 2023
@JLHwung JLHwung added this to the Babel 8.0 milestone Aug 8, 2023
@JLHwung JLHwung added PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release and removed babel 8 labels Aug 8, 2023
@nicolo-ribaudo
Copy link
Member

Could you rebase? :)

path.scope.registerBinding(kind, declarPath.get("declarations")[len - 1]);
path.scope.registerBinding(
["using", "await using"].includes(kind) ? "const" : (kind as BindingKind),
declarPath.get("declarations")[len - 1],
Copy link
Member

Choose a reason for hiding this comment

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

Also, could you add a test for this change? (and maybe split it to another PR if it fixes a bug :P)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah! I should fix it another way.
44627e5 (#15822)

@nicolo-ribaudo
Copy link
Member

Replaced by #16057 -- sorry for asking to rebase 😅

@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 23, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: traverse pkg: types PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants