Repository navigation
Upgrade the Flow parser tooling to 0.340.0 - #2224
Conversation
|
@gkz has exported this pull request. If you are a Meta employee, you can view the originating Diff in D131489493. |
1918e42 to
a204c80
Compare
Metro review: Looks goodRisk: low · Commit: This PR bumps No findings. Verified
Not run: No benchmark: this is a parser version bump plus a script-only change, with no performance claim. The full Jest suite and the integration bundles weren't run; only the suites that touch the parser and the scripts were. Windows wasn't checked; the hashbang regex already handles CRLF and is covered by a test. Automated review by Claude. Advisory only: it never approves or blocks, and a maintainer makes the call. |
a204c80 to
0d23511
Compare
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
0d23511 to
ddbfa1b
Compare
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
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 Pull Request resolved: #59983
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
Summary:
@public
Upgrade
flow-parser,flow-estree,flow-eslint,flow-transformandflow-api-translatorto 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:
typeArgumentsinstead oftypeParameters, 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 isnull, and fall back to the previous field otherwise, so the same source keeps working with the older releases that remain installed elsewhere.EnumBodycarrying 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.namewidened 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.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