From faf0cf8cb887461218f63d4c173c8dd495e6c2a9 Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Wed, 21 Jun 2023 09:13:20 +0800 Subject: [PATCH] [build-properties] enable network inspector by default (#22994) # Why for sdk 49, let's enable network inspector by default # How - rename `unstable_networkInspector` to `networkInspector` - enable the property by default - update generated doc # Test Plan - ci passed - tested prebuild on real project --- .../unversioned/expo-build-properties.json | 2 +- packages/expo-build-properties/CHANGELOG.md | 2 ++ .../expo-build-properties/build/android.js | 2 +- packages/expo-build-properties/build/ios.js | 2 +- .../build/pluginConfig.d.ts | 14 ++++++---- .../build/pluginConfig.js | 4 +-- .../src/__tests__/android-test.ts | 12 ++++---- .../src/__tests__/withBuildProperties-test.ts | 28 ++++++++----------- packages/expo-build-properties/src/android.ts | 2 +- packages/expo-build-properties/src/ios.ts | 2 +- .../expo-build-properties/src/pluginConfig.ts | 18 ++++++------ 11 files changed, 44 insertions(+), 44 deletions(-) diff --git a/docs/public/static/data/unversioned/expo-build-properties.json b/docs/public/static/data/unversioned/expo-build-properties.json index b8f10fdd6ae23..5cf939f406993 100644 --- a/docs/public/static/data/unversioned/expo-build-properties.json +++ b/docs/public/static/data/unversioned/expo-build-properties.json @@ -1 +1 @@ -{"name":"expo-build-properties","kind":1,"children":[{"name":"default","kind":8388608},{"name":"ExtraIosPodDependency","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing extra CocoaPods dependency."}],"blockTags":[{"tag":"@see","content":[{"kind":"text","text":"https://guides.cocoapods.org/syntax/podfile.html#pod"}]},{"tag":"@platform","content":[{"kind":"text","text":"ios"}]}]},"children":[{"name":"branch","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The git branch to fetch. See the "},{"kind":"inline-tag","tag":"@link","text":"git"},{"kind":"text","text":" property for more information."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"commit","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The git commit to fetch. See the "},{"kind":"inline-tag","tag":"@link","text":"git"},{"kind":"text","text":" property for more information."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"configurations","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Build configurations for which the pod should be installed."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`['Debug', 'Release']`"}]}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"git","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Use the bleeding edge version of a Pod."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```\n{ \"name\": \"AFNetworking\", \"git\": \"https://github.com/gowalla/AFNetworking.git\", \"tag\": \"0.7.0\" }\n```"},{"kind":"text","text":"\n\nThis acts like to add this pod dependency statement:\n"},{"kind":"code","text":"```\npod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0'\n```"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"modular_headers","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether this pod should use modular headers."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"name","kind":1024,"comment":{"summary":[{"kind":"text","text":"Name of the pod."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"path","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Custom local filesystem path to add the dependency."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`~/Documents/AFNetworking`"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"podspec","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Custom podspec path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`https://example.com/JSONKit.podspec`"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"source","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Custom source to search for this dependency."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`https://github.com/CocoaPods/Specs.git`"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"tag","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The git tag to fetch. See the "},{"kind":"inline-tag","tag":"@link","text":"git"},{"kind":"text","text":" property for more information."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"testspecs","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Test specs can be optionally included via the :testspecs option. By default, none of a Pod's test specs are included."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`['UnitTests', 'SomeOtherTests']`"}]}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"version","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Version of the pod.\nCocoaPods supports various [versioning options](https://guides.cocoapods.org/using/the-podfile.html#pod)."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`~> 0.1.2`"}]}]},"type":{"type":"intrinsic","name":"string"}}]},{"name":"PluginConfigType","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing base build properties configuration."}]},"children":[{"name":"android","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"android"}]}]},"type":{"type":"reference","name":"PluginConfigTypeAndroid"}},{"name":"ios","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for iOS native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"ios"}]}]},"type":{"type":"reference","name":"PluginConfigTypeIos"}}]},{"name":"PluginConfigTypeAndroid","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"android"}]}]},"children":[{"name":"buildToolsVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`buildToolsVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"compileSdkVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`compileSdkVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"number"}},{"name":"enableProguardInReleaseBuilds","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable [Proguard or R8](https://developer.android.com/studio/build/shrink-code) in release builds to obfuscate Java code and reduce app size."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"enableShrinkResourcesInReleaseBuilds","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable ["},{"kind":"code","text":"`shrinkResources`"},{"kind":"text","text":"](https://developer.android.com/studio/build/shrink-code#shrink-resources) in release builds to remove unused resources from the app.\nThis property should be used in combination with "},{"kind":"code","text":"`enableProguardInReleaseBuilds`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"extraMavenRepos","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Add extra maven respositories to all gradle projects.\n\nThis acts like to add the following code to **android/build.gradle**:\n"},{"kind":"code","text":"```groovy\nallprojects {\n repositories {\n maven {\n url [THE_EXTRA_MAVEN_REPOSITORY]\n }\n }\n}\n```"}],"blockTags":[{"tag":"@hide","content":[{"kind":"text","text":"For the implementation details,\nthis property is actually handled by "},{"kind":"code","text":"`expo-modules-autolinking`"},{"kind":"text","text":" but not the config-plugins inside expo-build-properties."}]}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"extraProguardRules","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Append custom [Proguard rules](https://www.guardsquare.com/manual/configuration/usage) to **android/app/proguard-rules.pro**."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"flipper","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"By default, Flipper is enabled with the version that comes bundled with "},{"kind":"code","text":"`react-native`"},{"kind":"text","text":".\n\nUse this to change the [Flipper](https://fbflipper.com/) version when\nrunning your app on Android. You can set the "},{"kind":"code","text":"`flipper`"},{"kind":"text","text":" property to a\nsemver string and specify an alternate Flipper version."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"kotlinVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the Kotlin version used when building the app."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"minSdkVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`minSdkVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"number"}},{"name":"newArchEnabled","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable React Native new architecture for Android platform."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"packagingOptions","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android Gradle plugin [PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions)."}]},"type":{"type":"reference","name":"PluginConfigTypeAndroidPackagingOptions"}},{"name":"targetSdkVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`targetSdkVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"number"}},{"name":"unstable_networkInspector","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).\nSDK 49+ is required."}]},"type":{"type":"intrinsic","name":"boolean"}}]},{"name":"PluginConfigTypeAndroidPackagingOptions","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android Gradle plugin [PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions)."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"android"}]}]},"children":[{"name":"doNotStrip","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries that should not be stripped of debug symbols."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"exclude","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries that should be excluded from being packaged in the APK."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"merge","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries where all occurrences are concatenated and packaged in the APK."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"pickFirst","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries where only the first occurrence is packaged in the APK."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}]},{"name":"PluginConfigTypeIos","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for iOS native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"ios"}]}]},"children":[{"name":"deploymentTarget","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default iOS \"Deployment Target\" version in the following projects:\n - in CocoaPods projects,\n - "},{"kind":"code","text":"`PBXNativeTarget`"},{"kind":"text","text":" with \"com.apple.product-type.application\" "},{"kind":"code","text":"`productType`"},{"kind":"text","text":" in the app project."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"extraPods","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Add extra CocoaPods dependencies for all targets.\n\nThis acts like to add the following code to **ios/Podfile**:\n"},{"kind":"code","text":"```\npod '[EXTRA_POD_NAME]', '~> [EXTRA_POD_VERSION]'\n# e.g.\npod 'Protobuf', '~> 3.14.0'\n```"}],"blockTags":[{"tag":"@hide","content":[{"kind":"text","text":"For the implementation details,\nthis property is actually handled by "},{"kind":"code","text":"`expo-modules-autolinking`"},{"kind":"text","text":" but not the config-plugins inside expo-build-properties."}]}]},"type":{"type":"array","elementType":{"type":"reference","name":"ExtraIosPodDependency"}}},{"name":"flipper","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable [Flipper](https://fbflipper.com/) when running your app on iOS in\nDebug mode. Setting "},{"kind":"code","text":"`true`"},{"kind":"text","text":" enables the default version of Flipper, while\nsetting a semver string will enable a specific version of Flipper you've\ndeclared in your **package.json**. The default for this configuration is "},{"kind":"code","text":"`false`"},{"kind":"text","text":".\n\n> You cannot use "},{"kind":"code","text":"`flipper`"},{"kind":"text","text":" at the same time as "},{"kind":"code","text":"`useFrameworks`"},{"kind":"text","text":", and\ndoing so will generate an error."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"boolean"}]}},{"name":"newArchEnabled","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable React Native new architecture for iOS platform."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"unstable_networkInspector","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).\nSDK 49+ is required."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"useFrameworks","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable ["},{"kind":"code","text":"`use_frameworks!`"},{"kind":"text","text":"](https://guides.cocoapods.org/syntax/podfile.html#use_frameworks_bang)\nin "},{"kind":"code","text":"`Podfile`"},{"kind":"text","text":" to use frameworks instead of static libraries for Pods.\n\n> You cannot use "},{"kind":"code","text":"`useFrameworks`"},{"kind":"text","text":" and "},{"kind":"code","text":"`flipper`"},{"kind":"text","text":" at the same time , and\ndoing so will generate an error."}]},"type":{"type":"union","types":[{"type":"literal","value":"static"},{"type":"literal","value":"dynamic"}]}}]},{"name":"withBuildProperties","kind":64,"signatures":[{"name":"withBuildProperties","kind":4096,"comment":{"summary":[{"kind":"text","text":"Config plugin allowing customizing native Android and iOS build properties for managed apps."}]},"parameters":[{"name":"config","kind":32768,"comment":{"summary":[{"kind":"text","text":"Expo config for application."}]},"type":{"type":"reference","name":"ExpoConfig"}},{"name":"props","kind":32768,"comment":{"summary":[{"kind":"text","text":"Configuration for the build properties plugin."}]},"type":{"type":"reference","name":"PluginConfigType"}}],"type":{"type":"reference","name":"ExpoConfig"}}]}]} \ No newline at end of file +{"name":"expo-build-properties","kind":1,"children":[{"name":"default","kind":8388608},{"name":"ExtraIosPodDependency","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing extra CocoaPods dependency."}],"blockTags":[{"tag":"@see","content":[{"kind":"text","text":"[Podfile syntax reference](https://guides.cocoapods.org/syntax/podfile.html#pod)"}]},{"tag":"@platform","content":[{"kind":"text","text":"ios"}]}]},"children":[{"name":"branch","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The git branch to fetch. See the "},{"kind":"inline-tag","tag":"@link","text":"git"},{"kind":"text","text":" property for more information."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"commit","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The git commit to fetch. See the "},{"kind":"inline-tag","tag":"@link","text":"git"},{"kind":"text","text":" property for more information."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"configurations","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Build configurations for which the pod should be installed."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`['Debug', 'Release']`"}]}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"git","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Use the bleeding edge version of a Pod."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"```\n{ \"name\": \"AFNetworking\", \"git\": \"https://github.com/gowalla/AFNetworking.git\", \"tag\": \"0.7.0\" }\n```"},{"kind":"text","text":"\n\nThis acts like to add this pod dependency statement:\n"},{"kind":"code","text":"```\npod 'AFNetworking', :git => 'https://github.com/gowalla/AFNetworking.git', :tag => '0.7.0'\n```"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"modular_headers","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Whether this pod should use modular headers."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"name","kind":1024,"comment":{"summary":[{"kind":"text","text":"Name of the pod."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"path","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Custom local filesystem path to add the dependency."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`~/Documents/AFNetworking`"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"podspec","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Custom podspec path."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`https://example.com/JSONKit.podspec`"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"source","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Custom source to search for this dependency."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`https://github.com/CocoaPods/Specs.git`"}]}]},"type":{"type":"intrinsic","name":"string"}},{"name":"tag","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"The git tag to fetch. See the "},{"kind":"inline-tag","tag":"@link","text":"git"},{"kind":"text","text":" property for more information."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"testspecs","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Test specs can be optionally included via the :testspecs option. By default, none of a Pod's test specs are included."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`['UnitTests', 'SomeOtherTests']`"}]}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"version","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Version of the pod.\nCocoaPods supports various [versioning options](https://guides.cocoapods.org/using/the-podfile.html#pod)."}],"blockTags":[{"tag":"@example","content":[{"kind":"code","text":"`~> 0.1.2`"}]}]},"type":{"type":"intrinsic","name":"string"}}]},{"name":"PluginConfigType","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing base build properties configuration."}]},"children":[{"name":"android","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"android"}]}]},"type":{"type":"reference","name":"PluginConfigTypeAndroid"}},{"name":"ios","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for iOS native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"ios"}]}]},"type":{"type":"reference","name":"PluginConfigTypeIos"}}]},{"name":"PluginConfigTypeAndroid","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"android"}]}]},"children":[{"name":"buildToolsVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`buildToolsVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"compileSdkVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`compileSdkVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"number"}},{"name":"enableProguardInReleaseBuilds","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable [Proguard or R8](https://developer.android.com/studio/build/shrink-code) in release builds to obfuscate Java code and reduce app size."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"enableShrinkResourcesInReleaseBuilds","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable ["},{"kind":"code","text":"`shrinkResources`"},{"kind":"text","text":"](https://developer.android.com/studio/build/shrink-code#shrink-resources) in release builds to remove unused resources from the app.\nThis property should be used in combination with "},{"kind":"code","text":"`enableProguardInReleaseBuilds`"},{"kind":"text","text":"."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"extraMavenRepos","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Add extra maven repositories to all gradle projects.\n\nThis acts like to add the following code to **android/build.gradle**:\n"},{"kind":"code","text":"```groovy\nallprojects {\n repositories {\n maven {\n url [THE_EXTRA_MAVEN_REPOSITORY]\n }\n }\n}\n```"}],"blockTags":[{"tag":"@hide","content":[{"kind":"text","text":"For the implementation details,\nthis property is actually handled by "},{"kind":"code","text":"`expo-modules-autolinking`"},{"kind":"text","text":" but not the config-plugins inside expo-build-properties."}]}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"extraProguardRules","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Append custom [Proguard rules](https://www.guardsquare.com/manual/configuration/usage) to **android/app/proguard-rules.pro**."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"flipper","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"By default, Flipper is enabled with the version that comes bundled with "},{"kind":"code","text":"`react-native`"},{"kind":"text","text":".\n\nUse this to change the [Flipper](https://fbflipper.com/) version when\nrunning your app on Android. You can set the "},{"kind":"code","text":"`flipper`"},{"kind":"text","text":" property to a\nsemver string and specify an alternate Flipper version."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"kotlinVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the Kotlin version used when building the app."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"minSdkVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`minSdkVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"number"}},{"name":"networkInspector","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable the Network Inspector."}],"blockTags":[{"tag":"@default","content":[{"kind":"text","text":"true"}]}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"newArchEnabled","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable React Native new architecture for Android platform."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"packagingOptions","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android Gradle plugin [PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions)."}]},"type":{"type":"reference","name":"PluginConfigTypeAndroidPackagingOptions"}},{"name":"targetSdkVersion","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default "},{"kind":"code","text":"`targetSdkVersion`"},{"kind":"text","text":" version number in **build.gradle**."}]},"type":{"type":"intrinsic","name":"number"}}]},{"name":"PluginConfigTypeAndroidPackagingOptions","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for Android Gradle plugin [PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions)."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"android"}]}]},"children":[{"name":"doNotStrip","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries that should not be stripped of debug symbols."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"exclude","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries that should be excluded from being packaged in the APK."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"merge","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries where all occurrences are concatenated and packaged in the APK."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}},{"name":"pickFirst","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Array of patterns for native libraries where only the first occurrence is packaged in the APK."}]},"type":{"type":"array","elementType":{"type":"intrinsic","name":"string"}}}]},{"name":"PluginConfigTypeIos","kind":256,"comment":{"summary":[{"kind":"text","text":"Interface representing available configuration for iOS native build properties."}],"blockTags":[{"tag":"@platform","content":[{"kind":"text","text":"ios"}]}]},"children":[{"name":"deploymentTarget","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Override the default iOS \"Deployment Target\" version in the following projects:\n - in CocoaPods projects,\n - "},{"kind":"code","text":"`PBXNativeTarget`"},{"kind":"text","text":" with \"com.apple.product-type.application\" "},{"kind":"code","text":"`productType`"},{"kind":"text","text":" in the app project."}]},"type":{"type":"intrinsic","name":"string"}},{"name":"extraPods","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Add extra CocoaPods dependencies for all targets.\n\nThis acts like to add the following code to **ios/Podfile**:\n"},{"kind":"code","text":"```\npod '[EXTRA_POD_NAME]', '~> [EXTRA_POD_VERSION]'\n# e.g.\npod 'Protobuf', '~> 3.14.0'\n```"}],"blockTags":[{"tag":"@hide","content":[{"kind":"text","text":"For the implementation details,\nthis property is actually handled by "},{"kind":"code","text":"`expo-modules-autolinking`"},{"kind":"text","text":" but not the config-plugins inside expo-build-properties."}]}]},"type":{"type":"array","elementType":{"type":"reference","name":"ExtraIosPodDependency"}}},{"name":"flipper","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable [Flipper](https://fbflipper.com/) when running your app on iOS in\nDebug mode. Setting "},{"kind":"code","text":"`true`"},{"kind":"text","text":" enables the default version of Flipper, while\nsetting a semver string will enable a specific version of Flipper you've\ndeclared in your **package.json**. The default for this configuration is "},{"kind":"code","text":"`false`"},{"kind":"text","text":".\n\n> You cannot use "},{"kind":"code","text":"`flipper`"},{"kind":"text","text":" at the same time as "},{"kind":"code","text":"`useFrameworks`"},{"kind":"text","text":", and\ndoing so will generate an error."}]},"type":{"type":"union","types":[{"type":"intrinsic","name":"string"},{"type":"intrinsic","name":"boolean"}]}},{"name":"networkInspector","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable the Network Inspector."}],"blockTags":[{"tag":"@default","content":[{"kind":"text","text":"true"}]}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"newArchEnabled","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable React Native new architecture for iOS platform."}]},"type":{"type":"intrinsic","name":"boolean"}},{"name":"useFrameworks","kind":1024,"flags":{"isOptional":true},"comment":{"summary":[{"kind":"text","text":"Enable ["},{"kind":"code","text":"`use_frameworks!`"},{"kind":"text","text":"](https://guides.cocoapods.org/syntax/podfile.html#use_frameworks_bang)\nin "},{"kind":"code","text":"`Podfile`"},{"kind":"text","text":" to use frameworks instead of static libraries for Pods.\n\n> You cannot use "},{"kind":"code","text":"`useFrameworks`"},{"kind":"text","text":" and "},{"kind":"code","text":"`flipper`"},{"kind":"text","text":" at the same time , and\ndoing so will generate an error."}]},"type":{"type":"union","types":[{"type":"literal","value":"static"},{"type":"literal","value":"dynamic"}]}}]},{"name":"withBuildProperties","kind":64,"signatures":[{"name":"withBuildProperties","kind":4096,"comment":{"summary":[{"kind":"text","text":"Config plugin allowing customizing native Android and iOS build properties for managed apps."}]},"parameters":[{"name":"config","kind":32768,"comment":{"summary":[{"kind":"text","text":"Expo config for application."}]},"type":{"type":"reference","name":"ExpoConfig"}},{"name":"props","kind":32768,"comment":{"summary":[{"kind":"text","text":"Configuration for the build properties plugin."}]},"type":{"type":"reference","name":"PluginConfigType"}}],"type":{"type":"reference","name":"ExpoConfig"}}]}]} \ No newline at end of file diff --git a/packages/expo-build-properties/CHANGELOG.md b/packages/expo-build-properties/CHANGELOG.md index 284ea6ff29844..9cf30faa11b2d 100644 --- a/packages/expo-build-properties/CHANGELOG.md +++ b/packages/expo-build-properties/CHANGELOG.md @@ -4,6 +4,8 @@ ### 🛠 Breaking changes +- Replaced `unstable_networkInspector` as `networkInspector` and enabled the feature by default. ([#22994](https://github.com/expo/expo/pull/22994) by [@kudo](https://github.com/kudo)) + ### 🎉 New features - Added `android.extraMavenRepos` and `ios.extraPods` support. ([#22785](https://github.com/expo/expo/pull/22785) by [@kudo](https://github.com/kudo)) diff --git a/packages/expo-build-properties/build/android.js b/packages/expo-build-properties/build/android.js index ccc8bd77b7839..c048e348fc783 100644 --- a/packages/expo-build-properties/build/android.js +++ b/packages/expo-build-properties/build/android.js @@ -60,7 +60,7 @@ exports.withAndroidBuildProperties = createBuildGradlePropsConfigPlugin([ }, { propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR', - propValueGetter: (config) => config.android?.unstable_networkInspector?.toString(), + propValueGetter: (config) => (config.android?.networkInspector ?? true).toString(), }, ], 'withAndroidBuildProperties'); const withAndroidFlipper = (config, props) => { diff --git a/packages/expo-build-properties/build/ios.js b/packages/expo-build-properties/build/ios.js index 08dfff7efab67..f0f9a9385c19f 100644 --- a/packages/expo-build-properties/build/ios.js +++ b/packages/expo-build-properties/build/ios.js @@ -23,7 +23,7 @@ exports.withIosBuildProperties = createBuildPodfilePropsConfigPlugin([ }, { propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR', - propValueGetter: (config) => config.ios?.unstable_networkInspector?.toString(), + propValueGetter: (config) => (config.ios?.networkInspector ?? true).toString(), }, ], 'withIosBuildProperties'); const withIosDeploymentTarget = (config, props) => { diff --git a/packages/expo-build-properties/build/pluginConfig.d.ts b/packages/expo-build-properties/build/pluginConfig.d.ts index 2fb60dd04c1a1..3e542c5a5034f 100644 --- a/packages/expo-build-properties/build/pluginConfig.d.ts +++ b/packages/expo-build-properties/build/pluginConfig.d.ts @@ -68,10 +68,11 @@ export interface PluginConfigTypeAndroid { */ flipper?: string; /** - * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/). - * SDK 49+ is required. + * Enable the Network Inspector. + * + * @default true */ - unstable_networkInspector?: boolean; + networkInspector?: boolean; /** * Add extra maven repositories to all gradle projects. * @@ -125,10 +126,11 @@ export interface PluginConfigTypeIos { */ flipper?: boolean | string; /** - * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/). - * SDK 49+ is required. + * Enable the Network Inspector. + * + * @default true */ - unstable_networkInspector?: boolean; + networkInspector?: boolean; /** * Add extra CocoaPods dependencies for all targets. * diff --git a/packages/expo-build-properties/build/pluginConfig.js b/packages/expo-build-properties/build/pluginConfig.js index 14f9a4c7048df..aa759722e08a6 100644 --- a/packages/expo-build-properties/build/pluginConfig.js +++ b/packages/expo-build-properties/build/pluginConfig.js @@ -50,7 +50,7 @@ const schema = { }, nullable: true, }, - unstable_networkInspector: { type: 'boolean', nullable: true }, + networkInspector: { type: 'boolean', nullable: true }, extraMavenRepos: { type: 'array', items: { type: 'string' }, nullable: true }, }, nullable: true, @@ -65,7 +65,7 @@ const schema = { type: ['boolean', 'string'], nullable: true, }, - unstable_networkInspector: { type: 'boolean', nullable: true }, + networkInspector: { type: 'boolean', nullable: true }, extraPods: { type: 'array', items: { diff --git a/packages/expo-build-properties/src/__tests__/android-test.ts b/packages/expo-build-properties/src/__tests__/android-test.ts index e41b52746e59f..5e0eb7e1e5914 100644 --- a/packages/expo-build-properties/src/__tests__/android-test.ts +++ b/packages/expo-build-properties/src/__tests__/android-test.ts @@ -118,12 +118,10 @@ describe(withAndroidFlipper, () => { modResults: [{ type: 'property', key: 'android.flipper', value: '0.999.0' }], } ); - expect(androidModResults).toEqual([ - { - type: 'property', - key: 'android.flipper', - value: '0.999.0', - }, - ]); + expect(androidModResults).toContainEqual({ + type: 'property', + key: 'android.flipper', + value: '0.999.0', + }); }); }); diff --git a/packages/expo-build-properties/src/__tests__/withBuildProperties-test.ts b/packages/expo-build-properties/src/__tests__/withBuildProperties-test.ts index 98091ff44db41..ece1f8bc961a3 100644 --- a/packages/expo-build-properties/src/__tests__/withBuildProperties-test.ts +++ b/packages/expo-build-properties/src/__tests__/withBuildProperties-test.ts @@ -87,13 +87,11 @@ describe(withBuildProperties, () => { modResults: [{ type: 'property', key: 'android.compileSdkVersion', value: '30' }], } ); - expect(androidModResults).toEqual([ - { - type: 'property', - key: 'android.compileSdkVersion', - value: '31', - }, - ]); + expect(androidModResults).toContainEqual({ + type: 'property', + key: 'android.compileSdkVersion', + value: '31', + }); const { modResults: iosModResults } = await compileMockModWithResultsAsync( {}, @@ -104,7 +102,7 @@ describe(withBuildProperties, () => { modResults: { 'ios.useFrameworks': 'dynamic' } as Record, } ); - expect(iosModResults).toEqual({ + expect(iosModResults).toMatchObject({ 'ios.useFrameworks': 'static', }); }); @@ -121,13 +119,11 @@ describe(withBuildProperties, () => { modResults: [{ type: 'property', key: 'android.compileSdkVersion', value: '30' }], } ); - expect(androidModResults).toEqual([ - { - type: 'property', - key: 'android.compileSdkVersion', - value: '30', - }, - ]); + expect(androidModResults).toContainEqual({ + type: 'property', + key: 'android.compileSdkVersion', + value: '30', + }); const { modResults: iosModResults } = await compileMockModWithResultsAsync( {}, @@ -138,7 +134,7 @@ describe(withBuildProperties, () => { modResults: { 'ios.useFrameworks': 'dynamic' } as Record, } ); - expect(iosModResults).toEqual({ + expect(iosModResults).toMatchObject({ 'ios.useFrameworks': 'dynamic', }); }); diff --git a/packages/expo-build-properties/src/android.ts b/packages/expo-build-properties/src/android.ts index 7e16ee0aa8801..5e39656d9eebe 100644 --- a/packages/expo-build-properties/src/android.ts +++ b/packages/expo-build-properties/src/android.ts @@ -65,7 +65,7 @@ export const withAndroidBuildProperties = createBuildGradlePropsConfigPlugin config.android?.unstable_networkInspector?.toString(), + propValueGetter: (config) => (config.android?.networkInspector ?? true).toString(), }, ], 'withAndroidBuildProperties' diff --git a/packages/expo-build-properties/src/ios.ts b/packages/expo-build-properties/src/ios.ts index a6e973b42862c..62b2f084e6621 100644 --- a/packages/expo-build-properties/src/ios.ts +++ b/packages/expo-build-properties/src/ios.ts @@ -25,7 +25,7 @@ export const withIosBuildProperties = createBuildPodfilePropsConfigPlugin config.ios?.unstable_networkInspector?.toString(), + propValueGetter: (config) => (config.ios?.networkInspector ?? true).toString(), }, ], 'withIosBuildProperties' diff --git a/packages/expo-build-properties/src/pluginConfig.ts b/packages/expo-build-properties/src/pluginConfig.ts index f735a548cc750..04eeba8621196 100644 --- a/packages/expo-build-properties/src/pluginConfig.ts +++ b/packages/expo-build-properties/src/pluginConfig.ts @@ -90,10 +90,11 @@ export interface PluginConfigTypeAndroid { flipper?: string; /** - * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/). - * SDK 49+ is required. + * Enable the Network Inspector. + * + * @default true */ - unstable_networkInspector?: boolean; + networkInspector?: boolean; /** * Add extra maven repositories to all gradle projects. @@ -152,10 +153,11 @@ export interface PluginConfigTypeIos { flipper?: boolean | string; /** - * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/). - * SDK 49+ is required. + * Enable the Network Inspector. + * + * @default true */ - unstable_networkInspector?: boolean; + networkInspector?: boolean; /** * Add extra CocoaPods dependencies for all targets. @@ -302,7 +304,7 @@ const schema: JSONSchemaType = { nullable: true, }, - unstable_networkInspector: { type: 'boolean', nullable: true }, + networkInspector: { type: 'boolean', nullable: true }, extraMavenRepos: { type: 'array', items: { type: 'string' }, nullable: true }, }, @@ -320,7 +322,7 @@ const schema: JSONSchemaType = { nullable: true, }, - unstable_networkInspector: { type: 'boolean', nullable: true }, + networkInspector: { type: 'boolean', nullable: true }, extraPods: { type: 'array',