Skip to content

Type-only fixes for Flow's TypeScript iterator defaults - #2276

Merged
meta-codesync[bot] merged 1 commit into
mainfrom
export-D133808530
Nov 22, 2026
Merged

meta-codesync[bot] merged 1 commit into
mainfrom
export-D133808530

Conversation

@SamChou19815

Copy link
Copy Markdown
Member

Summary:
A future Flow lib change gives the iterator types TypeScript's defaults: IteratorObject<T> becomes IteratorObject<T, unknown, unknown> (was void, void).

metro's mapIterable spells out the old defaults (IteratorObject<S, void, void>) instead, since S is not in scope inside it. This diff adjusts it ahead of time.

Differential Revision: D133808530

Summary:
A future Flow lib change gives the iterator types TypeScript's defaults: `IteratorObject<T>` becomes `IteratorObject<T, unknown, unknown>` (was `void, void`).

metro's `mapIterable` spells out the old defaults (`IteratorObject<S, void, void>`) instead, since `S` is not in scope inside it. This diff adjusts it ahead of time.

Differential Revision: D133808530
@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 22, 2026
@meta-codesync

meta-codesync Bot commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

@SamChou19815 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D133808530.

@github-actions

Copy link
Copy Markdown

Metro review: Looks good

Risk: low · Commit: 554b3ec · 3 commands run

This PR only changes a type. It writes out IteratorObject<S, void, void> on the internal mapIterable helper in metro-file-map, so the helper keeps its current type when Flow's iterator defaults change to unknown. There's no runtime change and the helper isn't exported or part of the generated TS types. Flow and lint pass at head.

No findings.

Verified
  • ✅ yarn flow check — No errors at PR head.
  • ✅ yarn eslint packages/metro-file-map/src/index.js
  • ✅ grep -rn mapIterable packages --include='*.d.ts' — No matches, so the helper isn't in the public TS types.

Not run: I didn't check the change against the future Flow lib defaults, because that lib isn't available. No tests or benchmarks were run: the change is to a type annotation only, with no runtime effect. The description has no Changelog: line, which is expected for a type-only internal export from Meta.

Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call.

@meta-codesync
meta-codesync Bot merged commit 6a5144a into main Nov 22, 2026
19 checks passed
@SamChou19815
SamChou19815 deleted the export-D133808530 branch November 22, 2026 20:17
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. meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants