I've been trying to think of the smallest setup that adds value, can
get broad agreement, and is therefore hopefully interoperable fast.

* ES6-style class syntax to declare the imperative constructor.
* No subclassing of normal elements for now.
* registerElement() to enable declarative syntax and createElement().
* Parsing of declarative syntax invokes the registered constructor
synchronously.
* Existing lifecycle callbacks plus those agreed (copying, adopting).

Notably this does not address upgrading. I think we can defer
upgrading as it can be implemented in script fairly easily. You await
for the imperative constructors to load and DOMContentLoaded at which
point you traverse the tree and invoke replace() on those elements you
want to upgrade. Ideally at some point we find a declarative solution
for this, perhaps something like "HTML modules", but shipping a v1 of
custom elements in multiple browsers should not have to wait for that.

It also does not address subclassing normal elements. Again, while
that seems desirable the current ideas are not attractive long term
solutions. Punting on it in order to ship a v1 available everywhere
seems preferable.


-- 
https://annevankesteren.nl/

Reply via email to