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

Remove unused @babel/helpers code #14343

Merged
merged 6 commits into from Mar 23, 2022

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Mar 9, 2022

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
  • The first commit removes an unnecessary traverse call that we used to get the program path from a File (review this with whitespaces diff disabled)
  • The second commit removes some unused code I found thanks to codecov: it was supporting helpers exporting arbitrary values, but we only export functions since we rely on hoisting
  • The third commit just puts some Babel 7 code behind if (!process.env.BABEL_8_BREAKING) and slightly improves the related types
  • The fourth commit is a perf optimization
  • The fifth commit is just aesthetic
  • The sixth commit is because the first commit broke compat with some old @babel/core versions

@nicolo-ribaudo nicolo-ribaudo added the PR: Internal 🏠 A type of pull request used for our changelog categories label Mar 9, 2022
@babel-bot
Copy link
Collaborator

babel-bot commented Mar 9, 2022

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

@nicolo-ribaudo nicolo-ribaudo marked this pull request as draft March 9, 2022 23:14
- When using `@babel/runtime`, we don't need the metadata so we can skip computing it
- This fixes a Babel 8 bug introduced in the prev commit, because FileClass
is not initialized when not using inline helpers
It's just nicer, side effects in getters are surprising.
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review March 9, 2022 23:59
Copy link
Contributor

@JLHwung JLHwung left a comment

Choose a reason for hiding this comment

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

Nice work!

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

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

👍

@nicolo-ribaudo nicolo-ribaudo merged commit e54bc6b into babel:main Mar 23, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the helpers-minor-refactor branch March 23, 2022 18:01
@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 Jun 23, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 23, 2022
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 PR: Internal 🏠 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants