W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2015

Minimum viable custom elements

From: Anne van Kesteren <annevk@annevk.nl>
Date: Wed, 14 Jan 2015 15:45:09 +0100
Message-ID: <CADnb78hTgqF3W32GFXZ32ZRSaXJm4x75JEvk=hj0qwcGmRDKZQ@mail.gmail.com>
To: WebApps WG <public-webapps@w3.org>
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
* 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.

Received on Wednesday, 14 January 2015 14:45:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:14:43 UTC