Re: Why can't we just use constructor instead of createdCallback?

There were several threads around this in March/April, but the main gist is
that we can't allow running user code when the parser is building the tree,
and thus we would need to decouple the timing of the constructor being
called from the [[Construct]] internal method to make constructors
workable. But then they aren't constructors, but callbacks, since the
object would already be exist (and be in a tree). So we decided to not lie
and just call them callbacks, rather than constructors.
I am probably forgetting some...


On Thu, Dec 5, 2013 at 5:31 PM, Ryosuke Niwa <> wrote:

> Could someone point me to a discussion/reasoning behind why we're using
> createdCallback as opposed to the constructor
> as a way of instantiating a custom element?
> It's so awkward to have a separate callback in the world where we have ES6
> classes.
> - R. Niwa

Received on Friday, 6 December 2013 04:43:30 UTC