Skip to content

Commit 7dfdce0

Browse files
React Native 0.80 support (#8161)
* initial commit * AppDelegate updates * RNNAppDelegate update * RNNAppDelegate update * update scripts * sim updates * podspec update * Upgraded to latest version React Native * Added new pipelines * Added new pipelines * Disable autolink test * device downgrade * Disabled tests * script update * Rename .java to .kt * Fixed roboletric tests * update scripts * Reenable tests * update scripts * update podspec * and again * cleanup * headers for tests to run in xcode * test updates to aline with iOS 18 * podspec update * reanimated update for RN0.79 * link test update for iOS * android linker test templates added * snapshot update for linker test * update for linnker test and podspec * remove old snap test * Documentation update * update in docs * Better documentation * RN80 * Fixed android rn 0.80 * cleanup * Fixed ios builds for rn 80 * Added rn 80 pipelines * Fixed docs * Fixed android test * Fixed react test renderer version * Fixed kotlin version selection for different react native versions * Fixed podspec to support swift * Fixed podspec to support swift --------- Co-authored-by: Mark de Vocht <[email protected]> Co-authored-by: mark.dev <[email protected]>
1 parent c0d09a5 commit 7dfdce0

File tree

18 files changed

+729
-779
lines changed

18 files changed

+729
-779
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
- label: ":android: Android (RN 0.80.0)"
2+
env:
3+
JAVA_HOME: /opt/openjdk/jdk-17.0.9.jdk/Contents/Home/
4+
REACT_NATIVE_VERSION: 0.80.0
5+
command:
6+
- "nvm install"
7+
- "./scripts/ci.android.sh"
8+
key: "android_rn_80"
9+
timeout_in_minutes: 90
10+
artifact_paths: "/Users/builder/uibuilder/work/playground/artifacts/**/*"
11+
12+
13+
14+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
- label: ":ios: iOS (RN 0.80.0)"
2+
env:
3+
REACT_NATIVE_VERSION: 0.80.0
4+
command:
5+
- "nvm install"
6+
- "./scripts/ci.ios.sh"
7+
key: "ios_rn_80"
8+
timeout_in_minutes: 90
9+
artifact_paths: "/Users/builder/uibuilder/work/playground/artifacts/**/*"
10+
11+
12+
13+

.buildkite/pipeline.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ cat .buildkite/jobs/pipeline.release.yml
66
cat .buildkite/jobs/pipeline.android_rn_77.yml
77
cat .buildkite/jobs/pipeline.android_rn_78.yml
88
cat .buildkite/jobs/pipeline.android_rn_79.yml
9+
cat .buildkite/jobs/pipeline.android_rn_80.yml
910
cat .buildkite/jobs/pipeline.ios_rn_77.yml
1011
cat .buildkite/jobs/pipeline.ios_rn_78.yml
1112
cat .buildkite/jobs/pipeline.ios_rn_79.yml
13+
cat .buildkite/jobs/pipeline.ios_rn_80.yml
1214
cat .buildkite/jobs/pipeline.publish.yml
1315

1416

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,4 @@ Gemfile.lock
254254
!.yarn/sdks
255255
!.yarn/versions
256256

257+
/ios/ReactNativeVersionExtracted.h

ReactNativeNavigation.podspec

Lines changed: 23 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
require 'json'
22

33
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4-
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
4+
5+
folly_compiler_flags = folly_flags()
6+
use_hermes = ENV['USE_HERMES'] == nil || ENV['USE_HERMES'] == '1'
7+
use_hermes_flag = use_hermes ? "-DUSE_HERMES=1" : ""
58

69
Pod::Spec.new do |s|
710
s.name = "ReactNativeNavigation"
@@ -12,61 +15,33 @@ Pod::Spec.new do |s|
1215
s.authors = "Wix.com"
1316
s.homepage = package['homepage']
1417
s.license = package['license']
15-
s.platform = :ios, "11.0"
18+
s.platform = :ios, min_ios_version_supported
1619

1720
s.module_name = 'ReactNativeNavigation'
18-
s.default_subspec = 'Core'
19-
20-
s.subspec 'Core' do |ss|
21-
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
22-
s.source_files = 'ios/**/*.{h,m,mm,cpp}'
23-
s.exclude_files = "ios/ReactNativeNavigationTests/**/*.*", "ios/OCMock/**/*.*"
24-
25-
s.public_header_files = [
26-
'ios/RNNAppDelegate.h',
27-
'ios/ReactNativeVersionExtracted.h'
28-
]
29-
end
3021

31-
folly_compiler_flags = '-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1 -Wno-comma -Wno-shorten-64-to-32 -DFOLLY_CFG_NO_COROUTINES=1'
22+
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
23+
s.source_files = 'ios/**/*.{h,m,mm,cpp}'
24+
s.exclude_files = "ios/ReactNativeNavigationTests/**/*.*", "ios/OCMock/**/*.*"
3225

33-
# Base xcconfig settings
34-
xcconfig_settings = {
35-
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/boost" "$(PODS_ROOT)/boost-for-react-native" "$(PODS_ROOT)/RCT-Folly" "$(PODS_ROOT)/Headers/Private/React-Core" "$(PODS_ROOT)/Headers/Private/Yoga"',
36-
"CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
37-
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
38-
}
26+
s.public_header_files = [
27+
'ios/RNNAppDelegate.h',
28+
'ios/ReactNativeVersionExtracted.h'
29+
]
3930

40-
xcconfig_settings["DEFINES_MODULE"] = "YES"
41-
42-
s.pod_target_xcconfig = xcconfig_settings
31+
# Add Folly compiler flags to prevent coroutines header issues
32+
# Add Hermes flag when using Hermes engine
33+
s.compiler_flags = "#{folly_compiler_flags} #{use_hermes_flag}"
4334

44-
if fabric_enabled
45-
install_modules_dependencies(s)
46-
47-
s.compiler_flags = folly_compiler_flags + ' ' + '-DRCT_NEW_ARCH_ENABLED' + ' ' + '-DUSE_HERMES=1'
48-
s.requires_arc = true
35+
# Add header search paths for React-Core private headers (needed for RCTCxxBridgeDelegate.h, etc.)
36+
s.pod_target_xcconfig = {
37+
'HEADER_SEARCH_PATHS' => '"$(PODS_ROOT)/Headers/Private/React-Core"',
38+
'DEFINES_MODULE' => 'YES'
39+
}
4940

50-
s.dependency "React"
51-
s.dependency "React-RCTFabric"
52-
s.dependency "React-cxxreact"
53-
s.dependency "React-Fabric"
54-
s.dependency "React-Codegen"
55-
s.dependency "RCT-Folly"
56-
s.dependency "RCTRequired"
57-
s.dependency "RCTTypeSafety"
58-
s.dependency "ReactCommon"
59-
s.dependency "React-runtimeexecutor"
60-
s.dependency "React-rncore"
61-
s.dependency "React-RuntimeCore"
62-
else
63-
s.compiler_flags = folly_compiler_flags
64-
end
41+
# Let install_modules_dependencies handle all React Native dependencies
42+
install_modules_dependencies(s)
6543

66-
s.dependency 'React-Core'
67-
s.dependency 'React-CoreModules'
68-
s.dependency 'React-RCTImage'
69-
s.dependency 'React-RCTText'
44+
s.requires_arc = true
7045
s.dependency 'HMSegmentedControl'
7146
s.frameworks = 'UIKit'
7247
end

android/src/main/java/com/reactnativenavigation/options/params/ReactPlatformColor.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import com.facebook.react.bridge.ReadableMap
55
import com.reactnativenavigation.NavigationApplication
66

77
private fun parsePlatformColor(paths: ReadableMap) =
8-
ColorPropConverter.getColor(paths, NavigationApplication.instance)
8+
ColorPropConverter.getColor(paths, NavigationApplication.instance) ?: 0 // The default implementation
99

1010
class ReactPlatformColor(private val paths: ReadableMap) :
1111
Colour(parsePlatformColor(paths)) {

android/src/main/java/com/reactnativenavigation/options/parsers/ColorParser.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ object ColorParser {
1313
private const val VAL_NO_COLOR = "NoColor"
1414

1515
@JvmStatic
16-
fun parse(context: Context?, json: JSONObject, colorName: String?): Colour {
16+
fun parse(context: Context, json: JSONObject, colorName: String?): Colour {
1717
if (json.has(KEY_RESOURCE_PATHS)) {
1818
return ReactPlatformColor(JSONParser.convert(json))
1919
}

android/src/test/java/com/reactnativenavigation/options/parsers/ColorParseTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
import static org.assertj.core.api.Java6Assertions.assertThat;
44

5+
import android.content.Context;
6+
57
import com.facebook.react.bridge.Arguments;
68
import com.facebook.react.bridge.JavaOnlyArray;
79
import com.facebook.react.bridge.JavaOnlyMap;
@@ -23,7 +25,7 @@ public class ColorParseTest extends BaseRobolectricTest {
2325
public void nullIsParsedAsNoColor() throws JSONException {
2426
JSONObject json = new JSONObject();
2527
json.put("color", "NoColor");
26-
assertThat(ColorParser.parse(null, json, "color")).isInstanceOf(DontApplyColour.class);
28+
assertThat(ColorParser.parse(Mockito.mock(Context.class), json, "color")).isInstanceOf(DontApplyColour.class);
2729
}
2830

2931
@Test

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,23 +88,23 @@
8888
"@babel/preset-env": "^7.25.3",
8989
"@babel/runtime": "^7.25.0",
9090
"@babel/types": "7.25.0",
91-
"@react-native-community/cli": "18.0.0",
92-
"@react-native-community/cli-platform-android": "18.0.0",
93-
"@react-native-community/cli-platform-ios": "18.0.0",
91+
"@react-native-community/cli": "19.1.1",
92+
"@react-native-community/cli-platform-android": "19.1.1",
93+
"@react-native-community/cli-platform-ios": "19.1.1",
9494
"@react-native-community/datetimepicker": "^8.2.0",
9595
"@react-native-community/netinfo": "^11.4.1",
96-
"@react-native/babel-preset": "0.79.7",
97-
"@react-native/eslint-config": "0.79.7",
98-
"@react-native/metro-config": "0.79.7",
99-
"@react-native/typescript-config": "0.79.7",
96+
"@react-native/babel-preset": "0.80.2",
97+
"@react-native/eslint-config": "0.80.2",
98+
"@react-native/metro-config": "0.80.2",
99+
"@react-native/typescript-config": "0.80.2",
100100
"@testing-library/jest-native": "^5.4.2",
101101
"@testing-library/react-native": "^13.0.1",
102102
"@types/hoist-non-react-statics": "^3.3.6",
103103
"@types/jasmine": "3.5.10",
104104
"@types/jest": "^29.5.13",
105105
"@types/lodash": "^4.17.20",
106-
"@types/react": "^18.2.6",
107-
"@types/react-test-renderer": "^18.0.0",
106+
"@types/react": "^19.1.0",
107+
"@types/react-test-renderer": "^19.1.0",
108108
"@typescript-eslint/eslint-plugin": "8.21.0",
109109
"@typescript-eslint/parser": "8.21.0",
110110
"clang-format": "^1.4.0",
@@ -123,15 +123,15 @@
123123
"pixelmatch": "^5.2.1",
124124
"pngjs": "^6.0.0",
125125
"prettier": "2.8.8",
126-
"react": "19.0.0",
127-
"react-native": "0.79.7",
126+
"react": "19.1.0",
127+
"react-native": "0.80.2",
128128
"react-native-builder-bob": "^0.40.13",
129129
"react-native-fast-image": "^8.6.3",
130130
"react-native-gesture-handler": "^2.22.1",
131131
"react-native-reanimated": "4.1.5",
132132
"react-native-worklets": "0.5.0",
133133
"react-redux": "9.1.2",
134-
"react-test-renderer": "19.0.0",
134+
"react-test-renderer": "19.1.0",
135135
"redux": "^5.0.1",
136136
"remx": "3.x.x",
137137
"semver": "5.x.x",

playground/android/build.gradle

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

3-
def kotlinVersion = "2.0.21"
3+
buildscript {
4+
apply from: './rninfo.gradle'
45

5-
ext {
6-
kotlinVersion = kotlinVersion
7-
RNNKotlinVersion = kotlinVersion
8-
detoxKotlinVersion = kotlinVersion
9-
compileSdkVersion = 35
10-
buildToolsVersion = "35.0.0"
11-
minSdkVersion = 24
12-
targetSdkVersion = 35
13-
ndkVersion = "27.1.12297006"
14-
}
6+
ext {
7+
// RN 0.79+ uses Kotlin 2.1.x, older versions use 2.0.21
8+
kotlinVersion = ext.rnInfo.isRN79OrHigher ? '2.1.20' : '2.0.21'
9+
RNNKotlinVersion = kotlinVersion
10+
detoxKotlinVersion = kotlinVersion
11+
compileSdkVersion = 35
12+
buildToolsVersion = "35.0.0"
13+
minSdkVersion = 24
14+
targetSdkVersion = 35
15+
ndkVersion = "27.1.12297006"
16+
}
1517

16-
buildscript {
17-
def kotlinVersion = "2.0.21"
1818
repositories {
1919
google()
2020
mavenCentral()

0 commit comments

Comments
 (0)