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

Building Solutions with Polymer JS

Building Solutions with Polymer JS

What are web components? How can I use them? How can Polymer help?

Andrew Stacy

May 02, 2018
Tweet

Transcript

  1. A LITTLE ABOUT ME I’M ANDREW STACY ▸ I’m a

    husband to my beautiful wife, Katie. ▸ I’ve been exploring web development since 2004. ▸ I’m really into craft breweries and coffee shops. ▸ Thai 9 is my favorite restaurant. ▸ I made a custom design for my mechanical keyboard. ▸ I extremely dislike The Last Jedi.
  2. Most frameworks solve the problems of a traditional web application.

    Most JS frameworks tend to be engineered with a focus on CRUD style apps (including Polymer).
  3. Some of the major players of these styles of frameworks

    are Angular, Ember, React, and Vue. They handle the needs of CRUD in different ways but with the same end result.
  4. Whatever your use case is, it’s the people involved that

    ultimately “decide” how good the end product truly is, whether they are developers, designers, or management. Each use-case is unique and comes with its own challenges.
  5. Frameworks are for “greasing the wheels” and giving your development

    team a standard springboard that they can all use and be on the same page with.
  6. “POLYMER IS A JAVASCRIPT LIBRARY THAT HELPS YOU CREATE CUSTOM

    REUSABLE HTML ELEMENTS, AND USE THEM TO BUILD PERFORMANT, MAINTAINABLE APPS.” Google BUILDING SOLUTIONS WITH POLYMERJS
  7. SHADOW DOM REMOVES THE BRITTLENESS OF BUILDING WEB APPS. THE

    BRITTLENESS COMES FROM THE GLOBAL NATURE OF HTML, CSS, AND JS. Eric Bidelman, Google BUILDING SOLUTIONS WITH POLYMER JS
  8. The Shadow Host is the Element that you see in

    your normal document flow like an <hr> or a <video>.
  9. The Shadow Tree is a DOM in and of itself.

    It’s like a document in an <iframe> without any of the nastiness.
  10. The Shadow Root is the like the “document” root of

    the component. Every child inherits from it.
  11. The Custom Element spec provides developers with a way of

    defining new elements that the browser can recognize.
  12. The HTML Template spec gives us a way of declaring

    fragments of markup that are “inactive” at page load but can be “activated” and used at a later time.
  13. The HTML Import spec was controversial among the W3C. Google

    championed it and prematurely implemented it with Polymer through the use of polyfills. Polymer 3.0 makes use of native JS dynamic imports.
  14. By using the Polymer framework we get all of the

    great, native aspects of web components in a simplified format. But that’s not all!
  15. BUILDING SOLUTIONS WITH POLYMERJS ▸ Simplified creation of web components.

    ▸ One-Way and Two-Way data binding. ▸ Mediator Pattern for data flow. ▸ Data observers. ▸ Template helpers like <dom-repeat> and <dom-if>. ▸ A huge library of pre-made components. ▸ And more… Benefits
  16. We can use the mediator pattern to construct an application.

    At the top we have what we call the “master component” at Stratacache and what the Google Polymer team calls the “shell.”