Web Components promise to change how we think about modularity on the web, and when combined with the structure and organization of Backbone.js we can create portable, dynamic, encapsulated UI modules that fit into any web application.
3. JavaScript Modularity
By using small libraries –
components with a dedicated
purpose and a small surface
area – it becomes possible to
pick and mix, to swap parts of
our front end stack...
- Jimmy Breck-McKye, "The State of JavaScript in
2015"
15. Web Components
usher in a new era of
web development
based on
encapsulated and
interoperable custom
elements that extend
HTML itself. - Polymer Project
Web Components
60. Web Component All the Things??
<backboneconf‐app>
<backboneconf‐menu></backboneconf‐menu>
<backboneconf‐content></backboneconf‐content>
<backboneconf‐footer></backboneconf‐footer>
</backboneconf‐app>
61. Probably Not (and that's OK)
I don't ever see us going all in
on Custom Elements for every
possible thing ... Use native
elements and controls when
possible and supplement with
custom elements.
- Joshua Peek, Github Programmer
62. Should I Componentize?
Does it encapsulate component-level logic?
Does it take the place of a native element?
Should it be portable?
Is it context independent?
Can the API be represented as attributes, methods, and events?
67. Thanks!
Resources
- WebComponents.org
- Web Components: A Tectonic Shift for Web Development by Eric Bidelman
- Web Components by Jarrod Overson and Jason Strimpel
- Ten Principles for Great General Purpose Web Components
Colophon
This presentation was built with Backbone.js, Shadow DOM, HTML
Templates, HTML Imports, and the Custom Element <slide‐content>
using Web Component Slides.