Skip to content

Commit 9e39ace

Browse files
iOS RN-79 (#8155)
* 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 * cleanup --------- Co-authored-by: Georgy Steshin <gosha212@gmail.com>
1 parent 656c568 commit 9e39ace

40 files changed

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

.buildkite/pipeline.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@ echo "steps:"
55
cat .buildkite/jobs/pipeline.release.yml
66
cat .buildkite/jobs/pipeline.android_rn_77.yml
77
cat .buildkite/jobs/pipeline.android_rn_78.yml
8+
cat .buildkite/jobs/pipeline.android_rn_79.yml
89
cat .buildkite/jobs/pipeline.ios_rn_77.yml
910
cat .buildkite/jobs/pipeline.ios_rn_78.yml
11+
cat .buildkite/jobs/pipeline.ios_rn_79.yml
1012
cat .buildkite/jobs/pipeline.publish.yml
1113

1214

ReactNativeNavigation.podspec

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,11 @@
11
require 'json'
2-
require 'find'
32

43
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
5-
64
fabric_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == '1'
75

8-
# Detect if this is a Swift project by looking for user AppDelegate.swift files
9-
start_dir = File.expand_path('../', __dir__)
10-
swift_delegate_path = nil
11-
Find.find(start_dir) do |path|
12-
if path =~ /AppDelegate\.swift$/
13-
swift_delegate_path = path
14-
break
15-
end
16-
end
17-
18-
swift_project = swift_delegate_path && File.exist?(swift_delegate_path)
19-
20-
# Debug output
21-
if swift_project
22-
puts "ReactNativeNavigation: Swift AppDelegate detected - enabling Swift-compatible configuration"
23-
else
24-
puts "ReactNativeNavigation: Objective-C AppDelegate detected - using standard configuration"
25-
end
26-
276
Pod::Spec.new do |s|
287
s.name = "ReactNativeNavigation"
8+
s.prepare_command = 'node autolink/postlink/__helpers__/generate_version_header.js'
299
s.version = package['version']
3010
s.summary = package['description']
3111

@@ -40,13 +20,12 @@ Pod::Spec.new do |s|
4020
s.subspec 'Core' do |ss|
4121
s.source = { :git => "https://github.com/wix/react-native-navigation.git", :tag => "#{s.version}" }
4222
s.source_files = 'ios/**/*.{h,m,mm,cpp}'
43-
s.exclude_files = "ios/ReactNativeNavigationTests/**/*.*", "lib/ios/OCMock/**/*.*"
44-
# Only expose headers for Swift projects
45-
if swift_project
46-
s.public_header_files = [
47-
'ios/RNNAppDelegate.h'
48-
]
49-
end
23+
s.exclude_files = "ios/ReactNativeNavigationTests/**/*.*", "ios/OCMock/**/*.*"
24+
25+
s.public_header_files = [
26+
'ios/RNNAppDelegate.h',
27+
'ios/ReactNativeVersionExtracted.h'
28+
]
5029
end
5130

5231
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'
@@ -58,11 +37,8 @@ Pod::Spec.new do |s|
5837
"OTHER_CPLUSPLUSFLAGS" => "-DFOLLY_NO_CONFIG -DFOLLY_MOBILE=1 -DFOLLY_USE_LIBCPP=1",
5938
}
6039

61-
# Only add DEFINES_MODULE for Swift projects
62-
if swift_project
63-
xcconfig_settings["DEFINES_MODULE"] = "YES"
64-
end
65-
40+
xcconfig_settings["DEFINES_MODULE"] = "YES"
41+
6642
s.pod_target_xcconfig = xcconfig_settings
6743

6844
if fabric_enabled

android/src/androidTest/java/com/reactnativenavigation/TestApplication.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@ package com.reactnativenavigation
33
import com.facebook.react.ReactHost
44
import com.facebook.react.ReactNativeHost
55
import com.facebook.react.ReactPackage
6-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
76
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
87
import com.facebook.react.shell.MainReactPackage
9-
import com.reactnativenavigation.NavigationPackage
108
import com.reactnativenavigation.react.NavigationReactNativeHost
119

