Skip to content

Remove NodePath#visit#17722

Merged
nicolo-ribaudo merged 1 commit intobabel:mainfrom
liuxingbaoyu:remove-dead-code-traverse
Jan 29, 2026
Merged

Remove NodePath#visit#17722
nicolo-ribaudo merged 1 commit intobabel:mainfrom
liuxingbaoyu:remove-dead-code-traverse

Conversation

@liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Jan 23, 2026

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#3155
Any Dependency Changes?
License MIT

@babel-bot
Copy link
Collaborator

babel-bot commented Jan 23, 2026

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

@liuxingbaoyu liuxingbaoyu force-pushed the remove-dead-code-traverse branch from bcba8aa to 8d3da9f Compare January 23, 2026 08:13
it("param referenced in function body", function () {
const path = getIdentifierPath("function square(n) { return n * n}");
const referencePaths = path.context.scope.bindings.n.referencePaths;
const referencePaths = path.scope.bindings.n.referencePaths;
Copy link
Member

Choose a reason for hiding this comment

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

This is a breaking change right?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes.
We also removed path.visit, but it's no longer working.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Jan 23, 2026

Open in StackBlitz

commit: 05b82fc

@nicolo-ribaudo nicolo-ribaudo added the PR: Breaking Change 💥 A type of pull request used for our changelog categories for next major release label Jan 23, 2026
@nicolo-ribaudo nicolo-ribaudo changed the title Removing unused code for traverse Remove NodePath#visit and NodePath#context Jan 23, 2026
@liuxingbaoyu
Copy link
Member Author

liuxingbaoyu commented Jan 23, 2026

We haven't removed NodePath#context yet, only two of its properties.
However, I would prefer users to avoid using it, as context also seems to impact performance, and we may change it in the future.

@nicolo-ribaudo nicolo-ribaudo changed the title Remove NodePath#visit and NodePath#context Remove NodePath#visit Jan 23, 2026
@nicolo-ribaudo
Copy link
Member

Oh this needs a rebase already

@liuxingbaoyu liuxingbaoyu force-pushed the remove-dead-code-traverse branch from 8d3da9f to 05b82fc Compare January 23, 2026 15:13
@nicolo-ribaudo nicolo-ribaudo merged commit 3205f2f into babel:main Jan 29, 2026
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: traverse 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.

4 participants