Skip to content

Fix build_js_types: move abortSignal's required param first - #59910

Closed
rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:fix-build-js-types-abort-signal
Closed

rubennorte wants to merge 1 commit into
react:mainfrom
rubennorte:fix-build-js-types-abort-signal

Conversation

@rubennorte

Copy link
Copy Markdown
Member

Summary:
#59896 made ReactNativeElement unconditionally extend EventTarget, which imports the AbortSignal type, pulling AbortSignal.d.ts into the generated types checked by yarn test-generated-typescript. The internal abortSignal(reason = ..., signal) helper declares a defaulted parameter before a required one, which flow-api-translator emits as abortSignal(reason?: unknown | void, signal: AbortSignal) and tsc rejects with TS1016.

Reorder the parameters to abortSignal(signal, reason = ...) and update both internal callers. The public API snapshot is unchanged.

Changelog: [Internal]

Test Plan:

  • yarn build-types --skip-snapshot && yarn test-generated-typescript: fails with TS1016 before, passes after
  • yarn build-types --validate: API snapshot is up to date
  • yarn eslint --max-warnings 0 packages/react-native/src/private/webapis/dom/abort-api/

Summary:
react#59896 made `ReactNativeElement` unconditionally extend `EventTarget`, which
imports the `AbortSignal` type, pulling `AbortSignal.d.ts` into the generated
types checked by `yarn test-generated-typescript`. The internal
`abortSignal(reason = ..., signal)` helper declares a defaulted parameter before
a required one, which flow-api-translator emits as
`abortSignal(reason?: unknown | void, signal: AbortSignal)` and tsc rejects with
TS1016.

Reorder the parameters to `abortSignal(signal, reason = ...)` and update both
internal callers. The public API snapshot is unchanged.

Changelog: [Internal]

Test Plan:
- `yarn build-types --skip-snapshot && yarn test-generated-typescript`: fails
  with TS1016 before, passes after
- `yarn build-types --validate`: API snapshot is up to date
- `yarn eslint --max-warnings 0 packages/react-native/src/private/webapis/dom/abort-api/`
@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 Nov 10, 2026
@YevheniiKotyrlo

Copy link
Copy Markdown
Contributor

#59896 also leaves Fantom red on main: EventTargetDispatching-itest.js fails 16 cases in its enableImperativeEvents ✅ variant, where a listener added with addEventListener receives no dispatched event (expect(handler).toHaveBeenCalledTimes(1) at line 509 gets 0 calls). Every Test All run from 9f40f16 on fails all three Fantom attempts on them, such as this one on b13546b8ce.

@rubennorte

Copy link
Copy Markdown
Member Author

#59896 also leaves Fantom red on main: EventTargetDispatching-itest.js fails 16 cases in its enableImperativeEvents ✅ variant, where a listener added with addEventListener receives no dispatched event (expect(handler).toHaveBeenCalledTimes(1) at line 509 gets 0 calls). Every Test All run from 9f40f16 on fails all three Fantom attempts on them, such as this one on b13546b8ce.

That's an unrelated breakage. I'll fix both in #59911.

@rubennorte rubennorte closed this Nov 10, 2026
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: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants