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

Loosen Babel preset to use browserslist #3770

Merged
merged 6 commits into from
Jan 13, 2018
Merged

Conversation

Timer
Copy link
Contributor

@Timer Timer commented Jan 13, 2018

This removes the ie 9 target and forceAllTransforms since we're dropping IE9 support by default.

We want to allow target browsers to be configurable via the browserslist key in package.json.
This also enables useBuiltIns for smaller bundles.

I've also adjusted the defaults we generate for a more ergonomic development experience.


There's still no story for users upgrading from * -> 2.x (it'd use browserlist defaults currently).

@Timer Timer changed the title Loosen Babel preset to use browsers Loosen Babel preset to use browserslist Jan 13, 2018
@Timer Timer added this to the 2.0.0 milestone Jan 13, 2018
@Timer
Copy link
Contributor Author

Timer commented Jan 13, 2018

Meh, why not? Commits can be reverted (and follow-up PRs made) -- this will be fun to play with in the meantime.

:shipit: 🚀

@Timer Timer merged commit 2e4e4db into facebook:next Jan 13, 2018
@Timer Timer deleted the target-browsers branch January 13, 2018 03:49
@Timer Timer requested a review from gaearon January 13, 2018 03:49
];
appPackage.browserslist = {
development: ['chrome', 'firefox', 'edge'].map(
browser => `last 2 ${browser} versions`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this change? Does this correspond to any specific list we use elsewhere?

Copy link
Contributor

Choose a reason for hiding this comment

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

Never mind, I got it.
Wish there was a shorter way to write this.
Maybe something like >5% is equivalent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I couldn't find a magic percent -- and I didn't want to discriminate browsers.

@gaearon
Copy link
Contributor

gaearon commented Jan 13, 2018

Can you describe how this works in more detail?

In particular, what happens if I write ES6 code and then set browserslist to last chrome version for production? We still use old Uglify (afaik). So does Uglify just crash on App.js class?

@gaearon
Copy link
Contributor

gaearon commented Jan 13, 2018

Or do we use new Uglify now?

@existentialism
Copy link
Contributor

Yep via #3618 and #3743

gaearon pushed a commit that referenced this pull request Jan 13, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
Timer added a commit that referenced this pull request Jan 14, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
gaearon pushed a commit that referenced this pull request Jan 14, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
Timer added a commit to Timer/create-react-app that referenced this pull request Jan 15, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
akstuhl pushed a commit to akstuhl/create-react-app that referenced this pull request Mar 15, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
zmitry pushed a commit to zmitry/create-react-app that referenced this pull request Sep 30, 2018
* Provide better defaults

* Let babel determine features to compile

* meh

* Remove setting of BABEL_ENV

* Revert "Remove setting of BABEL_ENV"

This reverts commit ee2db70.

* Set browsers to ie9
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants