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

Re: [webcomponents]: What callbacks do custom elements need?

From: Daniel Buchner <daniel@mozilla.com>
Date: Mon, 11 Mar 2013 11:55:47 -0700
Message-ID: <CAHZ6zJHLGroYJOKVvQc1MVBNj4J5rKL-iD8ZSpGoOgaYwLG1nw@mail.gmail.com>
To: Jonas Sicking <jonas@sicking.cc>
Cc: Dimitri Glazkov <dglazkov@google.com>, William Chen <wchen@mozilla.com>, Hajime Morrita <morrita@google.com>, Elliott Sprehn <esprehn@google.com>, Blake Kaplan <mrbkap@mozilla.com>, public-webapps <public-webapps@w3.org>, Steve Orvell <sorvell@google.com>, Scott Miles <sjmiles@google.com>
Ready/created, inserted, removed, and attributeChanged are the minimum
must-havs for developers - we heavily rely on each one of these callbacks
in the components we've developed thus far. The usefulness of this API is
neutered without these hooks - they're table stakes, plain and simple.
Jonas, how are non-bubbling callbacks so crushing? Are we honestly
designing for the dev who decides to ignore all the best practices,
tutorials, evangelist demos, etc and run a crushing loop every time an
attribute value changes despite the obvious idiocy of their actions? This
is not an API that will be widely used by every Bobby Tables and Samantha
Script Kitty on the block - let's not design API features and 99%-case
ergonomics for a phantom developer persona that is a fringe-at-best factor.

On Fri, Mar 8, 2013 at 10:49 AM, Jonas Sicking <jonas@sicking.cc> wrote:

> On Mar 6, 2013 2:07 PM, "Dimitri Glazkov" <dglazkov@google.com> wrote:
> >
> > Here are all the callbacks that we could think of:
> >
> > * readyCallback (artist formerly known as "create") -- called when the
> > element is instantiated with generated constructor, createElement/NS
> > or shortly after it was instantiated and placed in a tree during
> > parser tree construction
> >
> > * attributeChangedCallback -- synchronously called when an attribute
> > of an element is added, removed, or modified
> This will have many of the same problems that mutation events had. I
> believe we want to really stay away from synchronous.
> So yes, this looks dangerous and crazy :-)
> / Jonas
Received on Monday, 11 March 2013 18:56:45 UTC

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