Skip to content

[Babel 8] Remove optional field from MemberExpression#13407

Merged
nicolo-ribaudo merged 1 commit into
babel:mainfrom
danez:me-optional
Jun 3, 2021
Merged

[Babel 8] Remove optional field from MemberExpression#13407
nicolo-ribaudo merged 1 commit into
babel:mainfrom
danez:me-optional

Conversation

@danez

@danez danez commented Jun 1, 2021

Copy link
Copy Markdown
Member
Q                       A
Fixed Issues?
Patch: Bug Fix? 👍
Major: Breaking Change? behind flag
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

The validation is already removed behind the flag, but the field should also be removed from the builder then.

It was added in #5813 before the optional-chaining was moved into its own AST node in #7288

I noticed this in v7 because I tried to compare AST nodes generated from the parser foo.bar to a manual generated node types.memberExpression(types.identifier("foo"), types.identifier("bar")) and they did not match, because the builder always adds the optional field (set to null).

edit: Ok need to figure out the test problems first.

@babel-bot

babel-bot commented Jun 1, 2021

Copy link
Copy Markdown
Collaborator

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

@codesandbox-ci

codesandbox-ci Bot commented Jun 1, 2021

Copy link
Copy Markdown

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 179bffa:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

@JLHwung

JLHwung commented Jun 1, 2021

Copy link
Copy Markdown
Contributor

The CI fails because we passed fourth argument (though used) of t.memberExpression in

and

we can remove it in Babel 7 since optional is an optional property.

@danez

danez commented Jun 3, 2021

Copy link
Copy Markdown
Member Author

Ok I checked all usages of the builder and didn't find any other usages of the 4th param than the two usages mentioned above.

@JLHwung JLHwung changed the title Remove optional field from MemberExpression if BABEL_TYPES_8_BREAKING set [Babel 8] Remove optional field from MemberExpression Jun 3, 2021

@nicolo-ribaudo nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@nicolo-ribaudo nicolo-ribaudo changed the title [Babel 8] Remove optional field from MemberExpression [Babel 8] Remove optional field from MemberExpression Jun 3, 2021
@nicolo-ribaudo
nicolo-ribaudo merged commit 176bc24 into babel:main Jun 3, 2021
@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 Sep 3, 2021
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 3, 2021
@nicolo-ribaudo nicolo-ribaudo added this to the v8.0.0 milestone Aug 8, 2023
@nicolo-ribaudo nicolo-ribaudo added PR: Internal (next major) 🏠 A type of pull request used for our changelog categories for next major release and removed babel 8 labels Aug 8, 2023
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: types PR: Internal (next major) 🏠 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.

4 participants