From 16343f5e1bff51c1db36e85b4bdc28c0958cb677 Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Tue, 29 Nov 2022 13:25:48 -0800 Subject: [PATCH] Update @babel/generator to ^7.20.0, update snapshots (whitespace changes) Summary: Update `babel/generator` to the latest, which is a semver-minor update within the pre-existing range. I'm separating this out for ease of review because it brings some noisy snapshot changes, including more granular source maps and fewer empty lines in generated output. The majority of this is a result of https://github.com/babel/babel/pull/14980 (`>=7.19.4`). This and the previous diff clear the way for a general Babel update, which is currently blocking a perf-boosting Metro PR https://github.com/facebook/metro/pull/854. Changelog: [Internal] Bump `babel/generator dependency` to `^7.20.0` Reviewed By: motiz88 Differential Revision: D41438635 fbshipit-source-id: d56853169be22a2197ad53d6320ec6c1faf6b2a7 --- .../__snapshots__/index-test.js.snap | 25 +++++-------------- repo-config/package.json | 2 +- yarn.lock | 24 ++++++++++++++---- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap index 93cdd3389e1a4d..5aecf0862f1196 100644 --- a/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap +++ b/packages/babel-plugin-codegen/__tests__/__snapshots__/index-test.js.snap @@ -2,14 +2,14 @@ exports[`Babel plugin inline view configs can inline config for FullNativeComponent.js 1`] = ` "// @flow -const codegenNativeCommands = require('codegenNativeCommands'); +const codegenNativeCommands = require('codegenNativeCommands'); const codegenNativeComponent = require('codegenNativeComponent'); - import type { Int32, BubblingEventHandler, DirectEventHandler, WithDefault } from 'CodegenFlowtypes'; import type { NativeComponentType } from 'codegenNativeComponent'; import type { ViewProps } from 'ViewPropTypes'; -type ModuleProps = $ReadOnly<{| ...ViewProps, +type ModuleProps = $ReadOnly<{| + ...ViewProps, // Props boolean_default_true_optional_both?: WithDefault, // Events @@ -21,17 +21,13 @@ interface NativeCommands { +hotspotUpdate: (viewRef: React.ElementRef, x: Int32, y: Int32) => void, +scrollTo: (viewRef: React.ElementRef, y: Int32, animated: boolean) => void, } - const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); - const { ConditionallyIgnoredEventHandlers } = require('react-native/Libraries/NativeComponent/ViewConfigIgnore'); - const { dispatchCommand } = require(\\"react-native/Libraries/ReactNative/RendererProxy\\"); - let nativeComponentName = 'RCTModule'; export const __INTERNAL_VIEW_CONFIG = { uiViewClassName: 'RCTModule', @@ -61,24 +57,22 @@ export const Commands = { hotspotUpdate(ref, x, y) { dispatchCommand(ref, \\"hotspotUpdate\\", [x, y]); }, - scrollTo(ref, y, animated) { dispatchCommand(ref, \\"scrollTo\\", [y, animated]); } - };" `; exports[`Babel plugin inline view configs can inline config for FullTypedNativeComponent.js 1`] = ` "// @flow -const codegenNativeCommands = require('codegenNativeCommands'); +const codegenNativeCommands = require('codegenNativeCommands'); const codegenNativeComponent = require('codegenNativeComponent'); - import type { NativeComponentType } from 'codegenNativeComponent'; import type { Int32, BubblingEventHandler, DirectEventHandler, WithDefault } from 'CodegenFlowtypes'; import type { ViewProps } from 'ViewPropTypes'; -type ModuleProps = $ReadOnly<{| ...ViewProps, +type ModuleProps = $ReadOnly<{| + ...ViewProps, // Props boolean_default_true_optional_both?: WithDefault, // Events @@ -90,17 +84,13 @@ interface NativeCommands { +hotspotUpdate: (viewRef: React.ElementRef, x: Int32, y: Int32) => void, +scrollTo: (viewRef: React.ElementRef, y: Int32, animated: boolean) => void, } - const NativeComponentRegistry = require('react-native/Libraries/NativeComponent/NativeComponentRegistry'); - const { ConditionallyIgnoredEventHandlers } = require('react-native/Libraries/NativeComponent/ViewConfigIgnore'); - const { dispatchCommand } = require(\\"react-native/Libraries/ReactNative/RendererProxy\\"); - let nativeComponentName = 'RCTModule'; export const __INTERNAL_VIEW_CONFIG = { uiViewClassName: 'RCTModule', @@ -130,17 +120,14 @@ export const Commands = { hotspotUpdate(ref, x, y) { dispatchCommand(ref, \\"hotspotUpdate\\", [x, y]); }, - scrollTo(ref, y, animated) { dispatchCommand(ref, \\"scrollTo\\", [y, animated]); } - };" `; exports[`Babel plugin inline view configs can inline config for NotANativeComponent.js 1`] = ` "const requireNativeComponent = require('requireNativeComponent'); - export default 'Not a view config';" `; diff --git a/repo-config/package.json b/repo-config/package.json index 1c91d260d31c10..a83b60f5562934 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -11,7 +11,7 @@ "dependencies": { "@babel/core": "^7.14.0", "@babel/eslint-parser": "^7.18.2", - "@babel/generator": "^7.14.0", + "@babel/generator": "^7.20.0", "@babel/plugin-transform-regenerator": "^7.0.0", "@definitelytyped/dtslint": "^0.0.127", "@react-native/codegen": "^0.72.0", diff --git a/yarn.lock b/yarn.lock index a7a0923d055442..77ba755e8f143f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -68,12 +68,12 @@ eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.14.0", "@babel/generator@^7.19.0", "@babel/generator@^7.7.2": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.19.0.tgz#785596c06425e59334df2ccee63ab166b738419a" - integrity sha512-S1ahxf1gZ2dpoiFgA+ohK9DIpz50bJ0CWs7Zlzb54Z4sG8qmdIrGrVqmy1sAtTVRb+9CU6U8VqT9L0Zj7hxHVg== +"@babel/generator@^7.14.0", "@babel/generator@^7.19.0", "@babel/generator@^7.20.0", "@babel/generator@^7.7.2": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== dependencies: - "@babel/types" "^7.19.0" + "@babel/types" "^7.20.2" "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" @@ -263,6 +263,11 @@ 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.18.6", "@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" @@ -1090,6 +1095,15 @@ "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@babel/types@^7.20.2": + 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-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"