Skip to content

Commit 80a7757

Browse files
committed
chore: initial rn 0.75 work
- replaced RNFI with the built-in Image component. not as good but it's actually maintained + this could reduce app sizes further - add temporary RNGP patch (see [here](facebook/react-native#45403 (comment)) for more context) - currently waiting on [reanimated](software-mansion/react-native-reanimated#6185)
1 parent bb1c0ac commit 80a7757

13 files changed

+487
-641
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt b/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt
2+
index 9950a0b7fde1972615baeba943864953f3675a97..fa83c37aecf8400bafed32960d009b43700124e2 100644
3+
--- a/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt
4+
+++ b/settings-plugin/src/main/kotlin/com/facebook/react/ReactSettingsExtension.kt
5+
@@ -39,7 +39,7 @@ abstract class ReactSettingsExtension @Inject constructor(val settings: Settings
6+
*/
7+
@JvmOverloads
8+
public fun autolinkLibrariesFromCommand(
9+
- command: List<String> = listOf("npx", "@react-native-community/cli", "config"),
10+
+ command: List<String> = listOf("npx", "-s", "@react-native-community/cli", "config"),
11+
workingDirectory: File? = settings.layout.rootDirectory.dir("../").asFile,
12+
lockFiles: FileCollection =
13+
settings.layout.rootDirectory

Diff for: __tests__/App.test.tsx

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ import {App} from '../App';
99
import {expect, it} from '@jest/globals';
1010

1111
// Note: test renderer must be required after react-native.
12-
import renderer from 'react-test-renderer';
12+
import ReactTestRenderer from 'react-test-renderer';
1313

1414
/* FIXME: sort out import problems
1515
* (appear to be problems with ESM modules - looks like we need to set up Jest ESM support somehow? hmmm)
1616
* and get tests running, then uncomment
1717
**/
18-
// it('renders correctly', () => {
19-
// renderer.create(<App />);
18+
// it('renders correctly', async () => {
19+
// await ReactTestRenderer.act(() => {
20+
// ReactTestRenderer.create(<App />);
21+
// });
2022
// });
2123

2224
it('is skipped', () => {

Diff for: android/app/build.gradle

+11-10
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
88
*/
99
react {
1010
/* Folders */
11-
// The root of your project, i.e. where "package.json" lives. Default is '..'
12-
// root = file("../")
13-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
14-
// reactNativeDir = file("../node-modules/react-native")
15-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16-
// codegenDir = file("../node_modules/@react-native/codegen")
17-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18-
// cliFile = file("../node_modules/react-native/cli.js")
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
1919
/* Variants */
2020
// The list of variants to that are debuggable. For those we're going to
2121
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
@@ -46,6 +46,9 @@ react {
4646
//
4747
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
4848
// hermesFlags = ["-O", "-output-source-map"]
49+
50+
/* Autolinking */
51+
autolinkLibrariesWithApp()
4952
}
5053

5154
project.ext.vectoricons = [
@@ -147,5 +150,3 @@ dependencies {
147150
exclude group: 'com.google.android.gms'
148151
}
149152
}
150-
151-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

Diff for: android/app/src/main/AndroidManifest.xml

+2-1
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"

Diff for: android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
compileSdkVersion = 34
66
targetSdkVersion = 34
77
ndkVersion = "26.1.10909125"
8-
kotlinVersion = "1.9.22"
8+
kotlinVersion = "1.9.24"
99
}
1010
repositories {
1111
google()

Diff for: android/gradle.properties

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2222
# Android operating system, and which are packaged with your app's APK
2323
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2424
android.useAndroidX=true
25-
# Automatically convert third-party libraries to use AndroidX
26-
android.enableJetifier=true
2725

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

Diff for: android/gradle/wrapper/gradle-wrapper.jar

-19.8 KB
Binary file not shown.

Diff for: android/gradle/wrapper/gradle-wrapper.properties

+1-1
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-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

Diff for: android/gradlew

+2-1
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/.
@@ -198,6 +198,7 @@ if "$cygwin" || "$msys" ; then
198198
done
199199
fi
200200

201+
201202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203204

Diff for: android/settings.gradle

+3-1
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 = 'Revvy'
25
includeBuild('../node_modules/@react-native/gradle-plugin')
3-
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
46
include ':app'

Diff for: package.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,18 @@
3131
"mobx": "^6.13.0",
3232
"mobx-react-lite": "^4.0.7",
3333
"process": "^0.11.10",
34-
"react": "^18.3.1",
34+
"react": "^19.0.0-rc-fb9a90fa48-20240614",
3535
"react-dom": "^18.3.1",
3636
"react-error-boundary": "^4.0.13",
3737
"react-i18next": "^14.1.3",
38-
"react-native": "^0.74.2",
38+
"react-native": "^0.75.0-rc.5",
3939
"react-native-device-info": "^11.1.0",
4040
"react-native-document-picker": "^9.3.0",
41-
"react-native-fast-image": "^8.6.3",
4241
"react-native-gesture-handler": "^2.17.1",
4342
"react-native-get-random-values": "^1.11.0",
4443
"react-native-image-zoom-viewer": "^3.0.1",
4544
"react-native-markdown-display": "^7.0.2",
46-
"react-native-reanimated": "patch:react-native-reanimated@npm%3A3.12.0#~/.yarn/patches/react-native-reanimated-npm-3.12.0-0eaba2f107.patch",
45+
"react-native-reanimated": "^3.14.0",
4746
"react-native-svg": "^15.4.0",
4847
"react-native-vector-icons": "^10.1.0",
4948
"react-native-web": "^0.19.12",
@@ -55,10 +54,10 @@
5554
"@babel/plugin-transform-export-namespace-from": "^7.24.7",
5655
"@babel/preset-env": "^7.24.8",
5756
"@babel/runtime": "^7.24.8",
58-
"@react-native/babel-preset": "^0.74.85",
59-
"@react-native/eslint-config": "^0.74.85",
60-
"@react-native/metro-config": "^0.74.85",
61-
"@react-native/typescript-config": "^0.74.85",
57+
"@react-native/babel-preset": "^0.75.0-rc.5",
58+
"@react-native/eslint-config": "^0.75.0-rc.5",
59+
"@react-native/metro-config": "^0.75.0-rc.5",
60+
"@react-native/typescript-config": "^0.75.0-rc.5",
6261
"@rnx-kit/metro-config": "^1.3.15",
6362
"@rnx-kit/metro-plugin-cyclic-dependencies-detector": "^1.1.2",
6463
"@rnx-kit/metro-plugin-duplicates-checker": "^2.1.3",
@@ -84,7 +83,7 @@
8483
"prettier": "^2.8.8",
8584
"react-devtools": "^5.3.1",
8685
"react-native-svg-transformer": "^1.5.0",
87-
"react-test-renderer": "^18.3.1",
86+
"react-test-renderer": "^19.0.0-rc-fb9a90fa48-20240614",
8887
"typescript": "^5.5.3",
8988
"url-loader": "^4.1.1",
9089
"webpack": "^5.93.0",
@@ -94,5 +93,8 @@
9493
"engines": {
9594
"node": ">=18"
9695
},
97-
"packageManager": "[email protected]"
96+
"packageManager": "[email protected]",
97+
"resolutions": {
98+
"@react-native/gradle-plugin@npm:0.75.0-rc.5": "patch:@react-native/gradle-plugin@npm%3A0.75.0-rc.5#~/.yarn/patches/@react-native-gradle-plugin-npm-0.75.0-rc.5-ac3f592965.patch"
99+
}
98100
}

Diff for: src/crossplat/Image.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
import FastImage from 'react-native-fast-image';
1+
import {Image as CoreImage} from 'react-native';
22

3-
export const Image = FastImage;
3+
export const Image = CoreImage;
4+
5+
//import FastImage from 'react-native-fast-image';
6+
7+
//export const Image = FastImage;

0 commit comments

Comments
 (0)