取消可能約束

AbortController (JavaScript)

文脈

[20]

実装

[26] 末時点で FirefoxEdge が実装済みです。

歴史

取消可能約束

[9] PromiseTC39 により ECMAScript に取り込まれた後、 中止機能を追加することが検討されました (cancellable promise)。

[10] 約束履行拒絶の2状態のいずれかに至りますが、 第3の取消の状態を導入して catch に相当する新構文を追加するといった案もありました。

[11] しかし GoogleJavaScript 関係者の強行な反対により、提案は取り下げられました。 (提案の中心人物の Domenic DenicolaGoogle 社員ですが、 社内の問題で継続できなくなったということだけ説明していて >>8、 詳細な事情は不明です。技術的な問題ではなく、政治的な圧力の気配があります。)

[16] Issues · promises-aplus/cancellation-spec () https://github.com/promises-aplus/cancellation-spec/issues

[52] Terminating a fetch — Anne’s Blog ( 版) https://annevankesteren.nl/2015/02/cancelable-promises

[7] tc39/proposal-cancelable-promises: Former home of the now-withdrawn cancelable promises proposal for JavaScript () https://github.com/tc39/proposal-cancelable-promises

[8] Why was this proposal withdrawn? · Issue #70 · tc39/proposal-cancelable-promises () https://github.com/tc39/proposal-cancelable-promises/issues/70

DOM AbortController

[15] cancellable promise の開発が中止された後、 cancellable promise を使う予定だった fetch の中断機能の新設計が WHATWG で検討されました。

[13] fetch に限らず WebAPI の共通の中断機能を導入することとなり、 DOM StandardAbortController が追加されました。

[6] Aborting a fetch: The Next Generation · Issue #447 · whatwg/fetch () https://github.com/whatwg/fetch/issues/447

[12] Fetch termination API "meeting" · Issue #455 · whatwg/fetch () https://github.com/whatwg/fetch/issues/455

[4] Define a 'CancelationController' and 'CancelationSignal' interface. by mikewest · Pull Request #434 · whatwg/dom () https://github.com/whatwg/dom/pull/434

[2] Abort controller by jakearchibald · Pull Request #437 · whatwg/dom () https://github.com/whatwg/dom/pull/437

[3] Abort controller design · Issue #438 · whatwg/dom () https://github.com/whatwg/dom/issues/438

[14] WIP: Cancelation by jakearchibald · Pull Request #523 · whatwg/fetch () https://github.com/whatwg/fetch/pull/523

[5] Should the WebAuth API have a cancel() method? · Issue #380 · w3c/webauthn () https://github.com/w3c/webauthn/issues/380

[1] Define AbortController and AbortSignal classes (jakearchibald著, ) https://github.com/whatwg/dom/commit/1c58d2cf4279ade63f1c5c7d200156cfdda89b7c

[17] AbortController polyfill for cancelling fetch() () https://mo.github.io/2017/07/24/abort-fetch-abortcontroller-polyfill.html

[27] それでもやはり JavaScript で中断機能を標準化するべきと考える人々が WHATWG の作業の完了を見て慌てて TC39 で作業を始めたようですが、完成には程遠い状態です。 (WHATWG での開発も素早くといいつつ数ヶ月かかっているので、 同じことを別個にやろうとすれば当然時間はかかるでしょう。)

[18] tc39/proposal-cancellation: Proposal for a Cancellation API for ECMAScript () https://github.com/tc39/proposal-cancellation

[19] Abortable fetch (jakearchibald著, ) https://github.com/whatwg/fetch/commit/0bcd5dfc71ef44319873887f4b83119bd6d0b71d

[21] 750599 - Implement AbortController, AbortSignal, abortable fetch - chromium - Monorail () https://bugs.chromium.org/p/chromium/issues/detail?id=750599

[22] 174980 – [Fetch API] Implement abortable fetch () https://bugs.webkit.org/show_bug.cgi?id=174980

[23] 1378342 - Aborting fetch (and possibly streams), part 2 () https://bugzilla.mozilla.org/show_bug.cgi?id=1378342

[24] Fetch Javascript API should be abortable - Microsoft Edge Development () https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13009916/

[25] AbortController - Web APIs | MDN () https://developer.mozilla.org/en-US/docs/Web/API/AbortController

[28] Firefox でも Edge でも、 標準状態で有効になっています。

[29] Add a specification hook for AbortSignals to follow each other (jakearchibald著, ) https://github.com/whatwg/dom/commit/7728021dd26dff7586816955757cde78280fcaf4

[30] Following an abort signal by jakearchibald · Pull Request #569 · whatwg/dom () https://github.com/whatwg/dom/pull/569

[31] Allow aborting an ongoing pipe operation using AbortSignals (domenic著, ) https://github.com/whatwg/streams/commit/46c3b89dd3aff28b2fc381dd1d397c12b4fb8a16

[32] pipeTo should return a cancelable promise · Issue #446 · whatwg/streams () https://github.com/whatwg/streams/issues/446

[33] Allow aborting an ongoing pipe operation using AbortSignals by domenic · Pull Request #744 · whatwg/streams () https://github.com/whatwg/streams/pull/744

[66] Add onabort definition and add onslotchange by domenic · Pull Request #785 · whatwg/dom () https://github.com/whatwg/dom/pull/785

[67] Define the onabort event handler IDL attribute (domenic著, ) https://github.com/whatwg/dom/commit/e017c7ad4c24d9870f4029564d820243d90cf4c6

[34] Add onabort definition and add onslotchange by domenic · Pull Request #785 · whatwg/dom () https://github.com/whatwg/dom/pull/785

[35] Align with IDL constructor changes (autokagami著, ) https://github.com/whatwg/dom/commit/57512fac17cf2f1c4c85be4aec178c8086ee5ee4

[36] Update to constructor operations · Issue #780 · whatwg/dom () https://github.com/whatwg/dom/issues/780

[37] [dom] Align with Web IDL specification by autokagami · Pull Request #786 · whatwg/dom () https://github.com/whatwg/dom/pull/786