You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
Hi @kentcdodds, I am still getting my head around this new preset.
Because not all browsers support new feature of ES, if you want to use those features, you need babel preset to transpile it so browsers can understand them. At this point, I understand the purpose of preset like es2015, es2016,...
And gradually browsers adopt more new ES features, it's no point in transpile and send polyfills down to client anymore, that's why they introduce babel-preset-env
Here are my questions:
We have the option to specify the browsers we want to target, e.g.
1/ How does babel know which browser has what features so it does not need to transpile those features?
2/ With above example, if users with safari version 6 go to our website, functions might not work, right?
3/ What does versions imply, the major version (59, 60) or the minor/patch (59.0.1,...)?
4/ Adopting this new preset, we need to know for sure which browsers we support?
Thanks :)
The text was updated successfully, but these errors were encountered:
I was locked out of my house for a few hours the other day so I recorded answers to a bunch of my AMA questions and put them up on my 3 minute podcast. Here's your answer!
Hi @kentcdodds, I am still getting my head around this new preset.
Because not all browsers support new feature of ES, if you want to use those features, you need babel preset to transpile it so browsers can understand them. At this point, I understand the purpose of preset like es2015, es2016,...
And gradually browsers adopt more new ES features, it's no point in transpile and send polyfills down to client anymore, that's why they introduce babel-preset-env
Here are my questions:
We have the option to specify the browsers we want to target, e.g.
{ "presets": [ ["env", { "targets": { "browsers": ["last 2 versions", "safari >= 7"] } }] ] }
1/ How does babel know which browser has what features so it does not need to transpile those features?
2/ With above example, if users with safari version 6 go to our website, functions might not work, right?
3/ What does versions imply, the major version (59, 60) or the minor/patch (59.0.1,...)?
4/ Adopting this new preset, we need to know for sure which browsers we support?
Thanks :)
The text was updated successfully, but these errors were encountered: