Anne van Kesteren

DOM: custom elements

Now JavaScript classes and subclassing are finally maturing there is a revived interest in custom elements. The idea behind custom elements is to give developers lifecycle hooks for elements and enable their custom element classes to be instantiated through markup. There is also some overarching goal of being able to explain the platform, though as html-as-custom-elements demonstrates this is extremely hard.

The first iteration of custom elements was based on mutating the prototype of a custom element object, followed by a callback that gives developers the ability to further mutate the object as needed. Google has shipped this in Chrome, but other browsers have been reluctant to follow. I created a Custom Elements wiki page that summarizes where we are at with the second iteration, which will likely be incompatible with what is out there today. There is a couple of outstanding disputes, but the main one is how exactly a custom element object is to be instantiated from markup (referred to as “Upgrading”).

If you are interested in participating, most of the discussion is happening on public-webapps@w3.org. There is also some on IRC.