-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update babel and fix tests accordingly #1343
Conversation
Differential Revision: D61917782
This pull request was exported from Phabricator. Differential Revision: D61543660 |
This pull request was exported from Phabricator. Differential Revision: D61543660 |
95c5a4b
to
c3c47bc
Compare
Summary: Pull Request resolved: #1343 Updated babel packages in all `package.json` and fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically): ### (D61336392) updated jest snapshot tests failing ### (D61336393) updated babel types and corrected typings accordingly The latest babel 7 introduces the following features we need to adjust our types to: * `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](babel/babel#16421)) * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense. * Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](babel/babel#15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings. * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later. ### (D61388737) fixed js1 codeshift tool Babel @ v7 changes RestProperty and SpreadProperty to be RestElement and SpreadElement. babel/babylon#384 Differential Revision: D61543660
This pull request was exported from Phabricator. Differential Revision: D61543660 |
c3c47bc
to
583182c
Compare
Summary: X-link: facebook/metro#1343 Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock`. Then fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically): ### (D61336392) updated jest snapshot tests failing ### (D61336393) updated babel types and corrected typings accordingly The latest babel 7 introduces the following features we need to adjust our types to: * `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](babel/babel#16421)) * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense. * Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](babel/babel#15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings. * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later. ### Added a new metro ENV ignore `BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK` and then ignored in `js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js` Differential Revision: D61543660
Summary: X-link: facebook/metro#1343 Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically): ### (D61336392) updated jest snapshot tests failing ### (D61336393) updated babel types and corrected typings accordingly The latest babel 7 introduces the following features we need to adjust our types to: * `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](babel/babel#16421)) * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense. * Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](babel/babel#15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings. * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later. ### Added a new metro ENV ignore `BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK` and then ignored in `js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js` Differential Revision: D61543660
Summary: Pull Request resolved: #46295 X-link: facebook/metro#1343 Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically): ### (D61336392) updated jest snapshot tests failing ### (D61336393) updated babel types and corrected typings accordingly The latest babel 7 introduces the following features we need to adjust our types to: * `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](babel/babel#16421)) * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense. * Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](babel/babel#15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings. * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later. ### Added a new metro ENV ignore `BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK` and then ignored in `js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js` Differential Revision: D61543660
Summary: Pull Request resolved: #46295 X-link: facebook/metro#1343 Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically): ### (D61336392) updated jest snapshot tests failing ### (D61336393) updated babel types and corrected typings accordingly The latest babel 7 introduces the following features we need to adjust our types to: * `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](babel/babel#16421)) * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense. * Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](babel/babel#15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings. * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later. ### Added a new metro ENV ignore `BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK` and then ignored in `js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js` Reviewed By: robhogan Differential Revision: D61543660
Summary: Pull Request resolved: #46295 X-link: facebook/metro#1343 Updated all **babel** packages in all `package.json` across the repo and ran `npx yarn-deduplicate yarn.lock --scopes babel`. Afterwards, fixed the following issues appearing as a result of that (squashed the following initially separate diffs to make this packages update work atomically): ### (D61336392) updated jest snapshot tests failing ### (D61336393) updated babel types and corrected typings accordingly The latest babel 7 introduces the following features we need to adjust our types to: * `JSXNamespacedName` is removed from valid `CallExpression` args ([PR](babel/babel#16421)) * `JSXNamespacedName` is used for namespaced XML properties in things like `<div namespace:name="value">`, but `fn(namespace:name)` doesn't make any sense. * Dynamic imports are enabled behind a new flag `createImportExpressions` ([PR](babel/babel#15682)), introducing calls such as `import(foo, options)`. These complicate the expected values passed to `import` to be more than just strings. * Since these are behind a flag that is not expected to be enabled, we can throw an error for now and whoever uses it can add a support to it if needed later. ### Added a new metro ENV ignore `BROWSERSLIST_ROOT_PATH` is set to `""` explicitly in `xplat/js/BUCK` and then ignored in `js/tools/metro-buck-transform-worker/src/EnvVarAllowList.js` Reviewed By: robhogan Differential Revision: D61543660 fbshipit-source-id: abbcab72642cf6dc03eed5142eb78dbcc7f63a86
This pull request has been merged in 2c3a22a. |
Summary: This fixes the current state in fbsource, where the bump to this dependency breaks existing run-from-source behaviour when we bump Metro (and `metro-babel-register`) to latest (where facebook#1343 recently bumped all Babel deps). No change to other bumped Babel packages — want to minimally unblock facebook/react-native#46703. As this is fbsource-only, no new release of Metro is needed. Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D63694664
Summary: Pull Request resolved: facebook#1359 This fixes the current state in fbsource, where the bump to this dependency breaks existing run-from-source behaviour when we bump Metro (and `metro-babel-register`) to latest (where facebook#1343 recently bumped all Babel deps). No change to other bumped Babel packages — want to minimally unblock facebook/react-native#46703. As this is fbsource-only, no new release of Metro is needed. Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D63694664
Summary: Pull Request resolved: #1359 This fixes the current state in fbsource, where the bump to this dependency breaks existing run-from-source behaviour when we bump Metro (and `metro-babel-register`) to latest (where #1343 recently bumped all Babel deps). No change to other bumped Babel packages — want to minimally unblock facebook/react-native#46703. As this is fbsource-only, no new release of Metro is needed. Changelog: [Internal] Reviewed By: vzaidman Differential Revision: D63694664 fbshipit-source-id: 83af0807570c2d2b6517d4bd4a668550463190b0
"@babel/traverse": "^7.20.0", | ||
"@babel/types": "^7.20.0", | ||
"@babel/traverse": "^7.25.3", | ||
"@babel/traverse--for-generate-function-map": "npm:@babel/traverse@^7.25.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vzaidman Why was this dependency with referrer created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our security tools are highlighting this as a potential security issue.
detected resolved URL for package with a different name: @babel/traverse--for-generate-function-map
expected: @babel/traverse--for-generate-function-map
actual: @babel/traverse
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jerone - added the info about that to the PR summary. It was introduced in #1340 - "re-implement babel traverse cache pollution bug workaround using a second copy of babel traverse".
The tool flagging it as a potential security issue is concerned about "detected resolved URL for package with a different name" but this is totally expected, so I think you can ignore or mark this concern as resolved.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update. I have whitelisted this change.
The tool that giving the warning was lockfile linting: https://github.com/lirantal/lockfile-lint/tree/main/packages/lockfile-lint-api#validators
Updated babel packages in
package.json
, removedyarn.lock
files and recreated them by runningyarn install
also fixed the following:JSXNamespacedName
is removed from validCallExpression
args (PR)JSXNamespacedName
is used for namespaced XML properties in things like<div namespace:name="value">
, butfn(namespace:name)
doesn't make any sense.createImportExpressions
(PR), introducing calls such asimport(foo, options)
. These complicate the expected values passed toimport
to be more than just strings.Differential Revision: D61543660
Also merged #1340 - "re-implement babel traverse cache pollution bug workaround using a second copy of babel traverse"