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

Core: Set loose: true in babel/preset-env config #15055

Merged
merged 2 commits into from
May 27, 2021

Conversation

IanVS
Copy link
Member

@IanVS IanVS commented May 26, 2021

Issue: #14805

What I did

The warnings being thrown seem to be coming from storybook's default babel configs mixing loose: true in some of the babel plugins but not on @babel/preset-env, which defaults to loose: false. Those settings all technically need to match up, to avoid the warnings. Changing loose to false would be a possibly-breaking change, but setting loose: true on the preset-env silences the warnings while keeping the actual current behavior. (The warnings were saying basically, "We can't use false like you want").

How to test

  • Is this testable with Jest or Chromatic screenshots? - No
  • Does this need a new example in the kitchen sink apps? - No
  • Does this need an update to the documentation? - No

If your answer is yes to any of these, please make sure to include it in your PR.

I made these changes in the node_modules/@storybook files of my project (which has no custom babel config), and verified that the warnings are no longer shown.

@nx-cloud
Copy link

nx-cloud bot commented May 26, 2021

Nx Cloud Report

CI ran the following commands for commit 10aa40c. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@IanVS
Copy link
Member Author

IanVS commented May 26, 2021

I ran yarn test locally and it passed. I'll need to troubleshoot it looks like.

@IanVS
Copy link
Member Author

IanVS commented May 26, 2021

It seems like the CI jobs that are failing here are also failing on other PRs as well, so I don't think it's related to my changes here.

With that, note that the output in the e2e CI (https://app.circleci.com/pipelines/github/storybookjs/storybook/18801/workflows/86961a94-b6c5-4b52-bf91-f7b7b0355a59/jobs/320757) does not contain the "loose" warnings as another recent example PR does: (https://app.circleci.com/pipelines/github/storybookjs/storybook/18800/workflows/a78f192d-6762-488f-96c8-814001f9d7b7/jobs/320741)

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Working great @IanVS -- thanks so much for this 🙏

I'd like a few more eyes on this before I merge. Discussion on loose mode here: https://2ality.com/2015/12/babel6-loose-mode.html

cc @ndelangen @tmeasday @gaetanmaisse

@shilman shilman added the core label May 27, 2021
Copy link
Member

@gaetanmaisse gaetanmaisse left a comment

Choose a reason for hiding this comment

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

LGTM. Failing e2e tests are related to yarnpkg/berry#2938

@shilman shilman changed the title Set loose: true in babel/preset-env config Core: Set loose: true in babel/preset-env config May 27, 2021
@shilman shilman merged commit 9e73865 into storybookjs:next May 27, 2021
@IanVS IanVS deleted the avoid-loose-warnings branch May 27, 2021 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants