3 ms·
It's just hard knowing which browsers will support something and when. It's be nice to have a browser target config nicely built in to babel. Like, I want to su
by Cshelton 11y ago
It's just hard knowing which browsers will support something and when. It's be nice to have a browser target config nicely built in to babel. Like, I want to support any major browser version after Aug. 2015. If something is supported in all of the browsers, drop the transpiler for it.
- davnicwil 11y agoYes, fantastic idea. I have been wondering about this a lot. It feels like about a year since writing then transpiling ES6 became a fairly mainstream approach, and we're nowhere near having full ES6 support in enough (or actually any, for now at least) browsers with a high proportion of usage. This is manageable because you can just reason "well, I'll transpile everything to ES5" and be done with it. But what happens when most browsers do support ES6, but not ES7, or ES8 - what about when people don't update browsers, etc. I am really worried about this becoming such a nightmare that the default will always to be to transpile everything to an older version (probably 5 or 6) for the next 2-3 years just for safety, even when some browsers do support new versions coming out. Can anyone point me to any resources which address and discuss this issue? Your idea about specific browser version targeting in the transpiler is a great one, and one I'd not even considered before, thanks.
- fabian2k 11y agoAutoprefixer uses caniuse.com data to decide which prefixes to add. Not sure how exactly they do that and if that is a manual process or automated. Caniuse has some data on Javascript support, but I'm not sure if it is at a sufficiently detailed level for this purpose.
- Cshelton 11y agoWell I haven't contributed anything to babel, but if I get some free time (it's rare), I might see if I can figure something out and make a thread to discuss it. I'm sure they have thought about it already... Even if you can list a version number for each of the major browsers you need to support, that'd be awesome. We actually tell all of our clients using our Web app to update to the latest browser when possible. Hopefully the days of companies not upgrading their browsers are almost behind us... But I'm sure many will be stuck supporting Safari 8 for example, which has very little es6 support, for a while. I know of some large corporations who can't upgrade to IOS 9 and thus Safari 9 because of ivp6 issues...
- chocolateboy 11y ago> Can anyone point me to any resources which address and discuss this issue? https://github.com/babel/babel/issues/631 https://github.com/babel/babel/issues/631
- Cshelton 11y agoHmm, it was closed because it was considered 'out of scope'. Who does the testing on every browser/device combination seems to be the big question. Seems like something Babel should set up internally as it's their tool and thus people will need to trust when they say "on these devices and these browser versions, block scoping 'let' works." Rather than a 3rd party just saying, yeah it works...