1210
class TestApplication : NavigationApplication() {

android/src/main/java/com/reactnativenavigation/views/touch/OverlayTouchDelegate.kt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import android.view.MotionEvent
44
import android.view.View
55
import android.view.ViewGroup
66
import androidx.annotation.VisibleForTesting
7-
import com.facebook.react.views.debuggingoverlay.DebuggingOverlay
87
import com.reactnativenavigation.options.params.Bool
98
import com.reactnativenavigation.options.params.NullBool
109
import com.reactnativenavigation.react.ReactView
@@ -57,7 +56,19 @@ open class OverlayTouchDelegate(
5756
return false
5857
}
5958

60-
private fun debuggingOverlay(childItem: View?): Boolean =
61-
childItem is ViewGroup && childItem.getChildAt(0) is DebuggingOverlay
59+
private fun debuggingOverlay(childItem: View?): Boolean {
60+
if (childItem !is ViewGroup) return false
61+
val firstChild = childItem.getChildAt(0) ?: return false
62+
return isDebuggingOverlay(firstChild)
63+
}
64+
65+
private fun isDebuggingOverlay(view: View): Boolean {
66+
return try {
67+
val className = view.javaClass.name
68+
className == "com.facebook.react.views.debuggingoverlay.DebuggingOverlay"
69+
} catch (e: Exception) {
70+
false
71+
}
72+
}
6273

6374
}

android/src/test/java/com/reactnativenavigation/TestApplication.java

Lines changed: 0 additions & 43 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.reactnativenavigation
2+
3+
import android.app.Application
4+
import androidx.appcompat.R
5+
import com.facebook.react.ReactApplication
6+
import com.facebook.react.ReactHost
7+
import com.facebook.react.ReactNativeHost
8+
import com.facebook.react.ReactPackage
9+
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
10+
11+
class TestApplication : Application(), ReactApplication {
12+
override val reactNativeHost: ReactNativeHost = object : ReactNativeHost(this) {
13+
override fun getUseDeveloperSupport(): Boolean {
14+
return true
15+
}
16+
17+
override fun getPackages(): MutableList<ReactPackage> {
18+
return mutableListOf()
19+
}
20+
}
21+
22+
override fun onCreate() {
23+
super.onCreate()
24+
setTheme(R.style.Theme_AppCompat)
25+
}
26+
27+
override val reactHost: ReactHost
28+
get() = getDefaultReactHost(this, reactNativeHost)
29+
}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import UIKit
2+
import React
3+
import React_RCTAppDelegate
4+
import ReactAppDependencyProvider
5+
6+
@main
7+
class AppDelegate: UIResponder, UIApplicationDelegate {
8+
var window: UIWindow?
9+
10+
var reactNativeDelegate: ReactNativeDelegate?
11+
var reactNativeFactory: RCTReactNativeFactory?
12+
13+
func application(
14+
_ application: UIApplication,
15+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16+
) -> Bool {
17+
let delegate = ReactNativeDelegate()
18+
let factory = RCTReactNativeFactory(delegate: delegate)
19+
delegate.dependencyProvider = RCTAppDependencyProvider()
20+
21+
reactNativeDelegate = delegate
22+
reactNativeFactory = factory
23+
24+
window = UIWindow(frame: UIScreen.main.bounds)
25+
26+
factory.startReactNative(
27+
withModuleName: "RN79",
28+
in: window,
29+
launchOptions: launchOptions
30+
)
31+
32+
return true
33+
}
34+
}
35+
36+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
37+
override func sourceURL(for bridge: RCTBridge) -> URL? {
38+
self.bundleURL()
39+
}
40+
41+
override func bundleURL() -> URL? {
42+
#if DEBUG
43+
RCTBundleURLProvider.sharedSettings().jsBundleURL(forBundleRoot: "index")
44+
#else
45+
Bundle.main.url(forResource: "main", withExtension: "jsbundle")
46+
#endif
47+
}
48+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package com.app
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
8+
class MainActivity : ReactActivity() {
9+
10+
/**
11+
* Returns the name of the main component registered from JavaScript. This is used to schedule
12+
* rendering of the component.
13+
*/
14+
override fun getMainComponentName(): String = "rn770"
15+
16+
/**
17+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
18+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
19+
*/
20+
override fun createReactActivityDelegate(): ReactActivityDelegate =
21+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
22+
}

0 commit comments

Comments
 (0)