Wait don't we still have a problem

Our Savior Web Components!

Web Componets

A set of (4) new standards for creating custom HTML elements. Lays the ground work for reusable UI Components.

The Web Component Specs

Templates

HTML Imports

Shadow DOM

Custom Elements

I'm going to focus on custom elements.

Templates are a little boring

Firefox isn't supporting HTML Imports

Shadow DOM is difficult to polyfill

Custom Elements are awesome just on their own

class MyElement extends HTMLElement {
createdCallback(){
// what do yo do when your element is created?
}
};
// name must have a hypen, now you can create <my-element> anywhere
document.registerElement('my-element', MyElement);