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

Web Components - Scaling to the Future

Avatar for Tim Waite Tim Waite
December 10, 2019

Web Components - Scaling to the Future

This talk walks through the basics of what web components are, and why you should consider using them to manage your UI in the future.

Avatar for Tim Waite

Tim Waite

December 10, 2019

Other Decks in Programming

Transcript

  1. What are Web Components? Web components are a set of

    web platform APIs that allow you to create new custom, reusable, encapsulated HTML tags to use in web pages and web apps. Custom components and widgets build on the Web Component standards, will work across modern browsers, and can be used with any JavaScript library or framework that works with HTML.
  2. What are Web Components? • Web components provide a simple

    cross browser API for creating reusable behavior and styles. • Web components are written with plain JS and do not need a framework to support them.
  3. Why use Web Components? • “The primary use case for

    Web Components is to create framework-independent UI components. Thanks to the broad browser support, this is already possible today.” • Full support in almost all SPA frameworks • https://custom-elements-everywhere.com/
  4. Why use Web Components? • If the support is bad

    in React, why bother? • Support is still good, there are just some caveats • The React team encourages use of them
  5. Why use Web Components? • Cross platform styles and behavior

    • Separate your style concerns from your business logic • Enable teams to choose their own framework while keeping consistent styles and user interactions • Enable quicker upgrades to future versions of your chosen framework • Scale to the future
  6. Why use Web Components? • They already work today! •

    https://ionicframework.com/ • https://www.webcomponents.org/ • Design system popularity • The constantly changing JS ecosystem
  7. How to Build Web Components • Use a web component

    framework • Polymer.js • Slim.js • Stencil.js
  8. How to Build Web Components • Use a SPA framework

    to compile components to web components • Angular • Svelte • Vue