Skip to content

Commit

Permalink
Upgrade to react-native 0.66 (#15914)
Browse files Browse the repository at this point in the history
# Why

follow up #15817 (comment)
after we use the react-native from npm, the react-native version we used in expo-go is decoupled with other stuffs. that makes us upgrade react-native easier.

# How

1. update versions in package.json
2. sync changes from [react-native-upgrade-helper](https://react-native-community.github.io/upgrade-helper/?from=0.64.2&to=0.66.4)
3. `RCTComponentData` changed its designated initializer in react-native 0.65. to make it compatible with older version, i introduced the `EXComponentDataCompatibleWrapper` class to support different versions.
4. [react-native-lab] to fix expo-go build error, we should patch react-native to use the codegen library from its repo but not from node_modules:  expo/react-native#29.

# Test Plan

- CI passed
- bare-expo build & launch test
- unversioned expo-go build & launch test
  • Loading branch information
Kudo committed Jan 20, 2022
1 parent c7467b0 commit 402679c
Show file tree
Hide file tree
Showing 49 changed files with 848 additions and 733 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ buildscript {
compileSdkVersion = 30

dbFlowVersion = '4.2.4'
buildToolsVersion = '30.0.5'
buildToolsVersion = '30.0.2'
supportLibVersion = '29.0.0'
kotlinVersion = '1.6.10'
gradlePluginVersion = '4.1.2'
Expand Down
26 changes: 18 additions & 8 deletions apps/bare-expo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -123,16 +123,16 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false)

/**
* Architectures to build native code for in debug.
*/
def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures")

android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId 'dev.expo.payments'
minSdkVersion rootProject.ext.minSdkVersion
Expand Down Expand Up @@ -168,6 +168,11 @@ android {
buildTypes {
debug {
signingConfig signingConfigs.debug
if (nativeArchitectures) {
ndk {
abiFilters nativeArchitectures.split(',')
}
}
}
release {
// Caution! In production, you need to generate your own keystore file.
Expand Down Expand Up @@ -211,11 +216,16 @@ dependencies {
}

// Flipper
implementation('com.facebook.flipper:flipper:0.62.0') {
implementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
}

implementation('com.facebook.flipper:flipper-network-plugin:0.62.0') {
implementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

implementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
}

Expand All @@ -232,7 +242,7 @@ dependencies {
// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

Expand Down
4 changes: 2 additions & 2 deletions apps/bare-expo/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import groovy.json.JsonSlurper

buildscript {
ext {
buildToolsVersion = "30.0.5"
gradlePluginVersion = '4.1.2'
buildToolsVersion = "30.0.2"
gradlePluginVersion = '4.2.2'
minSdkVersion = 21
compileSdkVersion = 30
targetSdkVersion = 30
Expand Down
3 changes: 3 additions & 0 deletions apps/bare-expo/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true

# Version of flipper SDK to use with React Native
FLIPPER_VERSION=0.99.0

# The hosted JavaScript engine
# Supported values: expo.jsEngine = "hermes" | "jsc"
expo.jsEngine=hermes
4 changes: 2 additions & 2 deletions apps/bare-expo/ios/BareExpo.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion apps/bare-expo/ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ abstract_target 'BareExpoMain' do

# Fix Google Sign-in and Flipper
post_install do |installer|
# `installer.pod_project` might be nil for `incremental_installation: true` and no new project generated
# `installer.pods_project` might be nil for `incremental_installation: true` and no new project generated
react_native_post_install(installer) if installer.pods_project
__apply_Xcode_12_5_M1_post_install_workaround(installer) if installer.pods_project

installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result|
target_installation_result.native_target.build_configurations.each do |config|
Expand Down

0 comments on commit 402679c

Please sign in to comment.