10 ms·
ECMAScript 2016+ in Firefox
- M4v3R 10y agoGood to see such quick progress in this area in major browsers. It's worth noting that WebKit also has 100% support for ES 2016+. So now only Edge is lagging in this regard. [0] http://kangax.github.io/compat-table/es2016plus/#webkit http://kangax.github.io/compat-table/es2016plus/#webkit
- pjmlp 10y agoIt doesn't help when one needs to target enterprise markets or devices that only have their factory provided browser.
- Touche 10y agoNope, not everything is for everyone.
- paol 10y agoThat's what Babel[0] is for. Realistically you can't rely on native ES2016 for any target audience yet, but with Babel you can blissfully live in the future, today :) Also, thrown in core-js[1] while you're at it. [0] https://babeljs.io/ https://babeljs.io/ [1] https://github.com/zloirock/core-js https://github.com/zloirock/core-js
- Joe8Bit 10y agoA pedantic correction: web extension and add-on authors mostly can in browsers that auto-update.
- pjmlp 10y agoBabel is only part of the history, then there is HTML and CSS support levels. Some of our projects are with customers that still rely on XP with IE 8, require using the "Internet Browser" for pre-Android 4.4 or Windows Safari (!) or IoT devices without updatable browsers.
- CSMastermind 10y agoBabel has it's own set of flaws like causing a performance hit.
- hzoo 10y agoYep and with Babel we recommend using https://github.com/babel/babel-preset-env https://github.com/babel/babel-preset-env to compile only what's missing in the targets you support. Hopefully we have a better solution about making multiple bundles (separate one for IE) soon
- emn13 10y agoI'm currently experimenting with if-no-window.Promise-then-polyfill via polyfill.io (I dont quite trust synchronous dynamic script loading yet, but we'll see if that's robust enough on old browsers). Sure, old browsers need an extra roundtrip, and it's an additional point of failure - but it simplifies dev tooling, and if your users actually cared about perf, they wouldn't be using ancient browsers. It won't fix many issues (e.g. CSS), but at least some, and without making your build complicated, and without performance sacrifices for the majority of devices.
- pjmlp 10y ago> if your users actually cared about perf, they wouldn't be using ancient browsers. Many of them do care, but not the IT department that vets their machines.
- emn13 10y agoThere are pros and cons there. The overhead isn't huge; if you use any ads whatsoever those likely swamp this effect anyhow. And dev time is limited - how much time is it worth shaving at best 100ms off for a small and shrinking group of clients? It's cacheable, so it's a not a commonly recurring delay, and it's likely to be a lot smaller on decent networks. (https://tools.keycdn.com/ping https://tools.keycdn.com/ping puts the worst ping as being from tokyo at 84ms; many are sub-ms as you might expect from a cdn). I think it's (potentially) a better tradeoff than making most clients pay for larger bundle sizes even though they don't need it. But well: tradeoffs.
- endless1234 10y agoOf course it helps, only there is a bit of a lag. How many 'enterprise markets' run <IE9 nowadays?
- pjmlp 10y agoPharma industry, labs with XP machines doing robot automation with IE 8 installed.
- singlow 10y agoBut who needs to access your web app from a dedicated special purpose lab equipment control workstation?
- shakna 10y agoI know of eight products, compulsory for school's to use, such as OnDemand [0], put out by the Australian government, that only run under IE7/8. (Though the published specs say it runs on IE9+ for admin, and IE10+ for students, but I've never got admin to run under anything but IE7, and students on anything more than IE8.) I'd imagine that enterprises are still running many products with similar insane requirements, because they never get updates. [0] http://www.vcaa.vic.edu.au/Pages/prep10/ondemand/index.aspx http://www.vcaa.vic.edu.au/Pages/prep10/ondemand/index.aspx
- phonon 10y agoHave you tried IE11 Enterprise (IE8) mode? https://www.howtogeek.com/184634/how-to-enable-and-use-internet-explorer-11s-enterprise-mode/ https://www.howtogeek.com/184634/how-to-enable-and-use-inter...
- shakna 10y agoUnfortunately there are some minute differences in the way headers get passed to the server, and the user-agent string is slightly different as well. Badly made software doesn't play ball. Though it is theoretically possible to force it to work under IE8 mode, its simpler to supply real IE8 over a remote login.
- krzyk 10y agoChrome has 85% in the above table (up from 80% from previous version), so why you are saying 100%? Maybe the above table doesn't include beta releases of Chrome?
- whatever_dude 10y agoAnd yet WebKit has 99% on ES5, while Edge and Firefox have 100% (and Chrome has 98%). http://kangax.github.io/compat-table/es5/ http://kangax.github.io/compat-table/es5/
- hajile 10y agoBut webkit has 100% support for ES6 (according to kangex) while nobody else does...
- whatever_dude 10y agoYeah, and it's great. It's just that WebKit's (and Apple's) efforts are sometimes.. lopsided.
- emn13 10y agoOn the one hand, the deficiencies in that table don't look all too serious. Maybe Date.toJSON missing is the worst. On the other hand, that's a poor excuse - why the heck haven't they fixed these issues? Cross browser compat is annoying enough as it is.
- nailer 10y agoI can see that strict mode inside a function using default parameters should throw according to the spec ( https://tc39.github.io/ecma262/#sec-function-definitions-static-semantics-early-errors https://tc39.github.io/ecma262/#sec-function-definitions-sta...) but does anyone know why? Is strict mode something we should now be avoiding?
- diggan 10y agoAccording to the documentation on MDN[0], it's a part of "early errors" and you should rather but the "use strict" outside the function instead of on the inside. I'm not entirely sure of why the spec wants it to be outside rather than inside though... - [0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Strict_Non_Simple_Params https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- tomatsu 10y ago> you should rather [put] the "use strict" outside the function instead of on the inside. Modules and classes are always in strict mode. In practice, it really isn't an issue.
- swhipple 10y agoSee here [1], under "Why make this change?". [1] https://www.nczonline.net/blog/2016/10/the-ecmascript-2016-change-you-probably-dont-know/ https://www.nczonline.net/blog/2016/10/the-ecmascript-2016-c...
- nailer 10y agoAh that makes sense - by the time the parser sees a 'use strict' it's too late to apply strict mode to the default arguments. Thanks!
- bushin 10y agoNicholas Zakas has a nice explanation https://leanpub.com/understandinges6/read#leanpub-auto-change-to-function-scoped-strict-mode https://leanpub.com/understandinges6/read#leanpub-auto-chang...
- shadowmint 10y agoRealistically, when are we going to see the modules situation resolved? ES2017? ES2018? I know, I know, just use a transpiler and emit a bundle... but really? It's been a draft since 2015, and no browsers have any support for it yet, despite full support for the rest of the standard? Are modules really that controversial? I'm kind of disappointed, honestly, that despite all the progress in the ecosystem, this long standing issue still remains mysteriously unsolved, by anyone. If you're using a transpiler anyway, who really cares if you have native support for the language features?
- pjmlp 10y ago> If you're using a transpiler anyway, who really cares if you have native support for the language features? Looking forward to the day alternative languages start targeting WebAssembly instead of JavaScript.
- dualogy 10y agoYou mean "the day WebAssembly gets out of preview/alpha/worse status in all major browsers".. yeah, don't we all --- wouldn't hold my breath. Once there, give it another 2 years to actually mature in the wild.
- pjmlp 10y agoI agree, after all we still have some customers on IE 8, but one can wish for it.
- moron4hire 10y agoEven if the browsers support modules, you still will want to generate a bundle, because loading modules on the fly would require lots of tertiary HTTP requests.
- shadowmint 10y agoI was under the impression HTTP/2 would make this concern irrelevant... but I'm no expert on the subject. I suppose its a valid point. I just don't see what the point in having support for additional js language features natively is if you're forced to use a tranpiler regardless. If you supported only, say, 50% of ES2016, and modules you could plausibly deliver unbundled native ES6; it'd be pretty cool; but modules aren't just a random feature from the pot; there is literally no serious modern web application that doesn't use them. So... I'm struggling to see the ES2016 feature complete map (without modules) as really meaningful for anyone, practically.
- cdnsteve 10y agoAsync Functions Status: Available from Firefox 52 (now Beta, will ship in March 2017).
- andrzejsz 10y agoI wonder does ECMAScript 2017 has optional name ES8?
- mstade 10y agoNot really, but there's certainly an off-by-one joke in there somewhere. Since ES2015 the official nomenclature is ES<year>, to convey that a new version of the standard is cut yearly. While this may result in somewhat underwhelming releases, like ES2016, at least it's much easier to reason about and target than previously. Case in point, it took ten years or so to get from ES3 to ES5, and another five-six years I believe to get to ES2015. These were substantial releases to be sure, but for a long time the uncertainty about when a spec draft was considered done was anything but fun, and I for one applaud the new nomenclature and process for being much, much easier to reason about and target.
- ihsw 10y agoSharedArrayBuffer and async functions are two of the most anticipated and groundbreaking features -- this is definitely good news.
- rocky1138 10y agoDo any of these changes make the language objectively better? All I see are nice-to-haves that aren't really required.
- dandersh 10y agoI think the Array.includes makes the language better as it standardizes how to check for array membership. I've encountered more than one bug as a result of the "!== -1" check not working correctly/as expected.
- mrspeaker 10y agoI've always had a soft-spot for JavaScript, and have written a tonne of it over the years - all these "nice-to-haves" are really nice to have. I find it a lot more fun to write and, more importantly, easier to read six months later (assuming people don't try to be overly tricky with it: I'm looking at you, nested-destructed function parameters!)
- pas 10y agoWell, realistically, if you want an objectively better JS, use TS. It's completely opt-in, transpiles/compiles to JS, and you can finally maintain projects with more than 1 JS file in them, and no longer have to rage-delete the whole scripts.js file when - after adding the 66th god forsaken jQuery lib - something blows up the whole damn thing and all you're left with is a ridiculous error deep from within an unrelated library.
- dwaltrip 10y ago`Object.entries` and `Object.values` are huge wins in my book. Makes common looping operations less obtuse and obfuscated.
- hatsunearu 10y agoI like how they added (what is essentially) left pad. Hah!
- scanr 10y agoI'm unreasonably happy about Async Iterators being on the roadmap. Makes it much easier to write imperative asynchronous streaming code.
- SimeVidas 10y agoAsync iteration is already at Stage 3? Nice.