Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump react-native version to 0.69.0 #1484

Merged
merged 45 commits into from
Jun 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5d2b4ab
chore: TestsExample: set rn version to 0.69.0-rc.6 & react to 18.0.0
kkafar Jun 21, 2022
8d86531
chore: TestsExample: run yarn install (update yarn.lock)
kkafar Jun 21, 2022
29278a1
chore: TestsExample: change target min. iOS version
kkafar Jun 21, 2022
79d2205
chore: TestsExample: install pods
kkafar Jun 21, 2022
1e8d010
chore: TestsExample: update pbxproj file
kkafar Jun 21, 2022
db8323d
chore: FabricTestExample: bump react & react-native & other deps
kkafar Jun 21, 2022
bc49494
chore: FabricTestExample: update yarn.lock
kkafar Jun 21, 2022
e267c52
chore: FabricTestExample: change target min. iOS version to 12.4
kkafar Jun 21, 2022
2337fd7
chore: bump react, react-native versions in main package.json
kkafar Jun 21, 2022
2a0e423
chore: set RNS_RN_VERSION_MINOR flag for all targets
kkafar Jun 21, 2022
dfdad7b
fix: use mountingTransactionDidMount:withSurfaceTelemetry: instead of
kkafar Jun 21, 2022
3ce7cbf
chore: reinstall pods in FabricTestExample
kkafar Jun 21, 2022
137852a
chore: reinstall pods in TestsExample
kkafar Jun 21, 2022
554c290
chore: bump react & react-native versions in FabricExample
kkafar Jun 21, 2022
a42cfe8
chore: FabricExample: change target min. iOS version
kkafar Jun 21, 2022
1898538
chore: FabricExample: reinstall pods
kkafar Jun 21, 2022
0867c99
chore: bump gradlew wrapper version to 7.4.2 & kotlin plugin to 1.6.21
kkafar Jun 21, 2022
cff8c13
fix: change ... TODO
kkafar Jun 21, 2022
32bca22
chore: merge in main
kkafar Jun 23, 2022
c60f4ed
chore: 0.69.0 for FabricTestExample
kkafar Jun 23, 2022
9b12d3f
chore: 0.69.0 for FabricExample
kkafar Jun 23, 2022
7fd7f83
chore: 0.69.0 for TestsExample
kkafar Jun 23, 2022
af45598
chore: resign from detecting react-native version in podspec
kkafar Jun 23, 2022
39dff9e
chore: Fabric support from 0.69.0 onwards
kkafar Jun 23, 2022
f6521f4
chore: install pods in FabricTestExample
kkafar Jun 23, 2022
bd6e4a8
chore: add .xcode.env for FabricTestExample
kkafar Jun 23, 2022
92c7e94
chore: adjust AppDelegate for FabricTestExample
kkafar Jun 23, 2022
d14832c
chore: changes for Android (FabricTestExample)
kkafar Jun 23, 2022
61182c8
chore: version update for ruby & flow
kkafar Jun 23, 2022
293f5bf
chore: change call to mountingTransactionDidMount:withSurfaceTelemetry:
kkafar Jun 23, 2022
bb5f0af
chore: add patch for safe-area-context
kkafar Jun 23, 2022
af6b89a
chore: revert changes in /package.json
kkafar Jun 23, 2022
8a2976c
chore: take snapshot iff deleted screen has component name of "RNSScr…
kkafar Jun 23, 2022
a6636c0
chore: bump rngh version to 2.5.0
kkafar Jun 23, 2022
d66f5b6
chore: use folly_runtime (breaking?)
kkafar Jun 23, 2022
da59440
chore: run yarn install in main directory
kkafar Jun 23, 2022
3556f62
chore: update FabricExample
kkafar Jun 23, 2022
6d24475
chore: TestsExample: bump gesture-handler version to 2.5.0
kkafar Jun 24, 2022
d23e33d
chore: bump kotlinVersion in TestsExample to 1.6.21
kkafar Jun 24, 2022
88e8bc6
chore: TestsExample: bump flow version to 0.176.3
kkafar Jun 24, 2022
50b2bf1
chore: upgrade helper changes for TestsExample
kkafar Jun 24, 2022
cbd8c89
chore: bump reanimated version
kkafar Jun 24, 2022
8ed6e70
chore: bump reanimated to 3.0.0
kkafar Jun 24, 2022
ec63eec
chore: react-native-reanimated for 3.0.0-rc.0
kkafar Jun 24, 2022
1d7cb2e
chore: react-native-reanimated 3.0.0-rc.0 for TestsExample
kkafar Jun 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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