Skip to content

Commit

Permalink
feat(expo): upgrade Expo to v52 (#29142)
Browse files Browse the repository at this point in the history
<!-- 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 <[email protected]>
  • Loading branch information
xiongemi and hassankhan authored Dec 12, 2024
1 parent cfcd4d1 commit a0f4260
Show file tree
Hide file tree
Showing 21 changed files with 252 additions and 65 deletions.
13 changes: 13 additions & 0 deletions packages/detox/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
}
4 changes: 2 additions & 2 deletions packages/detox/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -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
77 changes: 77 additions & 0 deletions packages/expo/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
}
4 changes: 2 additions & 2 deletions packages/expo/src/executors/install/install.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export async function installAndUpdatePackageJson(

await installAsync(
packages,
createInstallOptions({
{
fix: options.fix,
check: options.check,
}),
},
createInstallOptions({ force: options.force })
);

Expand Down
36 changes: 18 additions & 18 deletions packages/expo/src/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -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';
73 changes: 73 additions & 0 deletions packages/react-native/migrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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()
}

/**
Expand Down Expand Up @@ -114,5 +117,3 @@ dependencies {
implementation jscFlavor
}
}

apply from: file("<%= offsetFromRoot %>../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##########################################################################
Expand Down
Loading

0 comments on commit a0f4260

Please sign in to comment.