+ All Categories
Home > Education > Advancing JavaScript without breaking the web - MunichJS

Advancing JavaScript without breaking the web - MunichJS

Date post: 14-Jul-2015
Category:
Upload: christian-heilmann
View: 22,257 times
Download: 0 times
Share this document with a friend
Popular Tags:
38
Advancing JavaScript without breaking the web. MunichJS, March 2015 Chris Heilmann (@codepo8) Munich, Bavaria (formerly Germany)
Transcript
Page 1: Advancing JavaScript without breaking the web - MunichJS

Advancing JavaScript without

breaking the web.

MunichJS, March 2015

Chris Heilmann (@codepo8) Munich, Bavaria (formerly Germany)

Page 2: Advancing JavaScript without breaking the web - MunichJS
Page 3: Advancing JavaScript without breaking the web - MunichJS

Generic solutions are easy to discredit.

Page 4: Advancing JavaScript without breaking the web - MunichJS
Page 5: Advancing JavaScript without breaking the web - MunichJS

New and more

advanced uses

of JavaScript

means we

need to

improve the

language.

Page 6: Advancing JavaScript without breaking the web - MunichJS

Locking people out is

not an option.

The success of

JavaScript was and is

based on its

availability on the web

across browsers.

Page 7: Advancing JavaScript without breaking the web - MunichJS

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

date.

Page 8: Advancing JavaScript without breaking the web - MunichJS

'use strict';

strict mode is a way to opt in to a restricted variant of

JavaScript. Strict mode isn't just a subset: it

intentionally has different semantics from normal

code.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode/Transitioning_to_strict_mode

Page 9: Advancing JavaScript without breaking the web - MunichJS

https://drive.google.com/file/d/0B2p58mpwToefRzlGMzRxTnhNb00/view

Page 10: Advancing JavaScript without breaking the web - MunichJS
Page 11: Advancing JavaScript without breaking the web - MunichJS

'use sanity';

Page 12: Advancing JavaScript without breaking the web - MunichJS

'use the force';

A version that allows for smooth and exciting 60fps

animations by moving things magically around.

Canvas only.

Page 13: Advancing JavaScript without breaking the web - MunichJS

'use paper and material provided';

A version for Polymer

Page 14: Advancing JavaScript without breaking the web - MunichJS

'use emity';

An Apple specific version with libraries to create

glitchy graphical effects and a connection testing

feature that randomly disconnects WiFi

Page 15: Advancing JavaScript without breaking the web - MunichJS

'use to excite VCs';

A specialist version dedicated to IOT and VR

Page 16: Advancing JavaScript without breaking the web - MunichJS

'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)

Page 17: Advancing JavaScript without breaking the web - MunichJS

Seriously, now…

Page 18: Advancing JavaScript without breaking the web - MunichJS

When it comes to

new functionality, we

can always use

progressive

enhancement.

Page 19: Advancing JavaScript without breaking the web - MunichJS

https://justmarkup.com/log/2015/02/26/cut-the-mustard-revisited/

Page 20: Advancing JavaScript without breaking the web - MunichJS
Page 21: Advancing JavaScript without breaking the web - MunichJS
Page 22: Advancing JavaScript without breaking the web - MunichJS

Opt-in with a string or

capability testing

doesn’t work when

syntax is changed.

Page 23: Advancing JavaScript without breaking the web - MunichJS

Which is a shame, as

some of the new

things in ES6 are really

handy!

Page 24: Advancing JavaScript without breaking the web - MunichJS

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/template_strings

Page 25: Advancing JavaScript without breaking the web - MunichJS
Page 26: Advancing JavaScript without breaking the web - MunichJS
Page 27: Advancing JavaScript without breaking the web - MunichJS

http://kangax.github.io/compat-table/es6/

ES6 support in the wild…

Page 28: Advancing JavaScript without breaking the web - MunichJS

Most ES6

improvements help

huge projects, by

allowing for familiar

OO syntax, memory

optimisation and JS

becoming a compile

target.

Page 29: Advancing JavaScript without breaking the web - MunichJS

http://typescriptlang.org/

Page 30: Advancing JavaScript without breaking the web - MunichJS
Page 31: Advancing JavaScript without breaking the web - MunichJS

By changing the

language in a drastic

fashion we are losing

some of the interop of

JavaScript in the

browser.

Page 32: Advancing JavaScript without breaking the web - MunichJS

Transpiling is one way

to work around that –

and we see this with

CSS and HTML, too.

Page 33: Advancing JavaScript without breaking the web - MunichJS

Another solution

would be to go back

to the world of script

types.

Page 34: Advancing JavaScript without breaking the web - MunichJS
Page 35: Advancing JavaScript without breaking the web - MunichJS

Maybe that’s

something worth

considering?

Page 36: Advancing JavaScript without breaking the web - MunichJS

In any case, working

with JavaScript never

gets boring.

Page 37: Advancing JavaScript without breaking the web - MunichJS

So, go and take part

in the discussions

happening now!

Page 38: Advancing JavaScript without breaking the web - MunichJS

Thanks!

Chris Heilmann

@codepo8

http://christianheilmann.com


Recommended