Skip to content

Commit 6f0dea1

Browse files
author
Christoph Pader
committed
upgrade RN
1 parent 388b3e6 commit 6f0dea1

File tree

15 files changed

+4225
-3231
lines changed

15 files changed

+4225
-3231
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ example/vendor/bundle/
4848
# Temporary files created by Metro to check the health of the file watcher
4949
example/.metro-health-check*
5050

51+
# testing
52+
example/coverage
53+
5154
# node.js
5255
#
5356
node_modules/

example/Gemfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,7 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby '>= 2.6.10'
55

6-
gem 'cocoapods', '>= 1.11.3'
6+
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7+
# bound in the template on Cocoapods with next React Native release.
8+
gem 'cocoapods', '>= 1.13', '< 1.15'
9+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

example/app.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
"name": "GraphExample",
3-
"displayName": "Graph Example"
2+
"name": "GraphExample"
43
}

example/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const path = require('path')
22
const pak = require('../package.json')
33

44
module.exports = {
5-
presets: ['module:metro-react-native-babel-preset'],
5+
presets: ['module:@react-native/babel-preset'],
66
plugins: [
77
[
88
'module-resolver',

example/ios/GraphExample.xcodeproj/project.pbxproj

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -428,11 +428,11 @@
428428
);
429429
inputPaths = (
430430
"${PODS_ROOT}/Target Support Files/Pods-GraphExample/Pods-GraphExample-resources.sh",
431-
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
431+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
432432
);
433433
name = "[CP] Copy Pods Resources";
434434
outputPaths = (
435-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
435+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
436436
);
437437
runOnlyForDeploymentPostprocessing = 0;
438438
shellPath = /bin/sh;
@@ -470,11 +470,11 @@
470470
);
471471
inputPaths = (
472472
"${PODS_ROOT}/Target Support Files/Pods-GraphExample-GraphExampleTests/Pods-GraphExample-GraphExampleTests-resources.sh",
473-
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/AccessibilityResources.bundle",
473+
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
474474
);
475475
name = "[CP] Copy Pods Resources";
476476
outputPaths = (
477-
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AccessibilityResources.bundle",
477+
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
478478
);
479479
runOnlyForDeploymentPostprocessing = 0;
480480
shellPath = /bin/sh;
@@ -794,7 +794,7 @@
794794
buildSettings = {
795795
ALWAYS_SEARCH_USER_PATHS = NO;
796796
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
797-
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
797+
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
798798
CLANG_CXX_LIBRARY = "libc++";
799799
CLANG_ENABLE_MODULES = YES;
800800
CLANG_ENABLE_OBJC_ARC = YES;
@@ -846,8 +846,15 @@
846846
);
847847
MTL_ENABLE_DEBUG_INFO = YES;
848848
ONLY_ACTIVE_ARCH = YES;
849+
OTHER_CFLAGS = "$(inherited)";
850+
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
851+
OTHER_LDFLAGS = (
852+
"$(inherited)",
853+
" ",
854+
);
849855
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
850856
SDKROOT = iphoneos;
857+
USE_HERMES = true;
851858
};
852859
name = Debug;
853860
};
@@ -856,7 +863,7 @@
856863
buildSettings = {
857864
ALWAYS_SEARCH_USER_PATHS = NO;
858865
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
859-
CLANG_CXX_LANGUAGE_STANDARD = "c++14";
866+
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
860867
CLANG_CXX_LIBRARY = "libc++";
861868
CLANG_ENABLE_MODULES = YES;
862869
CLANG_ENABLE_OBJC_ARC = YES;
@@ -900,8 +907,15 @@
900907
"\"$(inherited)\"",
901908
);
902909
MTL_ENABLE_DEBUG_INFO = NO;
910+
OTHER_CFLAGS = "$(inherited)";
911+
OTHER_CPLUSPLUSFLAGS = "$(inherited)";
912+
OTHER_LDFLAGS = (
913+
"$(inherited)",
914+
" ",
915+
);
903916
REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native";
904917
SDKROOT = iphoneos;
918+
USE_HERMES = true;
905919
VALIDATE_PRODUCT = YES;
906920
};
907921
name = Release;

example/ios/GraphExample/AppDelegate.mm

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1515
}
1616

1717
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18+
{
19+
return [self getBundleURL];
20+
}
21+
22+
- (NSURL *)getBundleURL
1823
{
1924
#if DEBUG
2025
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];
@@ -23,14 +28,4 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
2328
#endif
2429
}
2530

26-
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
27-
///
28-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
29-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
30-
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
31-
- (BOOL)concurrentRootEnabled
32-
{
33-
return true;
34-
}
35-
3631
@end

example/ios/GraphExample/Info.plist

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,11 @@
2828
<dict>
2929
<key>NSAllowsArbitraryLoads</key>
3030
<true />
31-
<key>NSExceptionDomains</key>
32-
<dict>
33-
<key>localhost</key>
34-
<dict>
35-
<key>NSExceptionAllowsInsecureHTTPLoads</key>
36-
<true />
37-
</dict>
38-
</dict>
31+
<!-- Do not change NSAllowsArbitraryLoads to true, or you will risk app rejection! -->
32+
<key>NSAllowsArbitraryLoads</key>
33+
<false />
34+
<key>NSAllowsLocalNetworking</key>
35+
<true />
3936
</dict>
4037
<key>NSLocationWhenInUseUsageDescription</key>
4138
<string></string>

example/ios/Podfile

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
require_relative '../node_modules/react-native/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
1+
# Resolve react_native_pods.rb with node to allow for hoisting
2+
require Pod::Executable.execute_command('node', ['-p',
3+
'require.resolve(
4+
"react-native/scripts/react_native_pods.rb",
5+
{paths: [process.argv[1]]},
6+
)', __dir__]).strip
37

48
platform :ios, min_ios_version_supported
59
prepare_react_native_project!
@@ -24,16 +28,8 @@ end
2428
target 'GraphExample' do
2529
config = use_native_modules!
2630

27-
# Flags change depending on the env values.
28-
flags = get_default_flags()
29-
3031
use_react_native!(
3132
:path => config[:reactNativePath],
32-
# Hermes is now enabled by default. Disable by setting this flag to false.
33-
# Upcoming versions of React Native may rely on get_default_flags(), but
34-
# we make it explicit here to aid in the React Native upgrade process.
35-
:hermes_enabled => flags[:hermes_enabled],
36-
:fabric_enabled => flags[:fabric_enabled],
3733
# Enables Flipper.
3834
#
3935
# Note that if you have use_frameworks! enabled, Flipper will not work and
@@ -49,12 +45,11 @@ target 'GraphExample' do
4945
end
5046

5147
post_install do |installer|
48+
# https://github.com/facebook/react-native/blob/main/packages/react-native/scripts/react_native_pods.rb#L197-L202
5249
react_native_post_install(
5350
installer,
54-
# Set `mac_catalyst_enabled` to `true` in order to apply patches
55-
# necessary for Mac Catalyst builds
51+
config[:reactNativePath],
5652
:mac_catalyst_enabled => false
5753
)
58-
__apply_Xcode_12_5_M1_post_install_workaround(installer)
5954
end
6055
end

0 commit comments

Comments
 (0)