Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building a better web with Web Components and Polymer 2.0

Building a better web with Web Components and Polymer 2.0

Event:
- Google I/O Extended 2017 Kuala Lumpur (July 22, 2017)
- Barcamp Cyberjaya 2017 (Aug 5, 2017)

Topic: Polymer, Web Components

Henry Lim

August 05, 2017
Tweet

More Decks by Henry Lim

Other Decks in Technology

Transcript

  1. Building a Better Web with Web Components and Polymer 2.0

    Henry Lim @henrylim96 Google Developer Group Kuala Lumpur
  2. class MyElement extends HTMLElement { constructor(){ super(); this.attachShadow({mode:'open'}).innerHTML = 'Web

    Components are native! ' } } customElements.define('my-element', MyElement);
  3. Native Browser Support ES6 Classes ✔ ✔ ✔ ✔ Custom

    Elements ✔ ✔ Shadow DOM ✔ ✔ CSS Custom Properties ✔ ✔ ✔ ✔
  4. Native Browser Support ES6 Classes ✔ ✔ ✔ ✔ Custom

    Elements ✔ ✔ Shadow DOM ✔ ✔ CSS Custom Properties ✔ ✔ ✔ ✔
  5. Native Browser Support ES6 Classes ✔ ✔ ✔ ✔ Transpile

    Custom Elements ✔ ✔ Polyfill Polyfill Polyfill Shadow DOM ✔ ✔ Polyfill Polyfill Polyfill CSS Custom Properties ✔ ✔ ✔ ✔ Polyfill
  6. Native Browser Support ES6 Classes ✔ ✔ ✔ ✔ Transpile

    Custom Elements ✔ ✔ Polyfill Polyfill Polyfill Shadow DOM ✔ ✔ Polyfill Polyfill Polyfill CSS Custom Properties ✔ ✔ ✔ ✔ Polyfill Polymer 2.0 + Polyfill Size 11k 14k 33k 33k 37k
  7. Polymer 2.0 + Polyfill Size 11k 14k 33k 33k 37k

    Polymer 1.9 + Polyfill Size 40k 53k 53k 53k 53k
  8. Push critical resources for the initial URL route. Render initial

    route. Pre-cache remaining routes. Lazy-load and create remaining routes on demand.