Cancelable JavaScript promises cancelled

Published December 26, 2016 by lagmen
The proposed feature would have given developers more control over requests in programs, but Google pushed back

In a twist of irony, a cancelable promises capability has been cancelled as a planned addition to JavaScript itself.

The proposal had been championed by Google’s Dominic Denicola but had remained in an early stage of development, according to Mozilla. Denicola declined to comment on the proposal’s withdrawal except to say it was a “difficult subject.” In recent comments in GitHub repo, he said the proposal had met “significant opposition from within Google.”

The feature would have given developers the ability to abort a promise, a Mozilla representative said. “A prominent use case is to be able to cancel possibly longstanding requests, such as fetch requests.” Cancelable promises had been proposed to the ECMA TC-39 committee overseeing the standardization of JavaScript.

While Mozilla declined to speculate on why the proposal was retracted, the company hopes another effort is made in this vein. “What has been retracted is a particular proposed solution,” Mozilla said. “We believe the idea of making promises cancelable, in particular making HTML fetch cancelable, is still very much desired. We anticipate there will be other proposals.”

Promises in JavaScript provide for asynchronous connection-handling, for scheduling of how code works with JavaScript APIs and functions. Comments on a Hacker News chat thread referred to cancelable promises as having no obvious way to accomplish it and questioned whether it would foment complexity and compatibility issues. For the time being, cancelable promises has met the same fate as object.observe, a JavaScript feature for observation of objects that also was axed.

Source: Infoworld.com

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: