Update AbortController to more recent polyfill#54275
Conversation
The `abort-controller` package hasn't been updated since 2019, and is missing a number of useful features from the current DOM specification. So, switch to `abortcontroller-polyfill` to get a more modern implementation. Fixes facebook#42042 and facebook#50015.
|
Hi @wolfgang42! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at cla@meta.com. Thanks! |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Importing to run through internal CI, but this LGTM on the face of it, thanks @wolfgang42! |
|
@robhogan I can see that CI failed but no further details, LMK if there’s anything I can do to help. |
|
fyi, I found that |
yes, react native doesnt support DOMException, i think we should use Error instead of DOMException? |
I see DOMException.js in the source code, so this claim is somewhat surprising to me, but I haven't dug into this further. (Maybe it’s used internally but not exported as a global for some reason?)
NodeJS simply provides DOMException and I think that’s the right behavior for react-native, too: otherwise AbortController will have subtly nonstandard behavior that might cause surprises. However, I’ve been having a great deal of trouble getting the Fantom tests up and running to validate any changes: it seems like they depend on some specific versions(s) of gradle/gcc and there doesn’t seem to be any documentation on what kind of environment they need. @robhogan Any more context you have here would be appreciated; otherwise it’s going to be guess-and-check changes. |
|
This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
|
I still haven’t heard back from @robhogan in re why the CI has failed, but otherwise as far as I know this is still a good change to land. |
Summary:
The
abort-controllerpackage hasn't been updated since 2019, and is missing a number of useful features from the current DOM specification. So, switch toabortcontroller-polyfillto get a more modern implementation.Fixes #42042, fixes #50015.
Changelog:
[General] [Changed] - Improve AbortController API support
Test Plan:
I attempted to run
packages/react-native/src/private/webapis/dom/events/__tests__/EventTarget-itest.js, which exercises AbortController, but encountered problems getting fantom set up correctly; I am therefore relying on CI (and the assumption that the upstream package knows what they’re doing).