Skip to content

Commit

Permalink
Update @babel/types to ^7.20.0, update babel-no-undef for changed t…
Browse files Browse the repository at this point in the history
…ype aliases

Summary:
Update `babel/types` to the latest semver minor. This necessitates a few internal and external changes so I'm separating out from a general Babel bump.

Changelog: [Fix] Bump `babel/types` dependency to `^7.20.0` for more consistent exposed ASTs.

## `metro-react-native-interop-tools`
The AST node property `optional` is now assigned `null` rather than being unassigned in certain circumstances due to babel/babel#14519 (in `babel/types` >= `7.17.2`).

This wasn't marked as a breaking change - it's not clear to me whether it's intentional, but apart from this snapshot change I don't think it makes any difference internally (since we generally discourage distinguishing `null` from `undefined`). Where Metro exposes ASTs, this behaviour would be dependent on the version of `babel/types` you happened to have installed within the `^7.0.0` range, wheres the dependency bump in this diff should ensure an experience consistent with our test snapshots.

Reviewed By: motiz88

Differential Revision: D41437465

fbshipit-source-id: c6cddb6065599ec30906ec23f60d319ef7b21461
  • Loading branch information
robhogan authored and facebook-github-bot committed Nov 29, 2022
1 parent e7f539a commit c9bf780
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 47 deletions.
2 changes: 1 addition & 1 deletion packages/metro-react-native-interop-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@babel/core": "^7.14.0",
"@babel/types": "^7.0.0",
"@babel/types": "^7.20.0",
"hermes-parser": "0.8.0",
"nullthrows": "^1.1.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ test('getObjectTypeAnnotation, testing an object with a AnyTypeAnnotation proper
{
loc: null,
name: 'setKeepScreenOn',
optional: undefined,
optional: null,
typeAnnotation: {
type: 'AnyTypeAnnotation',
loc: null,
Expand All @@ -203,7 +203,7 @@ test('getObjectTypeProperty, testing AnyTypeAnnotation property', () => {
expect(getObjectTypeProperty(property)).toEqual({
loc: null,
name: 'testProp',
optional: undefined,
optional: null,
typeAnnotation: {
type: 'AnyTypeAnnotation',
loc: null,
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-source-map/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"dependencies": {
"@babel/traverse": "^7.14.0",
"@babel/types": "^7.0.0",
"@babel/types": "^7.20.0",
"invariant": "^2.2.4",
"metro-symbolicate": "0.73.4",
"nullthrows": "^1.1.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-transform-plugins/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@babel/code-frame": "^7.0.0",
"@babel/plugin-syntax-nullish-coalescing-operator": "^7.0.0",
"@babel/plugin-transform-flow-strip-types": "^7.0.0",
"@babel/types": "^7.0.0",
"@babel/types": "^7.20.0",
"metro": "0.73.4"
}
}
2 changes: 1 addition & 1 deletion packages/metro-transform-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"@babel/core": "^7.14.0",
"@babel/generator": "^7.14.0",
"@babel/parser": "^7.14.0",
"@babel/types": "^7.0.0",
"@babel/types": "^7.20.0",
"babel-preset-fbjs": "^3.4.0",
"metro": "0.73.4",
"metro-babel-transformer": "0.73.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/metro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@babel/parser": "^7.14.0",
"@babel/template": "^7.0.0",
"@babel/traverse": "^7.14.0",
"@babel/types": "^7.0.0",
"@babel/types": "^7.20.0",
"absolute-path": "^0.0.0",
"accepts": "^1.3.7",
"async": "^3.2.2",
Expand Down
56 changes: 16 additions & 40 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -456,31 +456,31 @@
dependencies:
"@babel/types" "^7.18.6"

"@babel/helper-string-parser@^7.18.10":
version "7.18.10"
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.18.10.tgz#181f22d28ebe1b3857fa575f5c290b1aaf659b56"
integrity sha512-XtIfWmeNY3i4t7t4D2t02q50HvqHybPqW2ki1kosnvWCwuCMeo81Jf0gwr85jy/neUdg5XDdeFE/80DXiO+njw==
"@babel/helper-string-parser@^7.19.4":
version "7.19.4"
resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63"
integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==

"@babel/helper-validator-identifier@^7.14.0":
version "7.14.0"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz#d26cad8a47c65286b15df1547319a5d0bcf27288"
integrity sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A==

"@babel/helper-validator-identifier@^7.14.5", "@babel/helper-validator-identifier@^7.14.9":
"@babel/helper-validator-identifier@^7.14.5":
version "7.15.7"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz#220df993bfe904a4a6b02ab4f3385a5ebf6e2389"
integrity sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==

"@babel/helper-validator-identifier@^7.16.7":
version "7.16.7"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad"
integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw==

"@babel/helper-validator-identifier@^7.18.6":
version "7.18.6"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076"
integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g==

"@babel/helper-validator-identifier@^7.19.1":
version "7.19.1"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2"
integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==

"@babel/helper-validator-option@^7.12.17":
version "7.12.17"
resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.12.17.tgz#d1fbf012e1a79b7eebbfdc6d270baaf8d9eb9831"
Expand Down Expand Up @@ -1134,37 +1134,13 @@
debug "^4.1.0"
globals "^11.1.0"

"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.14.0", "@babel/types@^7.14.1", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0":
version "7.14.1"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.1.tgz#095bd12f1c08ab63eff6e8f7745fa7c9cc15a9db"
integrity sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==
dependencies:
"@babel/helper-validator-identifier" "^7.14.0"
to-fast-properties "^2.0.0"

"@babel/types@^7.15.4":
version "7.15.6"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.15.6.tgz#99abdc48218b2881c058dd0a7ab05b99c9be758f"
integrity sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==
"@babel/types@^7.0.0", "@babel/types@^7.12.1", "@babel/types@^7.12.13", "@babel/types@^7.13.0", "@babel/types@^7.13.12", "@babel/types@^7.14.0", "@babel/types@^7.14.1", "@babel/types@^7.15.4", "@babel/types@^7.16.7", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.0":
version "7.20.2"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842"
integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==
dependencies:
"@babel/helper-validator-identifier" "^7.14.9"
to-fast-properties "^2.0.0"

"@babel/types@^7.16.7":
version "7.17.0"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b"
integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==
dependencies:
"@babel/helper-validator-identifier" "^7.16.7"
to-fast-properties "^2.0.0"

"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0":
version "7.19.0"
resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.19.0.tgz#75f21d73d73dc0351f3368d28db73465f4814600"
integrity sha512-YuGopBq3ke25BVSiS6fgF49Ul9gH1x70Bcr6bqRLjWCkcX8Hre1/5+z+IiWOIerRMSSEfGZVB9z9kyq7wVs9YA==
dependencies:
"@babel/helper-string-parser" "^7.18.10"
"@babel/helper-validator-identifier" "^7.18.6"
"@babel/helper-string-parser" "^7.19.4"
"@babel/helper-validator-identifier" "^7.19.1"
to-fast-properties "^2.0.0"

"@bcoe/v8-coverage@^0.2.3":
Expand Down

0 comments on commit c9bf780

Please sign in to comment.