We will never have a world where every user has one browser or an evergreen environment. Once we put something out on the web, it is there and the more it gets distributed, the harder it is to remove. Saying all your users need a certain browser is a silly argument. It is not using the web to its strengths.
Google, for example seems to be working on SoundScript and SaneScript.
The work in progress way to trigger SaneScript is to create an opt-in called “use sanity”. But why stop there?
In the past, innovating in the browser wasn’t hard. All we need to do is to test for the support of new objects or methods and we’re safe. Browsers that don’t support what we have will not get it and we treat it as an enhancement.
Using a few tests, we can block out the browsers that don’t understand what we are trying to achieve.
This technique is upgradeable, as this example shows.
You can even nest that and create various versions of support. All without having to worry about backwards compatibility and non-supporting environments will never get bothered with technology they don’t understand.
Template strings for example allow us to use multi-line strings and in-string replacement without concatenation. This makes our markup generation much terser and cleaner and less error prone. Of course, the even better way for this would be templates in HTML, but that’s another presentation.
Arrow functions work around that issue and with their more lexical nature avoids having to keep scope in a that=this hack.
The issue is though, that to date, the support for ES6 isn’t that good. Red in this support grid means not supported. And it would be naïve to expect this to change any time soon and all the browsers on all the platforms to get an upgrade to support ES6.
It makes more sense to have a conversion step. TypeScript was a good start for this.
A type of es6 would allow browsers that don’t understand it to skip and others to execute.
breaking the web.
MunichJS, March 2015
Chris Heilmann (@codepo8) Munich, Bavaria (formerly Germany)
New and more
Locking people out is
not an option.
The success of
based on its
availability on the web
The problem is that
once something is on
the web, it is
impossible to remove
and we can’t force
everyone to stay up to
strict mode is a way to opt in to a restricted variant of
intentionally has different semantics from normal
'use the force';
A version that allows for smooth and exciting 60fps
animations by moving things magically around.
'use paper and material provided';
A version for Polymer
An Apple specific version with libraries to create
glitchy graphical effects and a connection testing
feature that randomly disconnects WiFi
'use to excite VCs';
A specialist version dedicated to IOT and VR
'use this, bro!';
A version that makes omitting semicolons mandatory,
automatically moves opening braces to the next line
and commas to the start of the next line. Limited for
use in the Silicon Valley only (geofenced)