From aaea8f9e0df1b2adc886096705848f23bb789c4b Mon Sep 17 00:00:00 2001 From: Emily Xiong Date: Tue, 17 Oct 2023 17:32:56 -0400 Subject: [PATCH] chore(react-native): remove deprecated options in the code (#19665) --- .../react-native/executors/run-android.json | 11 ----------- .../react-native/executors/run-ios.json | 17 ----------------- packages/expo/src/executors/run/run.impl.ts | 2 +- .../application/files/metro.config.js.template | 2 +- .../build-android/build-android.impl.ts | 8 +------- .../src/executors/build-ios/build-ios.impl.ts | 9 +++------ .../executors/run-android/run-android.impl.ts | 12 +++++------- .../src/executors/run-android/schema.json | 11 ----------- .../src/executors/run-ios/run-ios.impl.ts | 10 +++------- .../src/executors/run-ios/schema.json | 17 ----------------- .../files/app/metro.config.js.template | 2 +- 11 files changed, 15 insertions(+), 86 deletions(-) diff --git a/docs/generated/packages/react-native/executors/run-android.json b/docs/generated/packages/react-native/executors/run-android.json index df84f48a58ad4..5593cefeefd1c 100644 --- a/docs/generated/packages/react-native/executors/run-android.json +++ b/docs/generated/packages/react-native/executors/run-android.json @@ -54,11 +54,6 @@ "examples": ["debug", "release"], "x-priority": "important" }, - "packager": { - "type": "boolean", - "description": "Launch packager while building", - "default": true - }, "port": { "type": "number", "description": "The port where the packager server is listening on.", @@ -95,12 +90,6 @@ "type": "boolean", "description": "Explicitly select build type and flavour to use before running a build" }, - "sync": { - "type": "boolean", - "description": "Syncs npm dependencies to `package.json` (for React Native autolink).", - "x-deprecated": "Add sync-deps to dependsOn for this target in project.json instead", - "default": true - }, "resetCache": { "type": "boolean", "description": "Resets metro cache.", diff --git a/docs/generated/packages/react-native/executors/run-ios.json b/docs/generated/packages/react-native/executors/run-ios.json index c0e121e3f5baf..cdf60fd6aecb9 100644 --- a/docs/generated/packages/react-native/executors/run-ios.json +++ b/docs/generated/packages/react-native/executors/run-ios.json @@ -76,28 +76,11 @@ ], "description": "Custom params that will be passed to xcodebuild command." }, - "install": { - "type": "boolean", - "description": "Runs `pod install` for native modules before building iOS app.", - "default": true, - "x-deprecated": "Add `pod-install` to dependsOn for this target in project.json instead." - }, - "sync": { - "type": "boolean", - "description": "Syncs npm dependencies to `package.json` (for React Native autolink).", - "x-deprecated": "Add `sync-deps` to dependsOn for this target in project.json instead.", - "default": true - }, "resetCache": { "type": "boolean", "description": "Resets metro cache.", "default": false }, - "packager": { - "type": "boolean", - "description": "Launch packager while building", - "default": true - }, "binaryPath": { "type": "string", "description": "Path relative to project root where pre-built .app binary lives." diff --git a/packages/expo/src/executors/run/run.impl.ts b/packages/expo/src/executors/run/run.impl.ts index 902af88770a40..9e9fe8ee0b429 100644 --- a/packages/expo/src/executors/run/run.impl.ts +++ b/packages/expo/src/executors/run/run.impl.ts @@ -88,7 +88,7 @@ function runCliRun( }); } -const nxOptions = ['sync', 'platform', 'install', 'clean']; +const nxOptions = ['platform', 'clean']; const iOSOptions = ['xcodeConfiguration', 'schema']; const androidOptions = ['variant']; /* diff --git a/packages/expo/src/generators/application/files/metro.config.js.template b/packages/expo/src/generators/application/files/metro.config.js.template index c6eac6d5ff269..60c1d91ac415a 100644 --- a/packages/expo/src/generators/application/files/metro.config.js.template +++ b/packages/expo/src/generators/application/files/metro.config.js.template @@ -20,7 +20,7 @@ const customConfig = { assetExts: assetExts.filter((ext) => ext !== 'svg'), sourceExts: [...sourceExts, 'svg'], blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]), - unstable_enableSymlinks: true, + // unstable_enableSymlinks: true, // unstable_enablePackageExports: true, }, }; diff --git a/packages/react-native/src/executors/build-android/build-android.impl.ts b/packages/react-native/src/executors/build-android/build-android.impl.ts index 0c907af737eb5..ddec0c376aea1 100644 --- a/packages/react-native/src/executors/build-android/build-android.impl.ts +++ b/packages/react-native/src/executors/build-android/build-android.impl.ts @@ -66,14 +66,8 @@ function runCliBuild( }); } -const nxOptions = ['sync', 'packager']; const startOptions = ['port', 'resetCache']; -const deprecatedOptions = ['apk', 'debug', 'gradleTask']; function createBuildAndroidOptions(options: ReactNativeBuildAndroidOptions) { - return getCliOptions(options, [ - ...nxOptions, - ...startOptions, - ...deprecatedOptions, - ]); + return getCliOptions(options, startOptions); } diff --git a/packages/react-native/src/executors/build-ios/build-ios.impl.ts b/packages/react-native/src/executors/build-ios/build-ios.impl.ts index 98452a453ccd7..0d8e37114cf3a 100644 --- a/packages/react-native/src/executors/build-ios/build-ios.impl.ts +++ b/packages/react-native/src/executors/build-ios/build-ios.impl.ts @@ -68,13 +68,10 @@ function runCliBuildIOS( }); } -const nxOptions = ['sync', 'install', 'packager']; const startOptions = ['port', 'resetCache']; function createBuildIOSOptions(options: ReactNativeBuildIosOptions) { - return getCliOptions( - options, - [...nxOptions, ...startOptions], - ['buildFolder'] - ); + return getCliOptions(options, startOptions, [ + 'buildFolder', + ]); } diff --git a/packages/react-native/src/executors/run-android/run-android.impl.ts b/packages/react-native/src/executors/run-android/run-android.impl.ts index 4e9f02862fdbf..6c6a0a1a515b4 100644 --- a/packages/react-native/src/executors/run-android/run-android.impl.ts +++ b/packages/react-native/src/executors/run-android/run-android.impl.ts @@ -92,14 +92,12 @@ function runCliRunAndroid( }); } -const nxOptions = ['sync', 'packager']; const startOptions = ['port', 'resetCache']; -const deprecatedOptions = ['variant', 'jetifier']; function createRunAndroidOptions(options: ReactNativeRunAndroidOptions) { - return getCliOptions( - options, - [...nxOptions, ...startOptions, ...deprecatedOptions], - ['appId', 'appIdSuffix', 'deviceId'] - ); + return getCliOptions(options, startOptions, [ + 'appId', + 'appIdSuffix', + 'deviceId', + ]); } diff --git a/packages/react-native/src/executors/run-android/schema.json b/packages/react-native/src/executors/run-android/schema.json index 898d31a9a5509..da2a3cd49599e 100644 --- a/packages/react-native/src/executors/run-android/schema.json +++ b/packages/react-native/src/executors/run-android/schema.json @@ -54,11 +54,6 @@ "examples": ["debug", "release"], "x-priority": "important" }, - "packager": { - "type": "boolean", - "description": "Launch packager while building", - "default": true - }, "port": { "type": "number", "description": "The port where the packager server is listening on.", @@ -95,12 +90,6 @@ "type": "boolean", "description": "Explicitly select build type and flavour to use before running a build" }, - "sync": { - "type": "boolean", - "description": "Syncs npm dependencies to `package.json` (for React Native autolink).", - "x-deprecated": "Add sync-deps to dependsOn for this target in project.json instead", - "default": true - }, "resetCache": { "type": "boolean", "description": "Resets metro cache.", diff --git a/packages/react-native/src/executors/run-ios/run-ios.impl.ts b/packages/react-native/src/executors/run-ios/run-ios.impl.ts index f312a6aa0ff3b..8aa65bfcb5054 100644 --- a/packages/react-native/src/executors/run-ios/run-ios.impl.ts +++ b/packages/react-native/src/executors/run-ios/run-ios.impl.ts @@ -92,14 +92,10 @@ function runCliRunIOS( }); } -const nxOptions = ['sync', 'install', 'packager']; const startOptions = ['port', 'resetCache']; -const deprecatedOptions = ['xcodeConfiguration']; function createRunIOSOptions(options: ReactNativeRunIosOptions) { - return getCliOptions( - options, - [...nxOptions, ...startOptions, ...deprecatedOptions], - ['buildFolder'] - ); + return getCliOptions(options, startOptions, [ + 'buildFolder', + ]); } diff --git a/packages/react-native/src/executors/run-ios/schema.json b/packages/react-native/src/executors/run-ios/schema.json index 03d9d30866e9f..6d57f31ef458d 100644 --- a/packages/react-native/src/executors/run-ios/schema.json +++ b/packages/react-native/src/executors/run-ios/schema.json @@ -82,28 +82,11 @@ ], "description": "Custom params that will be passed to xcodebuild command." }, - "install": { - "type": "boolean", - "description": "Runs `pod install` for native modules before building iOS app.", - "default": true, - "x-deprecated": "Add `pod-install` to dependsOn for this target in project.json instead." - }, - "sync": { - "type": "boolean", - "description": "Syncs npm dependencies to `package.json` (for React Native autolink).", - "x-deprecated": "Add `sync-deps` to dependsOn for this target in project.json instead.", - "default": true - }, "resetCache": { "type": "boolean", "description": "Resets metro cache.", "default": false }, - "packager": { - "type": "boolean", - "description": "Launch packager while building", - "default": true - }, "binaryPath": { "type": "string", "description": "Path relative to project root where pre-built .app binary lives." diff --git a/packages/react-native/src/generators/application/files/app/metro.config.js.template b/packages/react-native/src/generators/application/files/app/metro.config.js.template index 78e16b578d369..04f62fb8d3592 100644 --- a/packages/react-native/src/generators/application/files/app/metro.config.js.template +++ b/packages/react-native/src/generators/application/files/app/metro.config.js.template @@ -19,7 +19,7 @@ const customConfig = { assetExts: assetExts.filter((ext) => ext !== 'svg'), sourceExts: [...sourceExts, 'svg'], blockList: exclusionList([/^(?!.*node_modules).*\/dist\/.*/]), - unstable_enableSymlinks: true, + // unstable_enableSymlinks: true, // unstable_enablePackageExports: true, }, };