Skip to content

Commit 2c68dc2

Browse files
authored
feat: update to 0.69.0 (#276)
* feat: update to 0.69.0 closes #275 * chore: update README
1 parent efd4e07 commit 2c68dc2

File tree

15 files changed

+90
-40
lines changed

15 files changed

+90
-40
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ See the below table to find out which version of the template to use.
4343

4444
| React Native | Template |
4545
| ------------ | -------- |
46+
| 0.69 | 6.11.\* |
4647
| 0.68 | 6.10.\* |
4748
| 0.67 | 6.9.\* |
4849
| 0.66 | 6.8.\* |

Diff for: template/Gemfile

+1-1
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'

Diff for: template/_gitignore

+5-3
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
#
@@ -49,9 +50,10 @@ buck-out/
4950
# For more information about the recommended setup visit:
5051
# https://docs.fastlane.tools/best-practices/source-control/
5152

52-
*/fastlane/report.xml
53-
*/fastlane/Preview.html
54-
*/fastlane/screenshots
53+
**/fastlane/report.xml
54+
**/fastlane/Preview.html
55+
**/fastlane/screenshots
56+
**/fastlane/test_output
5557

5658
# Bundle artifact
5759
*.jsbundle

Diff for: template/android/app/build.gradle

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apply plugin: "com.android.application"
22

33
import com.android.build.OutputFile
4-
import org.apache.tools.ant.taskdefs.condition.Os
54

65
/**
76
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -152,17 +151,13 @@ android {
152151
"GENERATED_SRC_DIR=$buildDir/generated/source",
153152
"PROJECT_BUILD_DIR=$buildDir",
154153
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
155-
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
154+
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
155+
"NODE_MODULES_DIR=$rootDir/../node_modules"
156156
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
157157
cppFlags "-std=c++17"
158158
// Make sure this target name is the same you specify inside the
159159
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
160160
targets "helloworld_appmodules"
161-
162-
// Fix for windows limit on number of character in file paths and in command lines
163-
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
164-
arguments "NDK_APP_SHORT_COMMANDS=true"
165-
}
166161
}
167162
}
168163
if (!enableSeparateBuildPerCPUArchitecture) {
@@ -282,9 +277,10 @@ dependencies {
282277
}
283278

284279
if (enableHermes) {
285-
def hermesPath = "../../node_modules/hermes-engine/android/";
286-
debugImplementation files(hermesPath + "hermes-debug.aar")
287-
releaseImplementation files(hermesPath + "hermes-release.aar")
280+
//noinspection GradleDynamicVersion
281+
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
282+
exclude group:'com.facebook.fbjni'
283+
}
288284
} else {
289285
implementation jscFlavor
290286
}
@@ -297,7 +293,11 @@ if (isNewArchitectureEnabled()) {
297293
configurations.all {
298294
resolutionStrategy.dependencySubstitution {
299295
substitute(module("com.facebook.react:react-native"))
300-
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
296+
.using(project(":ReactAndroid"))
297+
.because("On New Architecture we're building React Native from source")
298+
substitute(module("com.facebook.react:hermes-engine"))
299+
.using(project(":ReactAndroid:hermes-engine"))
300+
.because("On New Architecture we're building Hermes from source")
301301
}
302302
}
303303
}

Diff for: template/android/app/src/main/java/com/helloworld/MainActivity.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ protected String getMainComponentName() {
1717

1818
/**
1919
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
20-
* you can specify the rendered you wish to use (Fabric or the older renderer).
20+
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
21+
* (Paper).
2122
*/
2223
@Override
2324
protected ReactActivityDelegate createReactActivityDelegate() {
@@ -36,5 +37,12 @@ protected ReactRootView createRootView() {
3637
reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED);
3738
return reactRootView;
3839
}
40+
41+
@Override
42+
protected boolean isConcurrentRootEnabled() {
43+
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
44+
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
45+
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
46+
}
3947
}
4048
}

Diff for: template/android/app/src/main/java/com/helloworld/newarchitecture/MainApplicationReactNativeHost.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
import com.facebook.react.bridge.UIManager;
1717
import com.facebook.react.fabric.ComponentFactory;
1818
import com.facebook.react.fabric.CoreComponentsRegistry;
19-
import com.facebook.react.fabric.EmptyReactNativeConfig;
2019
import com.facebook.react.fabric.FabricJSIModuleProvider;
20+
import com.facebook.react.fabric.ReactNativeConfig;
2121
import com.facebook.react.uimanager.ViewManagerRegistry;
2222
import com.helloworld.BuildConfig;
2323
import com.helloworld.newarchitecture.components.MainComponentsRegistry;
@@ -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
});

Diff for: template/android/app/src/main/jni/Android.mk

+2-3
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp)
1717
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
1818

1919
# If you wish to add a custom TurboModule or Fabric component in your app you
20-
# will have to uncomment those lines to include the generated source
20+
# will have to uncomment those lines to include the generated source
2121
# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
2222
#
2323
# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
@@ -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 \

Diff for: template/android/build.gradle

+2-2
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
}

Diff for: template/android/settings.gradle

+2
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
}

Diff for: template/ios/HelloWorld.xcodeproj/project.pbxproj

+7-5
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,15 @@
256256
files = (
257257
);
258258
inputPaths = (
259+
"$(SRCROOT)/.xcode.env.local",
260+
"$(SRCROOT)/.xcode.env",
259261
);
260262
name = "Bundle React Native code and images";
261263
outputPaths = (
262264
);
263265
runOnlyForDeploymentPostprocessing = 0;
264266
shellPath = /bin/sh;
265-
shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
267+
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
266268
};
267269
00EEFC60759A1932668264C0 /* [CP] Embed Pods Frameworks */ = {
268270
isa = PBXShellScriptBuildPhase;
@@ -436,7 +438,7 @@
436438
"$(inherited)",
437439
);
438440
INFOPLIST_FILE = HelloWorldTests/Info.plist;
439-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
441+
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
440442
LD_RUNPATH_SEARCH_PATHS = (
441443
"$(inherited)",
442444
"@executable_path/Frameworks",
@@ -460,7 +462,7 @@
460462
BUNDLE_LOADER = "$(TEST_HOST)";
461463
COPY_PHASE_STRIP = NO;
462464
INFOPLIST_FILE = HelloWorldTests/Info.plist;
463-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
465+
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
464466
LD_RUNPATH_SEARCH_PATHS = (
465467
"$(inherited)",
466468
"@executable_path/Frameworks",
@@ -576,7 +578,7 @@
576578
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
577579
GCC_WARN_UNUSED_FUNCTION = YES;
578580
GCC_WARN_UNUSED_VARIABLE = YES;
579-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
581+
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
580582
LD_RUNPATH_SEARCH_PATHS = (
581583
/usr/lib/swift,
582584
"$(inherited)",
@@ -640,7 +642,7 @@
640642
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
641643
GCC_WARN_UNUSED_FUNCTION = YES;
642644
GCC_WARN_UNUSED_VARIABLE = YES;
643-
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
645+
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
644646
LD_RUNPATH_SEARCH_PATHS = (
645647
/usr/lib/swift,
646648
"$(inherited)",

Diff for: template/ios/HelloWorld/AppDelegate.mm

+26-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
#import <react/config/ReactNativeConfig.h>
1818

19+
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
20+
1921
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
2022
RCTTurboModuleManager *_turboModuleManager;
2123
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
@@ -41,7 +43,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
4143
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
4244
#endif
4345

44-
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"HelloWorld", nil);
46+
NSDictionary *initProps = [self prepareInitialProps];
47+
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"HelloWorld", initProps);
4548

4649
if (@available(iOS 13.0, *)) {
4750
rootView.backgroundColor = [UIColor systemBackgroundColor];
@@ -57,6 +60,28 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
5760
return YES;
5861
}
5962

63+
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
64+
///
65+
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
66+
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
67+
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
68+
- (BOOL)concurrentRootEnabled
69+
{
70+
// Switch this bool to turn on and off the concurrent root
71+
return true;
72+
}
73+
74+
- (NSDictionary *)prepareInitialProps
75+
{
76+
NSMutableDictionary *initProps = [NSMutableDictionary new];
77+
78+
#ifdef RCT_NEW_ARCH_ENABLED
79+
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
80+
#endif
81+
82+
return initProps;
83+
}
84+
6085
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
6186
{
6287
#if DEBUG

Diff for: template/ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
require_relative '../node_modules/react-native/scripts/react_native_pods'
22
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
33

4-
platform :ios, '11.0'
4+
platform :ios, '12.4'
55
install! 'cocoapods', :deterministic_uuids => false
66

77
target 'HelloWorld' do

Diff for: template/ios/_xcode.env

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
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+
6+
# NODE_BINARY variable contains the PATH to the node executable.
7+
#
8+
# Customize the NODE_BINARY variable here.
9+
# For example, to use nvm with brew, add the following line
10+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
11+
export NODE_BINARY=$(command -v node)

Diff for: template/package.json

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,27 @@
1010
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
1111
},
1212
"dependencies": {
13-
"react": "17.0.2",
14-
"react-native": "0.68.2"
13+
"react": "18.0.0",
14+
"react-native": "0.69.0"
1515
},
1616
"devDependencies": {
1717
"@babel/core": "^7.12.9",
1818
"@babel/runtime": "^7.12.5",
1919
"@react-native-community/eslint-config": "^2.0.0",
2020
"@types/jest": "^26.0.23",
21-
"@types/react-native": "^0.67.3",
22-
"@types/react-test-renderer": "^17.0.1",
23-
"@typescript-eslint/eslint-plugin": "^5.17.0",
24-
"@typescript-eslint/parser": "^5.17.0",
21+
"@types/react-native": "^0.68.0",
22+
"@types/react-test-renderer": "^18.0.0",
23+
"@typescript-eslint/eslint-plugin": "^5.29.0",
24+
"@typescript-eslint/parser": "^5.29.0",
2525
"babel-jest": "^26.6.3",
2626
"eslint": "^7.32.0",
2727
"jest": "^26.6.3",
28-
"metro-react-native-babel-preset": "^0.67.0",
29-
"react-test-renderer": "17.0.2",
28+
"metro-react-native-babel-preset": "^0.70.3",
29+
"react-test-renderer": "18.0.0",
3030
"typescript": "^4.4.4"
3131
},
3232
"resolutions": {
33-
"@types/react": "^17"
33+
"@types/react": "^18"
3434
},
3535
"jest": {
3636
"preset": "react-native",

Diff for: template/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
/* Language and Environment */
1515
"target": "esnext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
16-
"lib": ["es2017"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16+
"lib": ["es2019"], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
1717
"jsx": "react-native", /* Specify what JSX code is generated. */
1818
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
1919
// "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */

0 commit comments

Comments
 (0)