Re: document.register and ES6

On Wed, Feb 6, 2013 at 9:56 AM, Erik Arvidsson <arv@chromium.org> wrote:

> On Wed, Feb 6, 2013 at 12:47 PM, Scott Miles <sjmiles@google.com> wrote:
> >>> Instead of passing in functions to document.register we can call
> methods
> >>> on the custom element.
> >
> > My understanding is that the 'passing in functions' was a design
> decision,
> > not a technical one. IOW, Dimitri spec'd it that way so these (private)
> > lifecycle methods aren't just sitting there on the node's public API.
> >
> > This technique certainly on the table to change, but I think it's
> improper
> > to deem it technical debt.
>
> Good point about allowing these to be non public members of the element.
>
> With that in mind maybe we should reconsider to go back to the
> property bag even though it is a lot more verbose.
>

+1. I think property bag is back. We can change as little as:

document.register("foo-bar", { propertyNameTBD: FooBar, ... });
// that is, the only change from current spec is replacing "prototype"
property
// with some other property that holds the class

or as much as:

document.register("foo-bar", FooBar, { /* property bag is a 3rd param */ });

:DG<

Received on Wednesday, 6 February 2013 18:32:47 UTC