Skip to content

Commit d5ef36a

Browse files
committed
chore: react native 69 and react 18
1 parent 7f22daa commit d5ef36a

16 files changed

Lines changed: 5265 additions & 3857 deletions

File tree

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23+
ios/.xcode.env.local
2324

2425
# Android/IntelliJ
2526
#
@@ -52,9 +53,10 @@ buck-out/
5253
# For more information about the recommended setup visit:
5354
# https://docs.fastlane.tools/best-practices/source-control/
5455

55-
*/fastlane/report.xml
56-
*/fastlane/Preview.html
57-
*/fastlane/screenshots
56+
**/fastlane/report.xml
57+
**/fastlane/Preview.html
58+
**/fastlane/screenshots
59+
**/fastlane/test_output
5860

5961
# Bundle artifact
6062
*.jsbundle

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.7.4
1+
2.7.5

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '2.7.4'
4+
ruby '2.7.5'
55

66
gem 'cocoapods', '~> 1.11', '>= 1.11.2'

android/app/build.gradle

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ apply plugin: "com.android.application"
22
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
33

44
import com.android.build.OutputFile
5-
import org.apache.tools.ant.taskdefs.condition.Os
65

76
project.ext.react = [
87
enableHermes: false, // clean and rebuild if changing
@@ -49,17 +48,13 @@ android {
4948
"GENERATED_SRC_DIR=$buildDir/generated/source",
5049
"PROJECT_BUILD_DIR=$buildDir",
5150
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
52-
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
51+
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
52+
"NODE_MODULES_DIR=$rootDir/../node_modules"
5353
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
5454
cppFlags "-std=c++17"
5555
// Make sure this target name is the same you specify inside the
5656
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
5757
targets "rntypescriptboilerplate_appmodules"
58-
59-
// Fix for windows limit on number of character in file paths and in command lines
60-
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
61-
arguments "NDK_APP_SHORT_COMMANDS=true"
62-
}
6358
}
6459
}
6560
if (!enableSeparateBuildPerCPUArchitecture) {
@@ -188,9 +183,10 @@ dependencies {
188183
}
189184

190185
if (enableHermes) {
191-
def hermesPath = "../../node_modules/hermes-engine/android/";
192-
debugImplementation files(hermesPath + "hermes-debug.aar")
193-
releaseImplementation files(hermesPath + "hermes-release.aar")
186+
//noinspection GradleDynamicVersion
187+
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
188+
exclude group:'com.facebook.fbjni'
189+
}
194190
} else {
195191
implementation jscFlavor
196192
}
@@ -203,7 +199,11 @@ if (isNewArchitectureEnabled()) {
203199
configurations.all {
204200
resolutionStrategy.dependencySubstitution {
205201
substitute(module("com.facebook.react:react-native"))
206-
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
202+
.using(project(":ReactAndroid"))
203+
.because("On New Architecture we're building React Native from source")
204+
substitute(module("com.facebook.react:hermes-engine"))
205+
.using(project(":ReactAndroid:hermes-engine"))
206+
.because("On New Architecture we're building Hermes from source")
207207
}
208208
}
209209
}

android/app/src/main/java/com/rntypescriptboilerplate/MainActivity.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ protected String getMainComponentName() {
2222

2323
/**
2424
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
25-
* you can specify the rendered you wish to use (Fabric or the older renderer).
25+
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
26+
* (Paper).
2627
*/
2728
@Override
2829
protected ReactActivityDelegate createReactActivityDelegate() {
@@ -42,4 +43,11 @@ protected ReactRootView createRootView() {
4243
return reactRootView;
4344
}
4445
}
46+
47+
@Override
48+
protected boolean isConcurrentRootEnabled() {
49+
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
50+
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
51+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
52+
}
4553
}

android/app/src/main/java/com/rntypescriptboilerplate/newarchitecture/MainApplicationReactNativeHost.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public JSIModuleProvider<UIManager> getJSIModuleProvider() {
105105
return new FabricJSIModuleProvider(
106106
reactApplicationContext,
107107
componentFactory,
108-
new EmptyReactNativeConfig(),
108+
ReactNativeConfig.DEFAULT_CONFIG,
109109
viewManagerRegistry);
110110
}
111111
});

android/app/src/main/jni/Android.mk

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
2828
LOCAL_SHARED_LIBRARIES := \
2929
libfabricjni \
3030
libfbjni \
31-
libfolly_futures \
32-
libfolly_json \
31+
libfolly_runtime \
3332
libglog \
3433
libjsi \
3534
libreact_codegen_rncore \

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ buildscript {
2222
mavenCentral()
2323
}
2424
dependencies {
25-
classpath("com.android.tools.build:gradle:7.0.4")
25+
classpath("com.android.tools.build:gradle:7.1.1")
2626
classpath("com.facebook.react:react-native-gradle-plugin")
27-
classpath("de.undercouch:gradle-download-task:4.1.2")
27+
classpath("de.undercouch:gradle-download-task:5.0.1")
2828
// NOTE: Do not place your application dependencies here; they belong
2929
// in the individual module build.gradle files
3030
}

android/settings.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,6 @@ includeBuild('../node_modules/react-native-gradle-plugin')
66
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
77
include(":ReactAndroid")
88
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
9+
include(":ReactAndroid:hermes-engine")
10+
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
911
}

ios/.xcode.env

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# This `.xcode.env` file is versioned and is used to source the environment
2+
# used when running script phases inside Xcode.
3+
# To customize your local environment, you can create an `.xcode.env.local`
4+
# file that is not versioned.
5+
# NODE_BINARY variable contains the PATH to the node executable.
6+
#
7+
# Customize the NODE_BINARY variable here.
8+
# For example, to use nvm with brew, add the following line
9+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
10+
export NODE_BINARY=$(command -v node)

0 commit comments

Comments
 (0)