Skip to content

Type Babel's definition constants and numeric NodePath keys - #2097

Open
robhogan wants to merge 1 commit into
mainfrom
pr2097
Open

robhogan wants to merge 1 commit into
mainfrom
pr2097

Conversation

@robhogan

Copy link
Copy Markdown
Collaborator

Our generated @babel/types libdef was missing the node definition tables Babel exports (VISITOR_KEYS, NODE_FIELDS, etc.). This adds them to the generator, typed from the runtime values in Babel 7.29.

It also widens NodePath#key to string | number, since a path inside a list has its numeric index as its key. #2092 currently needs suppressions for both, which we'll remove in a follow-up.

Changelog: Internal

Test plan:
Regenerated with yarn update-babel-flow-lib-defs - the only change to the generated file is the new declarations. React Native's copies of both libdefs are identical to ours, and RN's flow check is clean with the updated files dropped in.

Our generated `@babel/types` libdef was missing the node definition tables Babel exports (`VISITOR_KEYS`, `NODE_FIELDS`, etc.). This adds them to the generator, typed from the runtime values in Babel 7.29.

It also widens `NodePath#key` to `string | number`, since a path inside a list has its numeric index as its key. #2092 currently needs suppressions for both, which we'll remove in a follow-up.

Changelog: Internal

Test plan:
Regenerated with `yarn update-babel-flow-lib-defs` - the only change to the generated file is the new declarations. React Native's copies of both libdefs are identical to ours, and RN's `flow check` is clean with the updated files dropped in.
@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 Oct 23, 2026

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. needs-meta-import

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant