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

I am not quite sure when this happened, but it seems like fairly recently...  the change to add `reason` to `AbortSignal` was done in a somewhat breaking way, and I'm just finding out about it given that this breakage propagated to one of my libraries that uses/extends `AbortController` and `AbortSignal`.

In particular, my concerns are:

1. The definition of `reason` as *READ-ONLY* breaks libraries (like [CAF](https://github.com/getify/caf)) that had previously been monkey-patching/polyfilling a `reason` property onto `AbortSignal` instances. More about the breakage can be read here: https://github.com/getify/CAF/issues/28

2. A **BREAKING CHANGE** was also made to the `abort(..)` method. The change is that prior, if a `abort()` call was made with no argument, nothing adverse happens. But now, if you call `abort()` with no arguments, the `reason` doesn't stay set as `undefined`, as one would expect from PRIOR behaviors... rather, it gets set to a non-falsy `DOMException` error. That is, in particular, rather surprising, given that `abort(undefined)` -- explicitly passing in `undefined` -- avoids the `DOMException` value for `reason`.

Both of these changes may indeed have valid rationale, and I would certainly appreciate seeing where such discussions happened (as my searches thus far haven't turned up anything).

However, they conspire together to create a breaking change that crashes my CAF library. CAF has been around for 4+ years, is downloaded over 5,000 times per week on npm, and has over 1,200 stars on GitHub. As such, there's clearly a decent amount of sites/apps out there using CAF, and all of them are now broken as a result of these two changes.

I've done a pre-release of CAF to try to fix this crashing in a backwards-compatible way -- will do a full release once affected users report that it addressed the breakage -- but I have no idea if, or how quickly, all those sites/apps who are using CAF will update to my newest library release.

I would like to ask if it's possible to unwind change, even if temporarily, so browsers (like Chrome) are not breaking CAF v14.0.0 and prior?

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

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

Received on Thursday, 17 February 2022 22:07:07 UTC