7 ms·
I wish the browsers moved on with the support as fast as Node so that we can get rid of stupid hundreds of MBs dependencies to transform a arrow function.
by CSDude 10y ago
I wish the browsers moved on with the support as fast as Node so that we can get rid of stupid hundreds of MBs dependencies to transform a arrow function.
- minitech 10y agoBrowsers already support arrow functions (and did before Node), but there’s no reason to break compatibility with old browsers just to get arrow functions. If that’s the only thing you’re transforming, my advice would be to stop and just use function () {}.
- TAForObvReasons 10y ago> we can get rid of stupid hundreds of MBs dependencies to transform a arrow function. Depending on your target market, you may be stuck on ES5. Your users' browser behavior determines when you can remove the shims and transforms, and if they aren't upgrading you can't really force them to upgrade the browsers.
- komali2 10y ago>force them to upgrade their browsers Please yes
- tracker1 10y agoThe engine that Node is using is already in chrome, and iirc all the major current versions of browsers already have 97% support (tail call opts withstanding, I think for safari this is still a vNext issue). You can use one of a number of modern targets which will avoid the need for the various polyfils etc... but if you need current safari and any IE support, you will at least need dual build paths, which isn't too bad. I kind of wish there was a babel preset that was meant to be used in conjuction with Financial Times' polyfill.io
- hzoo 10y agoI've been working on https://github.com/babel/babel-preset-env/ https://github.com/babel/babel-preset-env/ and there's a similar request although using babel-polyfill rather than the service https://github.com/babel/babel-preset-env/issues/20 https://github.com/babel/babel-preset-env/issues/20
- qaq 10y agoHmm Node is trailing chrome what exactly are you talking about?
- BinaryIdiot 10y agoSo two things. First, it doesn't matter how fast browsers moved. Currently they're moving pretty damn quick if you ask me but it doesn't matter because you need to know your audience and what browser(s) they use. Second, I don't understand the want or need to include "hundreds of MBs dependencies to transform a arrow function". Why do you have to use an arrow function? Yeah it looks nicer but if you're complaining about how much dependency it brings in why not just not use it? Don't get me wrong I like ECMAScript 2015 but if you don't want to bring in the huge amount of transpiler dependencies ECMASCript 5 is still super easy to write.
- algesten 10y agoExactly my point. Arrow functions and destructuring assignments are great, but we've put up with function() { ... } for the last 20 years, so I'm pretty certain we can wait a couple of more years and not get bogged down in these crazy tooling chains to achieve so little. and if we insist on crazy tooling chains, how about getting some real benefit – like coffeescript (?-operator anyone) or typescript (yes, typing can help, just look at swift)?
- tiglionabbit 10y agoThey do. Try writing an arrow function into your browser's console right now. http://caniuse.com/#feat=arrow-functions http://caniuse.com/#feat=arrow-functions