Skip to content

Commit e394532

Browse files
j-piaseckitomekzaw
andauthored
Support for React Native 0.75 (#2966)
## Description - bump FabricExample to RN 0.75 - make changes necessary to build the app - native state type got changed from `ShadowNode` to `ShadowNodeWrapper` - update `ghQueueMicrotask` to include `setImmediate` as `requestAnimationFrame` [is equivalent to `setTimeout(0)` ](https://github.com/facebook/react-native/blob/1c1c8335db2494672cf955cf4db574e23fd2198a/packages/react-native/ReactCommon/react/runtime/TimerManager.cpp#L441-L443)on RN and seems not to be consistent in regards to the order of execution ## Test plan Test on FabricExample and Example apps --------- Co-authored-by: Tomek Zawadzki <tomekzawadzki98@gmail.com>
1 parent da5707a commit e394532

File tree

18 files changed

+1465
-783
lines changed

18 files changed

+1465
-783
lines changed

FabricExample/Gemfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ 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-
# 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'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'

FabricExample/Gemfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ PLATFORMS
9191
ruby
9292

9393
DEPENDENCIES
94-
activesupport (>= 6.1.7.5, < 7.1.0)
95-
cocoapods (>= 1.13, < 1.15)
94+
activesupport (>= 6.1.7.5, != 7.1.0)
95+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
9696

9797
RUBY VERSION
9898
ruby 2.7.5p203

FabricExample/__tests__/App-test.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
1-
/**
2-
* @format
3-
*/
4-
5-
import 'react-native';
61
import React from 'react';
7-
import App from '../App';
8-
9-
// Note: import explicitly to use the types shiped with jest.
102
import { it } from '@jest/globals';
113

124
// Note: test renderer must be required after react-native.

FabricExample/android/app/build.gradle

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import com.android.build.OutputFile
1010
*/
1111
react {
1212
/* Folders */
13-
// The root of your project, i.e. where "package.json" lives. Default is '..'
14-
// root = file("../")
15-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
16-
// reactNativeDir = file("../node_modules/react-native")
17-
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
18-
// codegenDir = file("../node_modules/react-native-codegen")
19-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
20-
// cliFile = file("../node_modules/react-native/cli.js")
13+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
14+
// root = file("../../")
15+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
16+
// reactNativeDir = file("../../node_modules/react-native")
17+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
18+
// codegenDir = file("../../node_modules/@react-native/codegen")
19+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
20+
// cliFile = file("../../node_modules/react-native/cli.js")
2121

2222
/* Variants */
2323
// The list of variants to that are debuggable. For those we're going to
@@ -51,6 +51,9 @@ react {
5151
//
5252
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5353
// hermesFlags = ["-O", "-output-source-map"]
54+
55+
/* Autolinking */
56+
autolinkLibrariesWithApp()
5457
}
5558

5659
/**
@@ -160,5 +163,3 @@ dependencies {
160163
implementation jscFlavor
161164
}
162165
}
163-
164-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

FabricExample/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
android:icon="@mipmap/ic_launcher"
99
android:roundIcon="@mipmap/ic_launcher_round"
1010
android:allowBackup="false"
11-
android:theme="@style/AppTheme">
11+
android:theme="@style/AppTheme"
12+
android:supportsRtl="true">
1213
<activity
1314
android:name=".MainActivity"
1415
android:label="@string/app_name"

FabricExample/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
compileSdkVersion = 34
88
targetSdkVersion = 34
99
ndkVersion = "26.1.10909125"
10-
kotlinVersion = "1.9.22"
10+
kotlinVersion = "1.9.24"
1111
}
1212
repositories {
1313
google()

FabricExample/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m
2121
# Android operating system, and which are packaged with your app's APK
2222
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2323
android.useAndroidX=true
24-
# Automatically convert third-party libraries to use AndroidX
25-
android.enableJetifier=true
2624

2725
# Use this property to specify which architecture you want to build.
2826
# You can also override it from the CLI using

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

FabricExample/android/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
2+
plugins { id("com.facebook.react.settings") }
3+
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autolinkLibrariesFromCommand() }
14
rootProject.name = 'FabricExample'
2-
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
35
include ':app'
46
includeBuild('../node_modules/@react-native/gradle-plugin')

0 commit comments

Comments
 (0)