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

Web Components with Vue.js 2018

Web Components with Vue.js 2018

takanorip

July 30, 2018
Tweet

More Decks by takanorip

Other Decks in Technology

Transcript

  1. Self Introduction • Takanori Oki ( @takanorip ) • SmartDrive

    Inc.
 Frontend Developer based in Tokyo • Nuxt.js, React, Polymer, etc… • Polymer Japan Translation team • I have published a book recently !
  2. 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. by webcomponents.org
  3. Feature of Web Components • Based on existing web standards

    • Can make components that is encapsulated styling • Can Use with any JavaScript Frameworks
  4. What are Web Components? • Custom Elements • Shadow DOM

    • HTML Imports (deprecated)
 → Under Discussion 
 (ES Modules / HTML Modules?) • HTML Templates
  5. Browser support Chrome Safari Firefox Edge HTML Templates STABLE STABLE

    STABLE STABLE Custom Elements STABLE STABLE DEVELOPING CONSIDERING Shadow DOM STABLE STABLE DEVELOPING CONSIDERING ES Modules STABLE STABLE STABLE STABLE HTML Imports STABLE POLYFILL POLYFILL POLYFILL
  6. What is lit-html? • JavaScript template literals + HTML templates

    • Extremely fast • Give you the full power of JavaScript and functional programming patterns • Extremely customizable and extensible
  7. lit-extended • lit-html is a library for handling HTML •

    So it can pass values to component as String only • lit-extended is a solution of this demerit
  8. vue-web-component-wrapper • Wrap and register a Vue component as a

    custom element • Use Vue Components in Other JS Frameworks (React, Angular…) as a Web Components • Not affected by external CSS
  9. Building • Use “vue-cli-service build” command • Produce a production-ready

    bundle with minification for JS/CSS/HTML • Also Use “—target wc” option • Create a bundle for building a web component