Re: Custom element design with ES6 classes and Element constructors

On Wed, Jan 14, 2015 at 9:39 AM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 1/14/15 11:52 AM, Dimitri Glazkov wrote:
>
>> Would like to point out that we're not talking about a general case
>> here. The actual proto munging in custom elements spec is minimized to a
>> pretty small set.
>>
>
> Pretty small set of which?  Possible mutations, elements, something else.


Had trouble with words here :) Something about minimizing the
impact/effect, and the next paragraph was meant to explain that.


>
>
>  Also, the current design doesn't change the prototype chain arbitrarily:
>>
>
> This is the most important point.  It's possible engines could optimize
> such proto chain insertions better than they do now.  Some feedback from
> engine implementors on how feasible that is would be good to have.
>
>  the effect is limited to inserting a sub-chain into the existing chain.
>>
>
> Is it, though?
>

Yes. I can certainly abuse the machinery to step outside of this rule, but
then I won't be creating useful/well-behaving custom elements.


> I don't see that this is always true, though I would be fine with the
> cases in which it's not true falling off performance cliffs: those would
> only happen when proto chains get munged after element registration.
>
> If we ignore those cases, it's possible JS engines could optimize this
> better than they do now.  JS engine implementor feedback would be pretty
> useful on this matter.



BTW, I agree that we should not hold on to the legacy of wrapper+object
design. That point was probably more about the second point -- the internal
slots of the base types are set at the time of instantiating.

:DG<

Received on Wednesday, 14 January 2015 19:04:45 UTC