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

Enable external-helpers by default in tests #12911

Merged
merged 12 commits into from Feb 26, 2021

Conversation

nicolo-ribaudo
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo commented Feb 25, 2021

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

This PR updates our test runner so that it always uses the external-helpers plugin, unless it's disabled with "externalHelpers": false in options.json.

This has the following advantages:

  • We reduce the "visual noise" in our output.js files, helping reviewers focusing on the important output
  • When an helper changes, we don't get a ton of updated fixtures just because the internal code of the helper was updated (example: Fix _isNativeReflectConstruct helper #8461)
  • There will be a single place where we'll need to update the helperVersion option, rather than hundreds of them.

This PR is inspired from #11285 (comment). but I can't find it anymore 😅

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 25, 2021

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 59dc102:

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

@nicolo-ribaudo nicolo-ribaudo marked this pull request as draft February 25, 2021 22:38
@babel-bot
Copy link
Collaborator

babel-bot commented Feb 25, 2021

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

@babel babel deleted a comment from mwwm1 Feb 25, 2021
@nicolo-ribaudo nicolo-ribaudo marked this pull request as ready for review February 25, 2021 23:48
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.

Not a blocker: The new option should also be reflected in #12619.

Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

💯💯 amazing idea, makes a lot of sense! I'm just wondering where we want to document this like in contributing that this is the default or in some readme's in the test runner?

like a section in https://github.com/babel/babel/blob/main/CONTRIBUTING.md#babelplugin-x? We don't have that many docs on helpers in general really or explaining that we need them

@nicolo-ribaudo
Copy link
Member Author

Good idea, I added a small section to CONTRIBUTING.md.

CONTRIBUTING.md Outdated Show resolved Hide resolved
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.

The new options.json docs looks good to me!

babel-bot and others added 2 commits February 26, 2021 22:11
Co-authored-by: Huáng Jùnliàng <jlhwung@gmail.com>
@nicolo-ribaudo nicolo-ribaudo merged commit ea6a438 into babel:main Feb 26, 2021
@nicolo-ribaudo nicolo-ribaudo deleted the test-external-helpers branch February 26, 2021 22:33
Nicolò's ideal PR review order list automation moved this from To review to Done Feb 26, 2021
jridgewell added a commit to jridgewell/babel that referenced this pull request Mar 8, 2021
babel#12911 was a breaking change that now requires you to keep `babel-plugin-external-helpers` in your `package.json`. It'll will probably be unnoticeable for most, because another dependency could transitively depend on it, but AMP recently hit it when cleaning up our deps.
jridgewell added a commit that referenced this pull request Mar 8, 2021
* Optionally enable external-helpers in tests

#12911 was a breaking change that now requires you to keep `babel-plugin-external-helpers` in your `package.json`. It'll will probably be unnoticeable for most, because another dependency could transitively depend on it, but AMP recently hit it when cleaning up our deps.

* Cast to boolean

* Fix package name
@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 May 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: tests outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Development

Successfully merging this pull request may close these issues.

None yet

4 participants