Skip to content

Upgrade the Flow parser tooling to 0.340.0 - #59983

Open
gkz wants to merge 1 commit into
react:mainfrom
gkz:export-D131489493
Open

gkz wants to merge 1 commit into
react:mainfrom
gkz:export-D131489493

Conversation

@gkz

@gkz gkz commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Summary:
@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.

Summary:
@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 c65105a to a605c41 Compare November 12, 2026 23:06

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

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 p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant