Skip to content

Replace abort-controller that has no update 7 years with React Native fork#57230

Open
retyui wants to merge 2 commits into
react:mainfrom
retyui:feat/retyui/abort-api
Open

Replace abort-controller that has no update 7 years with React Native fork#57230
retyui wants to merge 2 commits into
react:mainfrom
retyui:feat/retyui/abort-api

Conversation

@retyui

@retyui retyui commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Summary:

Issue: #55247

We had a similar situation with promise package that wasn't maintained for long time, so Hermes team simply forked it https://github.com/facebook/hermes/blob/adf76f44a5175455a43c984e7d792015ebc3be2a/lib/InternalJavaScript/01-Promise.js#L53 to fix impl. issues and add more features

Changes:

  1. Remove abort-controller (and event-target-shim as subdep.) packages
  2. Move abort-controller/src files to the packages/react-native/src/private/webapis/dom/abort-api/ folder
  3. Adapt existing tests to react-native env.
  4. Add missing methods:
    • AbortSignal.any(signals),
    • AbortSignal.timeout(time),
    • signal.throwIfAborted();
  5. Cover new methods with tests
  6. Bundle size is smaller as a removed event-target-shim has duplicate logic from packages/react-native/src/private/webapis/dom/events/EventTarget.js
  7. Typescript types has updated

Changelog:

[GENERAL] [CHANGED] - Replace abort-controller with fork version from react-native

Test Plan:

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 16, 2026
@retyui retyui force-pushed the feat/retyui/abort-api branch from c73abf7 to bc9cea8 Compare June 16, 2026 14:44
@facebook-github-tools facebook-github-tools Bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Jun 16, 2026
Comment thread packages/react-native/src/types/globals.d.ts
abort: {enumerable: true},
});

if (typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol') {

@retyui retyui Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is original code from abort-controller pkg.

I think this can be removed, since in a RN env. we are 100% sure that a Symbol api is available

@retyui retyui force-pushed the feat/retyui/abort-api branch from bc9cea8 to c64a914 Compare June 22, 2026 10:14
@retyui

retyui commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

@rubennorte could you please review this PR ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant