Skip to content

Support Flow ReadOnlyArray type#290

Open
sellimenes wants to merge 1 commit into
gajus:masterfrom
sellimenes:support-readonly-array-flow-type
Open

Support Flow ReadOnlyArray type#290
sellimenes wants to merge 1 commit into
gajus:masterfrom
sellimenes:support-readonly-array-flow-type

Conversation

@sellimenes
Copy link
Copy Markdown

Summary

  • Map Flow's $ReadOnlyArray<T> built-in to the runtime array(T) type instead of falling through to an object/ref conversion.
  • Add a regression fixture for the issue example so $ReadOnlyArray<string | number> asserts an array of the expected union type.

Fixes #199

IssueHunt bounty: https://issuehunt.io/r/gajus/flow-runtime/issues/199

Testing

  • yarn --cwd packages/flow-config-parser build
  • TEST_FILTER='199-support' yarn --cwd packages/babel-plugin-flow-runtime test
  • yarn --cwd packages/babel-plugin-flow-runtime build
  • yarn --cwd packages/babel-plugin-flow-runtime test -> 238 passing
  • yarn --cwd packages/babel-plugin-flow-runtime lint exits 0 with existing jsx-a11y/alt-text warnings
  • git diff --check

@sellimenes sellimenes mentioned this pull request May 11, 2026
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support $ReadOnlyArray

1 participant