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

fix: Don't load browserslist in block-hoist-plugin #13182

Merged

Conversation

MichaReiser
Copy link
Contributor

@MichaReiser MichaReiser commented Apr 20, 2021

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

7.13.0 introduced the new option browserslistConfigFile in #12189. The documentation specifies that the option toggles whatever babel looks for a browserslists configuration or not.

Toggles whether or not browserslist config sources are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json. This is useful for projects that use a browserslist config for files that won't be compiled with Babel.

This works fine, except that the block-hoist-plugin loads a configuration without setting the browserslistConfigFile to false.

The block-hoist-plugin should set the browserslistConfigFile to false to prevent babel from loading (or looking for) a browserslists config when users explicitly disabled this functionality. The block-hoist-plugin makes no use of the browserslist itself, which is why the change should be fine.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Apr 20, 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 0e11cca:

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

@babel-bot
Copy link
Collaborator

babel-bot commented Apr 20, 2021

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

@@ -12,6 +12,7 @@ export default function loadBlockHoistPlugin(): Plugin {
const config = loadConfig.sync({
babelrc: false,
configFile: false,
browserslistConfigFile: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

Actually we can completely avoid loadConfig.sync. I drafted some perf changes before but never come up with a PR: JLHwung@15da88e

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would even be better! It wasn't clear to me why it was needed so I tried to work around it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@JLHwung are you planning to submit your changes as a PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Nope, feel free to tackle it.

Copy link
Member

Choose a reason for hiding this comment

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

seems good as temp fix then? didn't even know we had this..

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Apr 20, 2021
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

The code changes look good.

If you have time to work on it I would prefer something like what @JLHwung proposed in #13182 (comment); otherwise we can merge this and then update it in the future.

@JLHwung JLHwung merged commit adb5ada into babel:main Apr 21, 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 Jul 22, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 22, 2021
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: Bug Fix 🐛 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

5 participants