W3C home > Mailing lists > Public > public-media-capture@w3.org > October 2014

Re: Strawman Promises consensus position, based on Thursday's telechat

From: Domenic Denicola <domenic@domenicdenicola.com>
Date: Mon, 6 Oct 2014 16:41:07 +0000
To: "public-media-capture@w3.org" <public-media-capture@w3.org>
Message-ID: <2015e2d2db6b4268beecb063c09b8453@BN1PR05MB325.namprd05.prod.outlook.com>
Hi all,

The TAG is very surprised to see the attitudes on display here.

There is absolutely universal agreement that callback-using APIs are bad, and that no more should be produced. It is imperative that this spec not proceed further down the W3C process track with a callback-based API. More importantly than any process question, no implementer should consider implementing this API (or unprefixing an already-implemented version of it) as long as it still contains callbacks. The TAG will strongly (and formally) oppose both process and implementation moves in this regard.

If there are shipping implementations in two or more browsers that are callback-based, then that can be specified for interoperability as a legacy API. (And prefixed implementations might count for this purpose, given the `navigator.getUserMedia || navigator.webkitGetUserMedia || ...` code mentioned elsewhere in the thread.)

But it is still imperative to provide a promise counterpart before the spec proceeds any further, e.g. by using the return value alongside optional callback arguments. For an example of this, see the Web Audio spec's `decodeAudioData` [1], which has callbacks for legacy-compat, but also returns a promise.

Thank you,

Domenic Denicola
W3C Technical Architecture Group

[1]: https://webaudio.github.io/web-audio-api/#widl-AudioContext-decodeAudioData-Promise-AudioBuffer--ArrayBuffer-audioData-DecodeSuccessCallback-successCallback-DecodeErrorCallback-errorCallback
Received on Monday, 6 October 2014 16:41:38 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:26:30 UTC