[compiler] Dedupe @babel/types #32581
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Extracting portions of #32416 for easier review. This PR dedupes @babel/types to resolve to 7.26.3, for compatibility in the root workspace where eslint-plugin-react-hooks resides.
I also needed to update @babel/preset-typescript in snap.
The compiler changes in HIR and ReactiveScopes were needed due to types changing. Notably, Babel added support for optional chaining assignment (currently Stage 1), so in the latest versions of @babel/types, AssignmentExpression.left can now also be of t.OptionalMemberExpression.
Given that this is in Stage 1, the compiler probably shouldn't support this syntax, so this PR updates HIR to bailout with a TODO if there is a non LVal on the lhs of an Assignment Expression.
There was also a small superficial SourceLocation change needed in
InferReactiveScopeVariablesas Babel 8 changes were accidentally released in 7. It doesn't affect our analysis so it seems fine to just update with the new properties.Stack created with Sapling. Best reviewed with ReviewStack.
Co-authored-by: michael faith michaelfaith@users.noreply.github.com