RE: [webcomponents] Per-type ready event for Custom Elements

From: danieljb2@gmail.com [danieljb2@gmail.com] on behalf of Daniel Buchner [daniel@mozilla.com]

> Surely then we should remove all events defined by the Web Component specs in favor of Promises, right?

I don't think anyone's suggesting that; let's not stuff strawmen here.

What's being pointed out is that there's one particular type of asynchronous transition which web specs have traditionally represented with events, but for which events are a very poor representation: viz., the transition to a "ready" or "loaded" state.

Events should be for things you don't care about missing, and that can occur more than once. Trying to fit one-time state transitions which you want to know about afterward into this model is awkward and causes serious problems for developers, as we've seen. This just leads to libraries like jQuery having to paper over the problems of the platform, with the `$.ready()` promise (or the `$(function () { ... })` pseudo-promise technique in earlier versions).

> - Doesn't force developers to treat this one event as the odd-one-out by requiring different handling

It's not that we're treating this one event as special. It's that this asynchronous state transition isn't even an event at all.

Received on Friday, 27 September 2013 15:34:48 UTC