Skip to content

Commit

Permalink
chore: bump react-native version to 0.69.0 (#1484)
Browse files Browse the repository at this point in the history
* chore: TestsExample: set rn version to 0.69.0-rc.6 & react to 18.0.0

see https://react-native-community.github.io/upgrade-helper/?from=0.68.2&to=0.69.0-rc.6

* chore: TestsExample: run yarn install (update yarn.lock)

* chore: TestsExample: change target min. iOS version

see https://react-native-community.github.io/upgrade-helper/?from=0.68.2&to=0.69.0-rc.6

With lower version there are some dependency issues causing pod install
to fail (thats the visible efect, but there are some headers missing I
    guess)

* chore: TestsExample: install pods

* chore: TestsExample: update pbxproj file

* chore: FabricTestExample: bump react & react-native & other deps
versions

* chore: FabricTestExample: update yarn.lock

* chore: FabricTestExample: change target min. iOS version to 12.4

* chore: bump react, react-native versions in main package.json

* chore: set RNS_RN_VERSION_MINOR flag for all targets

* fix: use mountingTransactionDidMount:withSurfaceTelemetry: instead of
mountingTransationWillMountWithMetadata: for react-native minor version
>= 69

See: facebook/react-native@91fc2c0

* chore: reinstall pods in FabricTestExample

* chore: reinstall pods in TestsExample

* chore: bump react & react-native versions in FabricExample

* chore: FabricExample: change target min. iOS version

* chore: FabricExample: reinstall pods

* chore: bump gradlew wrapper version to 7.4.2 & kotlin plugin to 1.6.21

* fix: change ... TODO

* chore: 0.69.0 for FabricTestExample

* chore: 0.69.0 for FabricExample

* chore: 0.69.0 for TestsExample

* chore: resign from detecting react-native version in podspec

* chore: Fabric support from 0.69.0 onwards

* chore: install pods in FabricTestExample

* chore: add .xcode.env for FabricTestExample

* chore: adjust AppDelegate for FabricTestExample

* chore: changes for Android (FabricTestExample)

* chore: version update for ruby & flow

* chore: change call to mountingTransactionDidMount:withSurfaceTelemetry:
to mountingTransactionDidMount

* chore: add patch for safe-area-context

* chore: revert changes in /package.json

* chore: take snapshot iff deleted screen has component name of "RNSScreen"

* chore: bump rngh version to 2.5.0

* chore: use folly_runtime (breaking?)

This is potentially breaking for Paper!!!

* chore: run yarn install in main directory

* chore: update FabricExample

* chore: TestsExample: bump gesture-handler version to 2.5.0

* chore: bump kotlinVersion in TestsExample to 1.6.21

* chore: TestsExample: bump flow version to 0.176.3

* chore: upgrade helper changes for TestsExample

* chore: bump reanimated version

* chore: bump reanimated to 3.0.0

* chore: react-native-reanimated for 3.0.0-rc.0

* chore: react-native-reanimated 3.0.0-rc.0 for TestsExample
  • Loading branch information
kkafar committed Jun 24, 2022
1 parent a10bb81 commit 166d60c
Show file tree
Hide file tree
Showing 58 changed files with 3,390 additions and 3,146 deletions.
2 changes: 1 addition & 1 deletion FabricExample/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ untyped-import
untyped-type-import

[version]
^0.168.0
^0.176.3
8 changes: 5 additions & 3 deletions FabricExample/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local

# Android/IntelliJ
#
Expand Down Expand Up @@ -49,9 +50,10 @@ buck-out/
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output

# Bundle artifact
*.jsbundle
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.0'
ruby '2.7.5'

gem 'cocoapods', '~> 1.11', '>= 1.11.2'
2 changes: 1 addition & 1 deletion FabricExample/_ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
2.7.5
10 changes: 6 additions & 4 deletions FabricExample/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ android {
"GENERATED_SRC_DIR=$buildDir/generated/source",
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
"NODE_MODULES_DIR=$rootDir/../node_modules"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
Expand Down Expand Up @@ -270,9 +271,10 @@ dependencies {
}

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
//noinspection GradleDynamicVersion
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
exclude group:'com.facebook.fbjni'
}
} else {
implementation jscFlavor
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,21 @@ protected String getMainComponentName() {

/**
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
* you can specify the rendered you wish to use (Fabric or the older renderer).
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
* (Paper).
*/
@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new MainActivityDelegate(this, getMainComponentName());
}

@Override
protected boolean isConcurrentRootEnabled() {
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
}

public static class MainActivityDelegate extends ReactActivityDelegate {
public MainActivityDelegate(ReactActivity activity, String mainComponentName) {
super(activity, mainComponentName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.facebook.react.fabric.ComponentFactory;
import com.facebook.react.fabric.CoreComponentsRegistry;
import com.facebook.react.fabric.EmptyReactNativeConfig;
import com.facebook.react.fabric.ReactNativeConfig;
import com.facebook.react.fabric.FabricJSIModuleProvider;
import com.facebook.react.uimanager.ViewManagerRegistry;
import com.fabricexample.BuildConfig;
Expand Down Expand Up @@ -106,7 +107,7 @@ public JSIModuleProvider<UIManager> getJSIModuleProvider() {
return new FabricJSIModuleProvider(
reactApplicationContext,
componentFactory,
new EmptyReactNativeConfig(),
ReactNativeConfig.DEFAULT_CONFIG,
viewManagerRegistry);
}
});
Expand Down
3 changes: 1 addition & 2 deletions FabricExample/android/app/src/main/jni/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
LOCAL_SHARED_LIBRARIES := \
libfabricjni \
libfbjni \
libfolly_futures \
libfolly_json \
libfolly_runtime \
libglog \
libjsi \
libreact_codegen_rncore \
Expand Down
4 changes: 2 additions & 2 deletions FabricExample/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.0.1")
classpath("com.android.tools.build:gradle:7.1.1")
classpath("com.facebook.react:react")
classpath("de.undercouch:gradle-download-task:4.1.1")
classpath("de.undercouch:gradle-download-task:5.0.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down
2 changes: 2 additions & 0 deletions FabricExample/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,6 @@ includeBuild('../node_modules/react-native-gradle-plugin') {
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
include(":ReactAndroid")
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
include(":ReactAndroid:hermes-engine")
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
}
11 changes: 11 additions & 0 deletions FabricExample/ios/.xcode.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

# This `.xcode.env` file is versioned and is used to source the environment
# used when running script phases inside Xcode.
# To customize your local environment, you can create an `.xcode.env.local`
# file that is not versioned.
# NODE_BINARY variable contains the PATH to the node executable.
#
# Customize the NODE_BINARY variable here.
# For example, to use nvm with brew, add the following line
# . "$(brew --prefix nvm)/nvm.sh" --no-use
export NODE_BINARY=$(command -v node)
2 changes: 2 additions & 0 deletions FabricExample/ios/FabricExample.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
};
name = Debug;
Expand Down Expand Up @@ -657,6 +658,7 @@
"-DFOLLY_MOBILE=1",
"-DFOLLY_USE_LIBCPP=1",
);
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
Expand Down
25 changes: 24 additions & 1 deletion FabricExample/ios/FabricExample/AppDelegate.mm
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

#import <react/config/ReactNativeConfig.h>

static NSString *const kRNConcurrentRoot = @"concurrentRoot";


@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
RCTTurboModuleManager *_turboModuleManager;
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
Expand All @@ -41,7 +44,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
#endif

UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"FabricExample", nil);
NSDictionary *initProps = [self prepareInitialProps];
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"FabricExample", initProps);

if (@available(iOS 13.0, *)) {
rootView.backgroundColor = [UIColor systemBackgroundColor];
Expand All @@ -57,6 +61,25 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
return YES;
}

/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
///
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
- (BOOL)concurrentRootEnabled
{
// Switch this bool to turn on and off the concurrent root
return true;
}
- (NSDictionary *)prepareInitialProps
{
NSMutableDictionary *initProps = [NSMutableDictionary new];
#ifdef RCT_NEW_ARCH_ENABLED
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
#endif
return initProps;
}

- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
{
#if DEBUG
Expand Down
2 changes: 1 addition & 1 deletion FabricExample/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
require_relative '../node_modules/react-native/scripts/react_native_pods'
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'

platform :ios, '11.0'
platform :ios, '12.4'
install! 'cocoapods', :deterministic_uuids => false

ENV['RCT_NEW_ARCH_ENABLED'] = '1'
Expand Down
Loading

0 comments on commit 166d60c

Please sign in to comment.