SlideShare a Scribd company logo
Vue.js and
Web Components
Mikhail Kuznetcov
2018
Me?
Mikhail Kuznetcov
Fullstack engineer at ING Investments
@legkoletat
github.com/shershen08
Agenda
● Vue.js
● Web components
○ Overview
○ Usage
○ Benefits
Vue.js framework progressive framework for
building user interfaces
Vue.js
“Vue.js has just right amount of Magic”
“Vue.js hits a sweet spot between readability & maintainability
and fun”
“Personally, I use Angular, hate React and getting to love Vue”
Hype vs usage
https://zendev.com/2018/06/19/react-usage-beating-vue-angular.html
Vue.js quick intro
Start project with Vue.js
Install vue- cli
$: vue create MyNewProject
$: cd MyNewProject && npm run serve
Or just try in a browser
<script src="https://unpkg.com/vue/dist/vue.js"></script>
Why Vue.js
● Small footprint
● Great developer experience
○ Syntax
○ Documentation
○ Tooling (typing, cli, plugins, extensions)
● Helps create clear architectures
○ Code splitting and reusing patterns
● Great team, moving fast
○ Typsescript, CLI, ecosystem
https://github.com/vuejs/roadmap
Vue.js modern frameworks
are very close to Web components
Web components
Web Components are a set of
features currently being added by
the W3C to the HTML and DOM
specifications that allow for the
creation of reusable widgets or
components in web documents
and web applications.
In a nutshell
https://meowni.ca/emoji-rain/components/emoji-rain/demo/
Vuejs and Web components - current state
… usefull examples
https://mxb.at/blog/connection-aware-components/
https://codepen.io/mxbck/pen/JZxyoa?editors=0010
● Network Information API
● navigator.connection
● React component wrapper
<x-network-aware-img>
</x-network-aware-img>
https://www.webcomponents.org/element/time-elements
https://www.webcomponents.org/element/yairEO/tagify
Web components
are the new html-tags
Vuejs and Web components - current state
Extending platform,
not the framework
Web components, technical details
Web components spec
Custom Elements
Designing and using new DOM elements
Shadow DOM
Encapsulated style and markup in web components
HTML imports
Inclusion and reuse of HTML documents
in other HTML documents.
HTML Template
Fragments of markup that go unused at page load,
but can be instantiated later on at runtime.
State of components support 03/2018
https://caniuse.com/#search=components
Current state today
Current state (polyfilled)
https://github.com/WebComponents/webcomponentsjs
Additional load
webcomponents-*.js: 11-35 Kb
Web components implementations
● Polymer 2 and 3
● X-Tag, SkateJS, Bosonic, Mozilla Brick, etc.
● AMP (https://www.ampproject.org )
● Ionic (stencil.js, https://stenciljs.com/ )
Similar api
<script type="text/javascript">
export default {
name: 'RangeSlider',
extends: {},
props: {
bar: {},
foo: {},
fooBar: {},
},
data() {},
methods: {},
beforeCreate() {},
mounted() {},
};
</script>
Polymer
X-tags
Vue.js
Interoperability
All major frameworks
https://reactjs.org/docs/web-components.html
Components hide complexity
A facade is an object that provides a simplified interface
to a larger body of code, such as a class library. A facade
can:
● make a software library easier to use,
understand, and test, since the facade has
convenient methods for common tasks
● make the library more readable, for the same
reason
● reduce dependencies of outside code on the
inner workings of a library, since most code
uses the facade, thus allowing more flexibility
in developing the system
● wrap a, subjectively, poorly-designed
collection of APIs with a single well-designed
API
https://en.wikipedia.org/
Benefits for business
● Development speed & testability
● Onboarding
● Single source of truth
● Unify distribution
● Own UI toolkit => consistent UX
across paltforms
● Pluggable kits of components
(Vaadin, Vuetify etc.)
● Performance (due to native
support)
List includes: EA, Atlassian, ING, Bloomberg, Google’s projects etc.
Web components in ING
● Started 2016
● +400 components & apps in Polymer and native WCs
● +20 teams
● Custom pipeline, styleguides, knowledge sharing, and
bestpractices
Web component developer toolbox
Testing
wct - https://github.com/Polymer/.../web-component-tester
Storybook - https://storybook.js.org/examples/
Bundling
Polymer bundler - https://github.com/Polymer/tools/tree/master/packages/bundler
Webpack’s web-components-loader (?)
Libraries
Open - https://www.webcomponents.org/
Proprietary, like https://vaadin.com/components
<hello-world>
https://glitch.com/edit/#!/simple-custom-element?path=views/index.html:1:0
Use sebsequent blocks: <template>, <style>, Class
Web components
make life easier different
Attention points
Creators
● Testing
● Write good code
Consumers:
● Bundle size
● Stying
● Ecosystems combining
● Security
Recap
● Modern frameworks (e.g. Vue) already provide developer experience
close to expected when having fully supported Web components; They
are already interopreable;
● Using WCs enables encasulated unified experience;
● Adopting WCs solves lots of problems but also uncovers new challenges.
Questions
@legkoletat
Presentation will be available here soon

More Related Content

PPTX
.NET Fest 2018. Martin Ullrich. MSBuild: Understand and Customize Your .NET B...
PDF
Course Document
PPTX
Basics of Vue.js 2019
PPT
Node.js
PPTX
Decoupled drupal + vue.js
PDF
Pre rendering media sites with nuxt.js & netlify
PDF
Drupalcon 2021 - Nuxt.js for drupal developers
PDF
Expectations vs Reality When Implementing vue.js
.NET Fest 2018. Martin Ullrich. MSBuild: Understand and Customize Your .NET B...
Course Document
Basics of Vue.js 2019
Node.js
Decoupled drupal + vue.js
Pre rendering media sites with nuxt.js & netlify
Drupalcon 2021 - Nuxt.js for drupal developers
Expectations vs Reality When Implementing vue.js

What's hot (20)

PDF
Treinamento frontend
PPTX
Halton Software Peer 2 Peer Meetup #10
PPTX
Introduction to Vue.js DevStaff Meetup 13.02
PDF
OpenCms Days 2012 - OpenCms 8.5: Creating "in place" editable pages with the ...
PDF
Intro to vue.js
PPTX
An introduction to Node.js application development
PDF
Découvrez Nuxeo Studio
PDF
Docker Up and Running for Web Developers
PPTX
Managing Node.js Instances with Oracle APEX
PPTX
SnapyX - ParisJS
PPTX
Introduction to Node.js
PPT
Get MEAN! Node.js and the MEAN stack
PPT
Vanjs backbone-powerpoint
PPTX
Scalable WordPress use case - MiCADO webinar No.3/4 - 09/2019
PPTX
Introduction to Node.js
PDF
Node.js by Alex and Nalin
PPTX
Node.js and express
PDF
Lesson 09
PPSX
Node on Windows Azure
Treinamento frontend
Halton Software Peer 2 Peer Meetup #10
Introduction to Vue.js DevStaff Meetup 13.02
OpenCms Days 2012 - OpenCms 8.5: Creating "in place" editable pages with the ...
Intro to vue.js
An introduction to Node.js application development
Découvrez Nuxeo Studio
Docker Up and Running for Web Developers
Managing Node.js Instances with Oracle APEX
SnapyX - ParisJS
Introduction to Node.js
Get MEAN! Node.js and the MEAN stack
Vanjs backbone-powerpoint
Scalable WordPress use case - MiCADO webinar No.3/4 - 09/2019
Introduction to Node.js
Node.js by Alex and Nalin
Node.js and express
Lesson 09
Node on Windows Azure
Ad

Similar to Vuejs and Web components - current state (20)

PDF
Web components api + Vuejs
PPTX
Web Components: The Future of Web Development is Here
PPTX
Web component
PDF
Vue.js - An Introduction
PDF
Thinking in Components
PPTX
Web components and Package managers
PPTX
Web Components: The Future of Web Development is Here
PDF
Webcomponents are your frameworks best friend
PDF
Fullstack Web Components Complete Guide to Building UI Libraries with Web Com...
PPTX
Vue Or React - Which One is the Best_.pptx
PPTX
Introduction to web application development with Vue (for absolute beginners)...
PDF
Getting Started with React, When You’re an Angular Developer
PDF
Front End Development for Back End Java Developers - Jfokus 2020
PDF
React - The JavaScript Library for User Interfaces
PDF
Vue js and Vue Material
PDF
KharkivJS: Flaws of the Web Components in 2019 and how to address them
PDF
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
PDF
Lit there be light
PDF
Why Vue JS
Web components api + Vuejs
Web Components: The Future of Web Development is Here
Web component
Vue.js - An Introduction
Thinking in Components
Web components and Package managers
Web Components: The Future of Web Development is Here
Webcomponents are your frameworks best friend
Fullstack Web Components Complete Guide to Building UI Libraries with Web Com...
Vue Or React - Which One is the Best_.pptx
Introduction to web application development with Vue (for absolute beginners)...
Getting Started with React, When You’re an Angular Developer
Front End Development for Back End Java Developers - Jfokus 2020
React - The JavaScript Library for User Interfaces
Vue js and Vue Material
KharkivJS: Flaws of the Web Components in 2019 and how to address them
"Crafting a Third-Party Banking Library with Web Components and React", Germa...
Lit there be light
Why Vue JS
Ad

More from Mikhail Kuznetcov (8)

PDF
Svelte JS introduction
PDF
Front end microservices - October 2019
PDF
Front end microservices: architectures and solution
PDF
Building decentralised apps with js - Devoxx Morocco 2018
PDF
Frontend microservices: architectures and solutions
PDF
Working with Smart contracts in Javascript
PDF
Vuejs for Angular developers
PPT
Augmented reality : Technology
Svelte JS introduction
Front end microservices - October 2019
Front end microservices: architectures and solution
Building decentralised apps with js - Devoxx Morocco 2018
Frontend microservices: architectures and solutions
Working with Smart contracts in Javascript
Vuejs for Angular developers
Augmented reality : Technology

Recently uploaded (20)

PDF
R24 SURVEYING LAB MANUAL for civil enggi
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
Artificial Intelligence
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Fundamentals of safety and accident prevention -final (1).pptx
PDF
composite construction of structures.pdf
PDF
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
PDF
Well-logging-methods_new................
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
DOCX
573137875-Attendance-Management-System-original
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
R24 SURVEYING LAB MANUAL for civil enggi
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Artificial Intelligence
Automation-in-Manufacturing-Chapter-Introduction.pdf
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
CH1 Production IntroductoryConcepts.pptx
Fundamentals of safety and accident prevention -final (1).pptx
composite construction of structures.pdf
Human-AI Collaboration: Balancing Agentic AI and Autonomy in Hybrid Systems
Well-logging-methods_new................
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
UNIT-1 - COAL BASED THERMAL POWER PLANTS
573137875-Attendance-Management-System-original
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx

Vuejs and Web components - current state

Editor's Notes

  • #3: A quick word about myself - I am Mikhail, I Who’s watching footbal last weeks ? Oh yes, Inknow Netherland is not there… I workd as … I also do stuff with vue and other modern APIs
  • #4: What is WC What WC features are now in Vue What’s missing and how may be covered ------ Just to estimate how much we should spend time on some parts - Whos is using Vur for main projects? Who’s on React? Angular? OK, fine, so we can skip the part with how to make it work
  • #6: Was started in 2014 by Evan, former googler who inherited a lot of good ideas from Ajs and React that were growing very popular those days. Essentially - V is defined as a progressive framework for building user interfaces. Vue is designed from the ground up to be incrementally adoptable. So you can rewrite a piece of your app to give it a try. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects - Network layer SSR State management UI pugins (wrapers for 3rd party) I first came accross V around 2 yeares ago, at that moment it was still moving on version 1.x Later last winter I was doing a presentation ab how to give V a try if you are Angular developer and at that moment not many ppl were aware about it. But then things started moving really fast. And we like new libraries, right? ======= On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with modern tooling and supporting libraries.
  • #7: In Conclusion: React Still Dominates, Vue Growing Fastest That said, Vue fans have no reason to be sad. Over the last 2 years, Vue has grown at a faster percentage rate than any of the other dominant JavaScript frameworks, recently catching up to Angular.js and gradually narrowing the gap between it and both Angular and React.
  • #8: prebuilt data binding and MVC model Effortlessly ship native ES2015 code for modern browsers, or build your vue components as native web components. Vue CLI is fully configurable without the need for ejecting Out-of-the-box support for Babel, TypeScript, ESLint, PostCSS, PWA, Unit Testing & End-to-end Testing
  • #9: Later you can add all kinds of extensions to it - Install Dev tools extension
  • #10: Just to sum up, why vuejs: I have some
  • #11: Normal People usually can’t follow more than 5-7 objects at once, When you trying to keep an eye on more - you start making mistakes, start forgetting things etc. Normally when you're trying to follow more than 5 things you start making mistakes you start being …. So where are developers were people and we also lazy! so we tried to know keep things simple right that's how a lot of beautiful tools in CS being built. REact - ONLY VIEW LAYER, CURL, TOP, etc. Same principle applies here - separate and rule. We developers are lazy. Archirecture so what supposed to help us to keep things clear keep things simple is the Architecture Oh, I love those all those patterns concerns, scheme as you know can go for so if you talk about the components of web components they are implementing the FACADE PATTERN.
  • #12: Having this overvie of the Vue, framework Previously in that presentation I was diving into comparing part Vue v WC I think wen are moving History Was referenced before, but since around beginning of 2011 and also currently, the term “Web Components” has been used to refer to the new W3C standards. Web Components are developer defined HTML Elements which work in the browser with other HTML elements like <p>, <main> or <body>. By designing our own new elements we can bring new powers to HTML to accomplish tasks previously only managed with JavaScript.
  • #13: I’d like to show this example emoji rain component - by Monica Dinculescu from Google Polymer team
  • #15: Just couple days ago I came accross component writtent by Max Böck - Over the last decade, we have learned to embrace the uncertainty of developing for the web. In this particular example offline: a placeholder with alt text 2g / reduced data mode: a low-resolution image, ~30kb 3g: a high resolution retina image, ~200kb 4g: a HD video ~1.8MB By combining the Network Information API with React, we could write a component that renders different elements for different speeds Cool right? I have couple more daily used examples for you of course -
  • #16: Tag display component, typical when adding new post and such...
  • #17: Or, another, display textual format of time..
  • #18: You basically got the idea - Same as you were adding plugins to you frameworkd or CMS of choise - But now - you are extending natively supportted (with an asterisk here, we’ll talk about it later)
  • #20: You can customise the bworser APIs that ou were previously building stuff on top of.
  • #21: So, that was the selling part, now let’s try to look into more technical presepective
  • #22: It has taken a long time to get here but things are moving in the correct direction with Safari shipping Shadow DOM and now landing support for Custom Elements. --------------- Web Components can be used in multiple applications and provide interoperability between frameworks making them reusable and modular. In fact, the entire component’s markup can be placed inside a template which follows the separation of concerns principle, thus minimizing tight coupling and increasing maintainability of code. Web Components also prevent inheritance and naming conflicts by separating the component from the rest of the DOM (Document Object Model), also known as encapsulation. This is enabled through the Shadow DOM which provides a private scope rathe --------------- These specifications are the building blocks of what makes up Web Components. It is clear that developers are constantly looking to add structure and efficiency when designing web applications, which is where modular-based design comes in. Modularity is an important design principle, well known in the back-end programming world for some time. The ISO/IEC/IEEE define modularity as “The degree to which a system or computer program is composed of discrete components such that a change to one component has minimal impact on other components”. The general goal of modularity is that the modules are extensible, reusable and maintainable [6]. These principles bring many advantages not only to back-end programming but to the front-end as well.
  • #24: And now real TODAY’s summer 2018 As you can see guys are working hard on it, see several impressive improvements: YEY - Samsung Internet is 100% compartible , YOU CAN REMOVE YOUR CHROME NOW To me this starts looking as a totally Goggle’s project.
  • #26: See: stencil.js, Heavily inspired by VueJS. (Same VDOM engine, template syntax) Web Components ARE tools for flexible, full-featured front-end There is no formal distinction between a simple component and an “application” Ive added this, because in all V/A/R - you either have official support libs or it’s coming soon as a part of the process
  • #30: Advantages of Web Components for Controlling Complex APIs establish a common UI language Basically you want something to rewrite all you outdated stuf again Being able to work with the DOM API directly and browsers’ built-in development tools comes with distinct advantages, and helps replace the cognitive load of framework specifics with standardized techniques and tooling (HTML element attributes/properties, encapsulated styling via CSS, etc.)
  • #32: Web pages that use multiple HTML Imports, external scripts, and stylesheets to load dependencies may end up making lots of network round-trips. - ----- polymer-bundler is a library for packaging project assets for production to minimize network round-trips. Relationship to Polymer CLI The Polymer CLI uses polymer-build, which uses polymer-bundler, so you can think of the CLI's build pre-configured polymer-build pipeline including polymer-bundler. Setting this up for you makes the CLI easy to use, but as a command-line wrapper its customization options are more limited. polymer-bundler allows you to completely customize your bundle strategy.
  • #33: Again see how similar to Vue components
  • #34: Normal People usually can’t follow more than 5-7 objects at once, When you trying to keep an eye on more - you start making mistakes, start forgetting things etc. Normally when you're trying to follow more than 5 things you start making mistakes you start being …. So where are developers were people and we also lazy! so we tried to know keep things simple right that's how a lot of beautiful tools in CS being built. REact - ONLY VIEW LAYER, CURL, TOP, etc. Same principle applies here - separate and rule. We developers are lazy. Archirecture so what supposed to help us to keep things clear keep things simple is the Architecture Oh, I love those all those patterns concerns, scheme as you know can go for so if you talk about the components of web components they are implementing the FACADE PATTERN.
  • #35: how to access Shadow DOM BUndle size - because some things gate writtent multiple times and you can’t avoid it Security - ever checked all 300Mb your node modules folder ? what about bower components ? Hard to write good code - web/UI not much diff from any other CS dev: its about making api as sharp and simple as you can , hide as much as possible , do not to unexpected defaults and expectations <polymer-*>, <amp-*> - From the outside it looks like there is a massive platform play to get people locked into the framework’s element set and the name-spacing like we are seeing puts developers in the position of buying into the stack and even if it is unintentional they are creating a walled garden that could lock the developers into one platform. One of my concerns is that there is a lot of rich functionality getting created that we can drop in and use on our page, but a lot of it is getting duplicate developers in control and not go down into a world where you are locked into a platform just because you want a nice element in your page
  • #36: Vue.js is almost Web Components ---------------------------- Vue made a great bid on going the same direction --- Vue dev experience and end results is close to that expected when having fully supported WC Coming improvements (Vue, browsers, WC stack) make Vue ecosystem a safe bid for a project that may later migrate/heavily use WC Era of framework divergence coming to an end