This document discusses front-end development and web components. It begins by outlining some of the challenges of front-end development, including constant changes in technology and the need for components to work across devices and browsers. It then introduces the concepts of encapsulated, reusable, and interoperable components. Web components are presented as a solution for building such components using vanilla JavaScript. Frameworks like Polymer and lit-html are discussed as ways to more easily implement web components. The document argues that web components improve interoperability and help software last longer despite changing technologies. It demonstrates the interoperability of a sample web component across frameworks like React, Angular, and Vue.
4. “The challenge associated with
front-end development is that
the tools and techniques used to
create the front-end of a website
change constantly and so the
developer needs to constantly be
aware of how the field is
developing.
4
5. FRONT-END CHALLENGE LIST
▸ Constant change technology
▸ Multiple tools / techniques
▸ Constant update of the developers
▸ Different resolutions
▸ Different browsers
▸ Different devices
▸ Performance
▸ ...
5
16. WEB
COMPONENTS
16
“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.”
17. QUESTION
17
Can I write whole apps with vanilla Web
Components?
Yes! You can, but maybe it’s a bit tedious
20. QUESTION
20
Can I write whole apps with vanilla Web
Components?
Yes! You can, but maybe it’s a bit
tedious. So, Polymer library brings Web
Components into the mainstream
22. POLYMER
22
“The Polymer library provides a set of features for
creating custom elements. These features are
designed to make it easier and faster to make custom
elements that work like standard DOM elements”
26. “Polymer's success is to die some
day, because this means that it
helped us in the past to use in a
simple way technology that was
not yet ready.
26
28. LIT-HTML
28
“lit-html: An efficient, expressive, extensible HTML
templating library for JavaScript.
lit-html is not a framework, nor does it include a
component model. It focuses on one thing and one
thing only: efficiently creating and updating DOM”
30. LITELEMENT
30
“A simple base class for creating custom elements
rendered with lit-html
LitElement uses lit-html to render into the element's
Shadow DOM and adds API to help manage element
properties and attributes. LitElement reacts to
changes in properties and renders declaratively using
lit-html.”
32. LITELEMENT BASE CLASS & API
▸ Setup properties with observable properties
support
▸ React to changes and ensuring changes in
rendering
▸ Declarative rendering using lit-html
▸ API
▹ render()
▹ shouldUpdate(changedProperties)
▹ update(changedProperties)
▹ firstUpdated(changedProperties)
▹ updateComplete
▹ ... 32
38. FRAMEWORK / LIBRARY
APPROXIMATIONS SIZE
(GZipped versions)
38
v 3.0.0 v 6.0.3 v 16.5.2 v 2.5.17 v 3.0.5 V 0.6.0
113.6 K 38.2 K 31.8 K 30.3 K
11.3 K -
17.7K
5.4 K
46. INTEROPERABILITY CONCEPT
46
Is a characteristic of a product or system, whose
interfaces are completely understood, to work
with other products or systems, at present or in
the future, in either implementation or access,
without any restrictions
47. INTEROP REQUIREMENTS
47
- The framework/lib must be prepared to
say a component that the state must
have
- The framework/lib must be prepared to
listen to the changes that occur in my
component