Repository navigation
Fix build_js_types: move abortSignal's required param first - #59910
rubennorte wants to merge 1 commit into
Conversation
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/`
|
#59896 also leaves Fantom red on |
That's an unrelated breakage. I'll fix both in #59911. |
Summary:
#59896 made
ReactNativeElementunconditionally extendEventTarget, which imports theAbortSignaltype, pullingAbortSignal.d.tsinto the generated types checked byyarn test-generated-typescript. The internalabortSignal(reason = ..., signal)helper declares a defaulted parameter before a required one, which flow-api-translator emits asabortSignal(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 afteryarn build-types --validate: API snapshot is up to dateyarn eslint --max-warnings 0 packages/react-native/src/private/webapis/dom/abort-api/