Re: [whatwg/dom] `AbortController` / `AbortSignal` was updated in a somewhat breaking way (Issue #1059)

I would typically never touch/extend built-in objects.

Cancelation has been such a HUGE gap in JS (and the web platform) for *decades* that I felt CAF had a responsibility to fix these gaps 4 years ago, mostly in response to `AbortController` finally being added.

But I was deeply dismayed that it wasn't added with something as obvious/helpful as a reason-tracking mechanism. I fished around for *why*, and I didn't find anything concrete.

Reluctantly, I decided CAF couldn't wait around in case a future change would address that gap. As it turned out, waiting 4 long years would have been, IMO, an unacceptable delay in addressing what people needed.

It was important to me to embrace the ecosystem, and (in particular) interop with things like `fetch(..)`. That unfortunately meant I couldn't just wrap around `AbortSignal` (as `fetch(..)` wouldn't recognize them). Also, I can't even sub-class `AbortSignal` because I don't control the creation (done inside of `AbortController` automatically). I don't see any other way I could have balanced all this other than to decorate `AbortSignal` instances. I didn't *want* to, because I didn't want to face a day like yesterday in the future. But it was a risk I felt I needed to take.

I had thoughts about what it would be like if `reason` was later added. I intentionally designed CAF to work seamlessly with such a change, or so I thought.

I did not anticipate the read-only bit, but again that turned out to be an easy'ish accommodation to work around. I honestly never would have even remotely dreamed of the DOMException-on-omission bit. That part in particular just feels so unlike how features are typically added to existing APIs, as it feels to me like deliberately "breaking".

Lessons learned, for sure. But honestly, the 4 year gap here in some ways validates my reluctant decisions back then.

Again, if there are strong motivations for read-only and DOMException-on-omission, they are not at all obvious to me thus far. I would appreciate links to any further historical context onnsuch decisions.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/1059#issuecomment-1044784387
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/1059/1044784387@github.com>

Received on Friday, 18 February 2022 16:22:52 UTC