Skip to content

Widen FLAGS_SPECS indexer key from unique symbol union to string | symbol - #2338

Open
SamChou19815 wants to merge 1 commit into
mainfrom
export-D136531117
Open

SamChou19815 wants to merge 1 commit into
mainfrom
export-D136531117

Conversation

@SamChou19815

Copy link
Copy Markdown
Member

Summary:
Replaces the InternalOpenFlags (string | typeof kWritableMustExist) index signature key on FLAGS_SPECS in metro-memory-fs with string | symbol.

Index signatures with unique symbol keys are disallowed under strict dictionary-key checking (matching TypeScript TS1337); string | symbol accepts both string flags and the internal symbol key with no runtime changes.

Changelog: [Internal]

Differential Revision: D136531117

…mbol

Summary:
Replaces the `InternalOpenFlags` (`string | typeof kWritableMustExist`) index signature key on `FLAGS_SPECS` in `metro-memory-fs` with `string | symbol`.

Index signatures with `unique symbol` keys are disallowed under strict dictionary-key checking (matching TypeScript TS1337); `string | symbol` accepts both string flags and the internal symbol key with no runtime changes.

Changelog: [Internal]

Differential Revision: D136531117
@meta-codesync

meta-codesync Bot commented Dec 5, 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 D136531117.

@github-actions

github-actions Bot commented Dec 5, 2026

Copy link
Copy Markdown

Metro review: Looks good

Risk: low · Commit: 693b2f0 · 3 commands run

This PR changes the key type of the FLAGS_SPECS index signature in the private metro-memory-fs package from InternalOpenFlags (string | typeof kWritableMustExist) to string | symbol. Index signatures can't use unique symbol keys under stricter dictionary-key checking. The change only touches types: _open still takes InternalOpenFlags, so callers keep the narrower type. Flow, the package's tests and lint all pass, and I have no concerns.

No findings.

Verified
  • ✅ yarn flow full-check — Found 0 errors
  • ✅ yarn jest --no-watchman private/metro-memory-fs — 165 tests passed
  • ✅ yarn eslint private/metro-memory-fs/src/index.js

Not run: I didn't run a benchmark because this change only affects types and has no runtime effect. I didn't check behavior under the stricter dictionary-key Flow setting the description mentions, because this repo's Flow config doesn't enable it.

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

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant