enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Polymer & ES6 in action

<link rel="import" href="/bower_components/polymer/polymer.html">
<dom-module id="my-element">
  <template>
    <p>I'm a DOM element. This is my local DOM!</p>
  </template>
</dom-module>
<script>
  Polymer({
    is: "my-element"
  });
</script>
enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

About me

Lars Gersmann

working at Content Management AG

AngularJS, Node.js, Gulp, ES6, HTML5 / Less.js, Sass / Docker / Bleeding edge browser technologies
enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

What is Polymer ?

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

WTF are web components ?

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

a little bit of Polymer history

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Polymer 1.0

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Polymer 1.0 features

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

What is ES6 ?

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Why ES6 + Polymer ?

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

The dark side

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

the bright side

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Tooling - what we want

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Tooling

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Build Dependencies

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Fluent Build Workflow

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

ES6 to ES5

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Build script

Use ES6 in Gulpfile !

shorter/readable Gulp scripts
 // Gulpfile.js
require("babel/register")({ extensions: ['.es6'] });
require('./tasks.es6');
 // tasks.es6
...
gulp.task('clean', pfy(`rm -rf ${DIST}`));
enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Ex: Hello world

Basic Polymer control in ES6

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Ex : Dynamic Hello

Dynamic Polymer control in ES6

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Ex : Hello events

Events in Polymer

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Ex : Hello ES6 modules

Behaviours in Polymer

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Ex : Hello Promise

ES6 Promise usage in Polymer

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Ex : Testing

Testing Polymer

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Questions ?

enterJS 2015 - Polymer & ES6 in action (hosted by Lars Gersmann)

Fini

Thank you !!

Slides at GitHub : Sources, Demo project

Contact : lars.gersmann@gmail.com
Blog : orangevolt.blogspot.com

Github : github.com/lgersman

Content Management AG : www.cm4all.com