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

Re: Custom element design with ES6 classes and Element constructors

From: Elliott Sprehn <esprehn@google.com>
Date: Tue, 27 Jan 2015 20:56:03 -0800
Message-ID: <CAO9Q3iLqq4+csXzDHd-GTecBgSbcVChtLp1-Ox7KV_BBNT6Ckg@mail.gmail.com>
To: Domenic Denicola <d@domenic.me>
Cc: Yehuda Katz <wycats@gmail.com>, Dimitri Glazkov <dglazkov@google.com>, Erik Arvidsson <arv@google.com>, Dmitry Lomov <dslomov@chromium.org>, WebApps WG <public-webapps@w3.org>
On Thursday, January 15, 2015, Domenic Denicola <d@domenic.me> wrote:

> Just to clarify, this argument for symbols is not dependent on modules.
> Restated, the comparison is between:
>
> ```js
> class MyButton extends HTMLElement {
>   createdCallback() {}
> }
> ```
>
> vs.
>
> ```js
> class MyButton extends HTMLElement {
>   [Element.create]() {}
> }
> ```


This doesn't save you anything, classes can have statics and the statics
inherit, so the .create will cause issues with name conflicts anyway.

We should probably introduce a new namespace if we want to do this.


>
> > We're already doing some crude namespacing with *Callback. I'd expect
> that as soon as the first iteration of Custom Elements is out, people will
> copy the *Callback style in user code.
>
> This is a powerful point that I definitely agree with. I would not be
> terribly surprised to find some library on the web already that asks you to
> create custom elements but encourages you supply a few more
> library-specific hooks with -Callback suffixes.
>
>
Received on Wednesday, 28 January 2015 04:56:30 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:27:25 UTC