Skip to content

Upgrade the Flow parser tooling to 0.340.0 - #59983

Merged
meta-codesync[bot] merged 1 commit into
react:mainfrom
gkz:export-D131489493
Nov 13, 2026
Merged

meta-codesync[bot] merged 1 commit into
react:mainfrom
gkz:export-D131489493

Conversation

@gkz

@gkz gkz commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary:
X-link: react/metro#2224

@public
Upgrade flow-parser, flow-estree, flow-eslint, flow-transform and flow-api-translator to 0.340.0, and adapt the code generators, codemods, lint rules and parser adapters that read the ESTree output those releases produce.

Four shapes moved since the versions in use, and each one silently changed behavior rather than failing loudly:

  • Generic type annotations carry their arguments in typeArguments instead of typeParameters, so consumers that still read the old field dropped every type argument. Readers now take the canonical field whenever the node carries it, including when it is null, and fall back to the previous field otherwise, so the same source keeps working with the older releases that remain installed elsewhere.
  • Enum declarations expose a single EnumBody carrying an explicit type instead of one node type per value kind. Enum readers accept both and resolve the value kind the same way, so the supported enums and the existing rejection of boolean and symbol enums are unchanged.
  • JSXAttribute.name widened to also allow a namespaced name, so transforms that compare an attribute name against a list now match only plain identifiers and leave namespaced attributes alone, which is what they already did at runtime.
  • Object type properties, array elements, import phases and several other fields are now nullable or newly required. Readers guard them and report the existing unsupported-input errors instead of failing on a missing property, and import declarations are built from constant parser-owned templates so one source satisfies both the old and the new builder.

The lint rules, the declaration generators and the jscodeshift/recast boundary are adapted the same way, and the published type mirrors for the lint and transform packages are refreshed.

Changelog: [Internal]

Reviewed By: SamChou19815, panagosg7

Differential Revision: D131489493

@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 12, 2026
@meta-codesync

meta-codesync Bot commented Nov 12, 2026

Copy link
Copy Markdown

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

@facebook-github-tools facebook-github-tools Bot added the p: Facebook Partner: Facebook label Nov 12, 2026
@gkz
gkz force-pushed the export-D131489493 branch 2 times, most recently from c65105a to a605c41 Compare November 12, 2026 23:06
Summary:
X-link: react/metro#2224

@public
Upgrade `flow-parser`, `flow-estree`, `flow-eslint`, `flow-transform` and `flow-api-translator` to 0.340.0, and adapt the code generators, codemods, lint rules and parser adapters that read the ESTree output those releases produce.

Four shapes moved since the versions in use, and each one silently changed behavior rather than failing loudly:

- Generic type annotations carry their arguments in `typeArguments` instead of `typeParameters`, so consumers that still read the old field dropped every type argument. Readers now take the canonical field whenever the node carries it, including when it is `null`, and fall back to the previous field otherwise, so the same source keeps working with the older releases that remain installed elsewhere.
- Enum declarations expose a single `EnumBody` carrying an explicit type instead of one node type per value kind. Enum readers accept both and resolve the value kind the same way, so the supported enums and the existing rejection of boolean and symbol enums are unchanged.
- `JSXAttribute.name` widened to also allow a namespaced name, so transforms that compare an attribute name against a list now match only plain identifiers and leave namespaced attributes alone, which is what they already did at runtime.
- Object type properties, array elements, import phases and several other fields are now nullable or newly required. Readers guard them and report the existing unsupported-input errors instead of failing on a missing property, and import declarations are built from constant parser-owned templates so one source satisfies both the old and the new builder.

The lint rules, the declaration generators and the `jscodeshift`/recast boundary are adapted the same way, and the published type mirrors for the lint and transform packages are refreshed.

Changelog: [Internal]

Reviewed By: SamChou19815, panagosg7

Differential Revision: D131489493
@gkz
gkz force-pushed the export-D131489493 branch from a605c41 to bd9d0e3 Compare November 13, 2026 05:15
@meta-codesync
meta-codesync Bot merged commit 3f54cc2 into react:main Nov 13, 2026
88 of 89 checks passed
@react-native-bot

Copy link
Copy Markdown
Collaborator

This pull request was successfully merged by @gkz in 3f54cc2

When will my fix make it into a release? | How to file a pick request?

@react-native-bot react-native-bot added the Merged This PR has been merged. label Nov 13, 2026
meta-codesync Bot pushed a commit to meta/relay that referenced this pull request Nov 13, 2026
Summary:
X-link: react/react-native#59983

X-link: react/metro#2224

Upgrade `flow-parser`, `flow-estree`, `flow-eslint`, `flow-transform` and `flow-api-translator` to 0.340.0, and adapt the code generators, codemods, lint rules and parser adapters that read the ESTree output those releases produce.

Four shapes moved since the versions in use, and each one silently changed behavior rather than failing loudly:

- Generic type annotations carry their arguments in `typeArguments` instead of `typeParameters`, so consumers that still read the old field dropped every type argument. Readers now take the canonical field whenever the node carries it, including when it is `null`, and fall back to the previous field otherwise, so the same source keeps working with the older releases that remain installed elsewhere.
- Enum declarations expose a single `EnumBody` carrying an explicit type instead of one node type per value kind. Enum readers accept both and resolve the value kind the same way, so the supported enums and the existing rejection of boolean and symbol enums are unchanged.
- `JSXAttribute.name` widened to also allow a namespaced name, so transforms that compare an attribute name against a list now match only plain identifiers and leave namespaced attributes alone, which is what they already did at runtime.
- Object type properties, array elements, import phases and several other fields are now nullable or newly required. Readers guard them and report the existing unsupported-input errors instead of failing on a missing property, and import declarations are built from constant parser-owned templates so one source satisfies both the old and the new builder.

The lint rules, the declaration generators and the `jscodeshift`/recast boundary are adapted the same way, and the published type mirrors for the lint and transform packages are refreshed.

Changelog: [Internal]

Reviewed By: SamChou19815, panagosg7

Differential Revision: D131489493

fbshipit-source-id: 9c6a582207ecd8757da780276cd864665feb8020
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. Merged This PR has been merged. meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants