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(babel-preset-gatsby-package): apply "corejs" only to non-browser target #17727

Merged
merged 3 commits into from Sep 20, 2019

Conversation

sidharthachatterjee
Copy link
Contributor

@sidharthachatterjee sidharthachatterjee commented Sep 18, 2019

Appears to have been introduced in #17723

@sidharthachatterjee sidharthachatterjee requested a review from a team as a code owner September 18, 2019 22:41
@zant
Copy link
Contributor

zant commented Sep 18, 2019

Sorry! I should committed the updates on yarn.lock after bumping core-js to ^2.6.9? And i see that i missed the complete config, my bad

@sidharthachatterjee
Copy link
Contributor Author

sidharthachatterjee commented Sep 18, 2019

@gonzarodriguezt No problem at all! Yeah, the yarn.lock needed to be updated but also found an unusual setting for useBuiltIns in browser based environments. I'm not hundred percent sure of this change so let's wait on @wardpeet who is our resident tooling expert

@zant
Copy link
Contributor

zant commented Sep 18, 2019

Oh okay @sidharthachatterjee let's wait then 🙏

@pieh
Copy link
Contributor

pieh commented Sep 19, 2019

This looks quite weird, I don't think we want to add polyfills to browser code we ship in our npm packages? We only want to add them for site bundles (which is handled by babel-preset-gatsby (and not babel-preset-gatsby-package)?

@sidharthachatterjee
Copy link
Contributor Author

This looks quite weird, I don't think we want to add polyfills to browser code we ship in our npm packages? We only want to add them for site bundles (which is handled by babel-preset-gatsby (and not babel-preset-gatsby-package)?

@pieh That does make sense! So then if that browser is true, we want to remove the corejs field and override useBuiltIns to false?

@pieh
Copy link
Contributor

pieh commented Sep 19, 2019

What is this exactly fixing? I think we are missing some context around why this is needed

@sidharthachatterjee
Copy link
Contributor Author

@pieh
Copy link
Contributor

pieh commented Sep 19, 2019

@pieh That does make sense! So then if that browser is true, we want to remove the corejs field and override useBuiltIns to false?

Ok, so I think this make sense to add corejs: 2 to nodeConfig only and not to all common config, and keep browserConfig as is currently (so revert that part)

@sidharthachatterjee
Copy link
Contributor Author

Ok, so I think this make sense to add corejs: 2 to nodeConfig only and not to all common config, and keep browserConfig as is currently (so revert that part)

Yup, that is the cleanest way to go. Let me update this.

@pieh
Copy link
Contributor

pieh commented Sep 19, 2019

And incidentally, gatsby-transformer-sqip's .babelrc shouldn't use browser variant ;) We should audit .babelrc files really for this stuff (not in scope of this PR)

@sidharthachatterjee
Copy link
Contributor Author

@pieh Done

@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Sep 19, 2019
@zant
Copy link
Contributor

zant commented Sep 19, 2019

You're awesome guys! Hopefully my next contrib will be less messy 😅thank you!

@pieh
Copy link
Contributor

pieh commented Sep 19, 2019

You're awesome guys! Hopefully my next contrib will be less messy 😅thank you!

Don't worry about it! We didn't catch that in review either!

@sidharthachatterjee
Copy link
Contributor Author

You're awesome guys! Hopefully my next contrib will be less messy 😅thank you!

You did great! And thank you so much 🤗

@pieh pieh changed the title fix(babel-preset-gatsby-package): Remove useBuiltIns from browser config fix(babel-preset-gatsby-package): apply "corejs" only to non-browser target Sep 20, 2019
@gatsbybot gatsbybot merged commit 553a3a5 into master Sep 20, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/babel-config branch September 20, 2019 01:06
LOLdevelopr pushed a commit to LOLdevelopr/gatsby-1 that referenced this pull request Sep 21, 2019
…target (gatsbyjs#17727)

* Fix error when building gatsby-transformer-sqip

* Update snapshots

* Only add corejs for node
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants