feat(expo): upgrade Expo to v52 (#29142)

<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

Co-authored-by: Hassan Khan <h@twodoors.dev>
This commit is contained in:
Emily Xiong 2024-12-12 10:06:13 -08:00 committed by GitHub
parent cfcd4d1440
commit a0f4260ebd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
21 changed files with 252 additions and 65 deletions

View File

@ -35,6 +35,19 @@
"alwaysAddToPackageJson": false
}
}
},
"20.3.0": {
"version": "20.3.0-beta.0",
"packages": {
"detox": {
"version": "~20.28.0",
"alwaysAddToPackageJson": false
},
"@testing-library/jest-dom": {
"version": "~6.6.3",
"alwaysAddToPackageJson": false
}
}
}
}
}

View File

@ -1,5 +1,5 @@
export const nxVersion = require('../../package.json').version;
export const detoxVersion = '~20.18.1';
export const testingLibraryJestDom = '~6.4.2';
export const detoxVersion = '~20.28.0';
export const testingLibraryJestDom = '~6.6.3';
export const configPluginsDetoxVersion = '~8.0.0'; // only required for expo

View File

@ -247,6 +247,83 @@
"alwaysAddToPackageJson": false
}
}
},
"20.3.0": {
"version": "20.3.0-beta.0",
"packages": {
"expo": {
"version": "~52.0.11",
"alwaysAddToPackageJson": false
},
"expo-splash-screen": {
"version": "~0.29.13",
"alwaysAddToPackageJson": false
},
"expo-status-bar": {
"version": "~2.0.0",
"alwaysAddToPackageJson": false
},
"@expo/cli": {
"version": "~0.21.8",
"alwaysAddToPackageJson": false
},
"babel-preset-expo": {
"version": "~12.0.1",
"alwaysAddToPackageJson": false
},
"react": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"react-dom": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"react-test-renderer": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"@types/react": {
"version": "~18.3.12",
"alwaysAddToPackageJson": false
},
"react-native": {
"version": "~0.76.3",
"alwaysAddToPackageJson": false
},
"react-native-web": {
"version": "~0.19.13",
"alwaysAddToPackageJson": false
},
"@expo/metro-config": {
"version": "~0.19.4",
"alwaysAddToPackageJson": false
},
"@expo/metro-runtime": {
"version": "~4.0.0",
"alwaysAddToPackageJson": false
},
"react-native-svg-transformer": {
"version": "~1.5.0",
"alwaysAddToPackageJson": false
},
"react-native-svg": {
"version": "~15.8.0",
"alwaysAddToPackageJson": false
},
"@testing-library/react-native": {
"version": "~12.9.0",
"alwaysAddToPackageJson": false
},
"jest-expo": {
"version": "~52.0.2",
"alwaysAddToPackageJson": false
},
"@babel/runtime": {
"version": "7.26.0",
"alwaysAddToPackageJson": false
}
}
}
}
}

View File

@ -44,10 +44,10 @@ export async function installAndUpdatePackageJson(
await installAsync(
packages,
createInstallOptions({
{
fix: options.fix,
check: options.check,
}),
},
createInstallOptions({ force: options.force })
);

View File

@ -1,27 +1,27 @@
export const nxVersion = require('../../package.json').version;
export const expoVersion = '~51.0.8';
export const expoSplashScreenVersion = '~0.27.4';
export const expoStatusBarVersion = '~1.12.1';
export const expoCliVersion = '~0.18.13'; // @expo/cli
export const babelPresetExpoVersion = '~11.0.0';
export const expoVersion = '~52.0.11';
export const expoSplashScreenVersion = '~0.29.13';
export const expoStatusBarVersion = '~2.0.0';
export const expoCliVersion = '~0.21.8'; // @expo/cli
export const babelPresetExpoVersion = '~12.0.1';
export const reactVersion = '18.2.0';
export const reactDomVersion = '18.2.0';
export const reactTestRendererVersion = '18.2.0';
export const typesReactVersion = '~18.2.45';
export const reactVersion = '~18.3.1';
export const reactDomVersion = '~18.3.1';
export const reactTestRendererVersion = '~18.3.1';
export const typesReactVersion = '~18.3.12';
export const reactNativeVersion = '0.74.1';
export const reactNativeWebVersion = '~0.19.11';
export const reactNativeVersion = '0.76.3';
export const reactNativeWebVersion = '~0.19.13';
export const expoMetroConfigVersion = '~0.18.1';
export const expoMetroRuntimeVersion = '~3.2.1';
export const expoMetroConfigVersion = '~0.19.4';
export const expoMetroRuntimeVersion = '~4.0.0';
export const reactNativeSvgTransformerVersion = '1.3.0';
export const reactNativeSvgVersion = '15.2.0';
export const reactNativeSvgTransformerVersion = '~1.5.0';
export const reactNativeSvgVersion = '~15.8.0';
export const testingLibraryReactNativeVersion = '~12.5.0';
export const testingLibraryReactNativeVersion = '~12.9.0';
export const testingLibraryJestNativeVersion = '~5.4.3';
export const jestExpoVersion = '~51.0.2';
export const jestExpoVersion = '~52.0.2';
export const babelRuntimeVersion = '7.24.5';
export const babelRuntimeVersion = '~7.26.0';

View File

@ -220,6 +220,79 @@
"alwaysAddToPackageJson": false
}
}
},
"20.3.0": {
"version": "20.3.0-beta.0",
"packages": {
"react-native": {
"version": "~0.76.3",
"alwaysAddToPackageJson": false
},
"@react-native-community/cli": {
"version": "~15.0.1",
"alwaysAddToPackageJson": true
},
"@react-native-community/cli-platform-android": {
"version": "~15.0.1",
"alwaysAddToPackageJson": true
},
"@react-native-community/cli-platform-ios": {
"version": "~15.0.1",
"alwaysAddToPackageJson": true
},
"@react-native/babel-preset": {
"version": "~0.76.3",
"alwaysAddToPackageJson": false
},
"@react-native/metro-config": {
"version": "~0.76.3",
"alwaysAddToPackageJson": false
},
"react-native-web": {
"version": "~0.19.13",
"alwaysAddToPackageJson": false
},
"react": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"react-dom": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"react-test-renderer": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"@types/react": {
"version": "~18.3.12",
"alwaysAddToPackageJson": false
},
"@types/react-dom": {
"version": "~18.3.1",
"alwaysAddToPackageJson": false
},
"@testing-library/react-native": {
"version": "~12.9.0",
"alwaysAddToPackageJson": false
},
"react-native-svg-transformer": {
"version": "~1.5.0",
"alwaysAddToPackageJson": false
},
"react-native-svg": {
"version": "~15.8.0",
"alwaysAddToPackageJson": false
},
"react-native-svg-web": {
"version": "~1.0.9",
"addToPackageJson": "devDependencies"
},
"@babel/runtime": {
"version": "~7.26.0",
"alwaysAddToPackageJson": false
}
}
}
}
}

View File

@ -3,7 +3,7 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'

View File

@ -8,13 +8,13 @@ apply plugin: "com.facebook.react"
*/
react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is <%= offsetFromRoot %>../../node_modules/react-native
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
reactNativeDir = file("<%= offsetFromRoot %>../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is <%= offsetFromRoot %>../../node_modules/@react-native/codegen
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
codegenDir = file("<%= offsetFromRoot %>../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is <%= offsetFromRoot %>../../node_modules/react-native/cli.js
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
cliFile = file("<%= offsetFromRoot %>../../node_modules/react-native/cli.js")
/* Variants */
@ -45,10 +45,13 @@ react {
/* Hermes Commands */
// The hermes compiler command to run. By default it is 'hermesc'
hermesCommand = "<%= offsetFromRoot %>node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
hermesCommand = "<%= offsetFromRoot %>../../node_modules/react-native/sdks/hermesc/%OS-BIN%/hermesc"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]
/* Autolinking */
autolinkLibrariesWithApp()
}
/**
@ -114,5 +117,3 @@ dependencies {
implementation jscFlavor
}
}
apply from: file("<%= offsetFromRoot %>../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

View File

@ -9,6 +9,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config">
<activity
android:name=".MainActivity"

View File

@ -9,17 +9,18 @@ import com.facebook.react.ReactPackage
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.soloader.SoLoader
class MainApplication : Application(), ReactApplication {
override val reactNativeHost: ReactNativeHost =
object : DefaultReactNativeHost(this) {
override fun getPackages(): List<ReactPackage> {
// Packages that cannot be autolinked yet can be added manually here, for example:
// packages.add(new MyReactNativePackage());
return PackageList(this).packages
}
override fun getPackages(): List<ReactPackage> =
PackageList(this).packages.apply {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
}
override fun getJSMainModuleName(): String = "src/main"
@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
override fun onCreate() {
super.onCreate()
SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load()

View File

@ -1,11 +1,11 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 34
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
kotlinVersion = "1.9.24"
}
repositories {
google()

View File

@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
@ -34,7 +32,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true
# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################

View File

@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum

View File

@ -1,4 +1,6 @@
pluginManagement { includeBuild("<%= offsetFromRoot %>../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
rootProject.name = '<%= className %>'
apply from: file("<%= offsetFromRoot %>../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('<%= offsetFromRoot %>../node_modules/@react-native/gradle-plugin')

View File

@ -38,6 +38,8 @@ export default defineConfig({
extensions,
alias: {
'react-native': 'react-native-web',
'react-native-svg': 'react-native-svg-web',
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry/index',
},
},
build: {

View File

@ -6,6 +6,8 @@ module.exports = {
resolve: {
alias: {
'react-native$': 'react-native-web',
'react-native-svg': 'react-native-svg-web',
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry/index',
},
extensions: ['.web.tsx', '.web.ts', '.web.jsx', '.web.js']
},
@ -51,6 +53,8 @@ module.exports = composePlugins(
config.resolve.alias = {
...config.resolve.alias ?? {},
'react-native$': 'react-native-web',
'react-native-svg': 'react-native-svg-web',
'@react-native/assets-registry/registry': 'react-native-web/dist/modules/AssetRegistry/index',
};
config.resolve.extensions = [
'.web.tsx',

View File

@ -15,6 +15,7 @@ import { hasWebpackPlugin } from '@nx/react/src/utils/has-webpack-plugin';
import {
nxVersion,
reactNativeWebVersion,
reacttNativeSvgWebVersion,
typesReactDomVersion,
} from '../../utils/versions';
import { NormalizedSchema, normalizeSchema } from './lib/normalize-schema';
@ -49,6 +50,7 @@ export async function webConfigurationGenerator(
{},
{
'react-native-web': reactNativeWebVersion,
'react-native-svg-web': reacttNativeSvgWebVersion,
}
);
tasks.push(installTask);

View File

@ -12,7 +12,9 @@ import {
babelRuntimeVersion,
jestReactNativeVersion,
reactNativeBabelPresetVersion,
reactNativeCommunityCliVersion,
reactNativeCommunityCliPlatformAndroidVersion,
reactNativeCommunityCliPlatformIosVersion,
reactNativeMetroConfigVersion,
reactNativeSvgTransformerVersion,
reactNativeSvgVersion,
@ -36,8 +38,11 @@ export function ensureDependencies(tree: Tree): GeneratorCallback {
'@react-native/metro-config': reactNativeMetroConfigVersion,
'@testing-library/react-native': testingLibraryReactNativeVersion,
'@testing-library/jest-native': testingLibraryJestNativeVersion,
'@react-native-community/cli': reactNativeCommunityCliVersion,
'@react-native-community/cli-platform-android':
reactNativeCommunityCliPlatformAndroidVersion,
'@react-native-community/cli-platform-ios':
reactNativeCommunityCliPlatformIosVersion,
'jest-react-native': jestReactNativeVersion,
'react-test-renderer': reactTestRendererVersion,
'react-native-svg-transformer': reactNativeSvgTransformerVersion,

View File

@ -1,27 +1,30 @@
export const nxVersion = require('../../package.json').version;
export const reactNativeVersion = '0.74.1';
export const reactNativeVersion = '~0.76.3';
export const typesNodeVersion = '18.16.9';
export const reactNativeCommunityCliPlatformAndroidVersion = '~13.6.6'; // anddroid refers files from this package
export const reactNativeCommunityCliVersion = '~15.0.1';
export const reactNativeCommunityCliPlatformAndroidVersion = '~15.0.1';
export const reactNativeCommunityCliPlatformIosVersion = '~15.0.1';
export const reactNativeBabelPresetVersion = '^0.74.83';
export const reactNativeMetroConfigVersion = '^0.74.83';
export const reactNativeWebVersion = '^0.19.11';
export const reactNativeBabelPresetVersion = '~0.76.3';
export const reactNativeMetroConfigVersion = '~0.76.3';
export const reactNativeWebVersion = '~0.19.13';
export const reactVersion = '18.2.0';
export const reactDomVersion = '18.2.0';
export const reactTestRendererVersion = '18.2.0';
export const typesReactVersion = '~18.2.45';
export const typesReactDomVersion = '18.3.0';
export const reactVersion = '~18.3.1';
export const reactDomVersion = '~18.3.1';
export const reactTestRendererVersion = '~18.3.1';
export const typesReactVersion = '~18.3.12';
export const typesReactDomVersion = '~18.3.1';
export const testingLibraryReactNativeVersion = '~12.5.0';
export const testingLibraryReactNativeVersion = '~12.9.0';
export const testingLibraryJestNativeVersion = '~5.4.3';
export const jestReactNativeVersion = '18.0.0';
export const reactNativeSvgTransformerVersion = '1.3.0';
export const reactNativeSvgVersion = '15.3.0';
export const reactNativeSvgTransformerVersion = '~1.5.0';
export const reactNativeSvgVersion = '~15.8.0';
export const reacttNativeSvgWebVersion = '~1.0.9';
export const babelRuntimeVersion = '7.24.5';
export const babelRuntimeVersion = '~7.26.0';