Backwards compatibility on the web has long been backwards compatibility of source. Sites written in the IE6 era and not touched since should continue to work in browsers of today (which is why things like vendor-prefixed features proved to be a poor idea and are mostly no longer created). You'll get some rendering oddities, but this is still very much true.
Sure, you can use a transpiler and serve JS5 the next ten years (2025). What do you plant to do? It seems most simply haven't thought about the problems lying ahead.
Many were against the ES4/E4X changes that e.g. Firefox supported for some time, as they would have broken backwards compatibility. ES6 breaks backwards compatibility with the new syntax keywords and there is no fallback afaik. If there is a fallback, well then everything would be fine.
Wouldn't it be better if such vendors would ship an security & ES6 syntax support update to their old browser software?
On the other side of things, though, new features that break in old browsers are added all the time. Try and run Date.now or Function.bind in old browsers and they'll immediately throw an error. It's only through polyfilling (and in some cases transpiling) that sites work in even IE8 today, and it will be the same situation in the future if a site wants to still work on an old Android or iOS device.
But yes, staying up to date as a user does depend on a newish browser being available for the platform you're running, and it would be great if old devices could continue to get updates. Really old iOS is out of luck, but Firefox supports back to Android 2.3, so users stuck there can download that browser to continue browsing the web.
Never, probably. Why would you? When most browsers support ES6 you would want to write in ES7, or 8, or TypeScript, or CoffeeScript, or — most likely — in some new exciting language that will transpile to JS.
For me at least, running a build script in order to develop is worse than simply refreshing the page.
No, but you can compile ES6 code using it to ES5 code.
if ES6 {
use "mycode_js6.js";
}
else {
use "mycode_js6_to_js5.js";
}
or something similar.Well, it depends who your target audience is. If users with old browsers don't matter, you don't need to transpile.
Today we can use native JS5 and use polyfill for JS1-3 browser. In future (e.g. 2017) one will have to rely on a transpiler or stay with JS5 for many years - right?
Original:
What do you do in 2017? What if you already code in ES6 and transpile it to JS5 at the moment. Do you simply switch from serving JS5 to JS6?
Older browsers (todays current browser) don't support "class", "let" and other new syntax constructs. The just fail with JS errors. Can one browse the web with IE11 and iOS 8 Safari in 2017? (e.g. "lifetime support" of the device)
Polyfills can be used for pre-JS5 browsers. But can you polyfill "let" and "class" syntax keyword? One can today still browse the web with IE6 and Phoenix 0.l (early Firefox), despite a few glitches and layout bugs. Many sites use polyfills like JQuery and still use JS3 functionality made popular by Crockford "JavaScript the Good Parts". JS5 added a few things that JQuery made popular.
The syntax changes between previous JS versions were smaller in comparison to ES4 and ES6 (ES4/E4X failed and was abandoned).
Edit1: I added "What if you already code in ES6 and transpile it to JS5 at the moment." as the second sentence to make it clearer. As several down voters misunderstood my serious question.