Polymer 2.0 - what's new

Taking the advantage of waiting for the I/O 2017 Polymer presentations I decided to share with You what I have seen on the Polymer documentation page about the new Polymer release.

Why Polymer? Why now? Polymer seemed to be a forgotten Web Components framework, lost between React and Vue.js. But now after an announcement of YouTube new version usage of Polymer, it plays more and more important role as a Web Framework.

Let's see what changes are to come in its second version:

New version of Polymer is based on the 3 goals: native web platform features, better interoperability and smooth migration.

ES6 users will be happy to hear that Polymer will have ES6 class-based syntax, which will help developers use their favourite standard JavaScript class expression mixins instead of Polymer behaviours.

What's more - we will be able to use Polymer shady DOM code as reusable polyfill, not only with Polymer itself.

Polymer Custom elements will also have their new v1 version compatible with new changes.

There will be also new elements collection - app-media, built using web media API, enabling to capture and process video, photo and audio content and simplifying the media-rich Progressive Web App experiences. The new collection will be capturing such elements as:

<app-media-video></app-media-video>
<app-media-audio></app-media-audio>, 
<app-media-waveform></app-media-waveform>, 
<app-media-devices></app-media-devices>, 
<app-media-stream></app-media-stream>, 
<app-media-recorder></app-media-recorder> and 
<app-media-image-capture></app-media-image-capture>.

There also will be some changes in Polymer syntax of creating an element.

New Polymer will have no type-extension elements, which means no is=, as Apple doesn't support it. Type-extension elements will be replaced with rapping native elements with custom elements just as in the examples below. They show the <my-anchor> element, polymer element template and styling in old and new version of Polymer.

Polymer 1.x.
 Polymer 2.0.
 Polymer 1.x.
  Polymer 2.0.
  Polymer 1.x.
 Polymer 2.0.

These and other changes are well described in Polymer documentation.
These changes are great, let's see what will surprise us even more on today's I/O 2017.

And You - what changes are you expecting from the future Polymers?
Waiting for your opinions in the comments :) Have a great I/O

Komentarze

Popularne posty