Skip to content

Commit 6db3c73

Browse files
authored
Support react-native 0.79 (#3436)
## Description This PR adds support for `react-native` 0.79 - ## 0.79.0 ✅ - 0.79.0-rc.4 🥇 ✅ - 0.79.0-rc.3 ✅ - 0.79.0-rc.2 ✅ - 0.79.0-rc.1 ✅ - 0.79.0-rc.0 ✅ ## Test plan Check that FabricExample works correctly.
1 parent f2e6ebc commit 6db3c73

File tree

13 files changed

+901
-1377
lines changed

13 files changed

+901
-1377
lines changed

FabricExample/Gemfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,10 @@ ruby ">= 2.6.10"
77
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
99
gem 'xcodeproj', '< 1.26.0'
10-
gem 'concurrent-ruby', '< 1.3.4'
10+
gem 'concurrent-ruby', '< 1.3.4'
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem 'bigdecimal'
14+
gem 'logger'
15+
gem 'benchmark'
16+
gem 'mutex_m'

FabricExample/Gemfile.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ GEM
1717
json (>= 1.5.1)
1818
atomos (0.1.3)
1919
base64 (0.2.0)
20+
benchmark (0.4.0)
21+
bigdecimal (3.1.9)
2022
claide (1.1.0)
2123
cocoapods (1.15.2)
2224
addressable (~> 2.8)
@@ -68,8 +70,10 @@ GEM
6870
i18n (1.14.6)
6971
concurrent-ruby (~> 1.0)
7072
json (2.8.1)
73+
logger (1.6.6)
7174
minitest (5.25.1)
7275
molinillo (0.8.0)
76+
mutex_m (0.3.0)
7377
nanaimo (0.3.0)
7478
nap (1.1.0)
7579
netrc (0.11.0)
@@ -95,8 +99,12 @@ PLATFORMS
9599

96100
DEPENDENCIES
97101
activesupport (>= 6.1.7.5, < 7.1.0)
102+
benchmark
103+
bigdecimal
98104
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
99105
concurrent-ruby (< 1.3.4)
106+
logger
107+
mutex_m
100108
xcodeproj (< 1.26.0)
101109

102110
RUBY VERSION
Binary file not shown.

FabricExample/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Thu Jan 23 11:05:26 CET 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

FabricExample/android/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

FabricExample/ios/FabricExample/AppDelegate.swift

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,36 @@ import React_RCTAppDelegate
44
import ReactAppDependencyProvider
55

66
@main
7-
class AppDelegate: RCTAppDelegate {
8-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
9-
self.moduleName = "FabricExample"
10-
self.dependencyProvider = RCTAppDependencyProvider()
7+
class AppDelegate: UIResponder, UIApplicationDelegate {
8+
var window: UIWindow?
119

12-
// You can add your custom initial props in the dictionary below.
13-
// They will be passed down to the ViewController used by React Native.
14-
self.initialProps = [:]
10+
var reactNativeDelegate: ReactNativeDelegate?
11+
var reactNativeFactory: RCTReactNativeFactory?
1512

16-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
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: "FabricExample",
28+
in: window,
29+
launchOptions: launchOptions
30+
)
31+
32+
return true
1733
}
34+
}
1835

36+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
1937
override func sourceURL(for bridge: RCTBridge) -> URL? {
2038
self.bundleURL()
2139
}

0 commit comments

Comments
 (0)