Skip to content

Commit 83785df

Browse files
committed
feat: drop support for 0.75 and older
BREAKING CHANGE: Dropped support for 0.75 and older
1 parent 655b5d6 commit 83785df

File tree

59 files changed

+211
-1555
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+211
-1555
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,10 +189,10 @@ node --test test/pack.test.mjs
189189
## Testing Specific React Native Versions
190190

191191
`react-native-test-app` supports multiple versions of React Native. Use
192-
`set-react-version` to set the version, e.g. to use 0.73:
192+
`set-react-version` to set the version, e.g. to use 0.80:
193193

194194
```sh
195-
npm run set-react-version 0.73
195+
npm run set-react-version 0.80
196196
```
197197

198198
This will modify both `package.json` and `example/package.json` to use packages
@@ -218,11 +218,11 @@ update the title and fill out all the required fields. You can find the relevant
218218
discussion link at [`react-native-releases`][].
219219

220220
Use the [`test:matrix`][] script to both test and capture screenshots. We'll
221-
need the screenshots for the PR we'll create later. For instance, to test 0.73,
221+
need the screenshots for the PR we'll create later. For instance, to test 0.80,
222222
run:
223223

224224
```sh
225-
npm run test:matrix 0.73
225+
npm run test:matrix 0.80
226226
```
227227

228228
At the minimum, we should be testing the lowest supported version (0.66 at the

android/app/build.gradle

Lines changed: 27 additions & 128 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,19 @@ buildDir = "${rootDir}/${name}/build"
1717

1818
def reactNativePath = file(findNodeModulesPath("react-native", rootDir))
1919

20-
if (autodetectReactNativeVersion || enableNewArchitecture) {
21-
apply(plugin: "com.facebook.react")
22-
23-
react {
24-
reactNativeDir = reactNativePath
25-
codegenDir = file(
26-
reactNativeVersion >= v(0, 72, 0)
27-
? findNodeModulesPath("@react-native/codegen", reactNativePath)
28-
: findNodeModulesPath("react-native-codegen", reactNativePath)
29-
)
30-
}
20+
apply(plugin: "com.facebook.react")
3121

32-
// We don't want the React plugin to bundle.
33-
tasks.whenTaskAdded { task ->
34-
// The task name can be found in `react-native-gradle-plugin`:
35-
// https://github.com/facebook/react-native/blob/0.71-stable/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt#L54
36-
if (task.name.startsWith("createBundle") && task.name.endsWith("JsAndAssets")) {
37-
task.enabled = false
38-
}
22+
react {
23+
reactNativeDir = reactNativePath
24+
codegenDir = file(findNodeModulesPath("@react-native/codegen", reactNativePath))
25+
}
26+
27+
// We don't want the React plugin to bundle.
28+
tasks.whenTaskAdded { task ->
29+
// The task name can be found in `react-native-gradle-plugin`:
30+
// https://github.com/facebook/react-native/blob/0.71-stable/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/TaskConfiguration.kt#L54
31+
if (task.name.startsWith("createBundle") && task.name.endsWith("JsAndAssets")) {
32+
task.enabled = false
3933
}
4034
}
4135

@@ -78,10 +72,8 @@ android {
7872
ndkVersion = project.ext.ndkVersion
7973
}
8074

81-
if (usePrefabs) {
82-
buildFeatures {
83-
prefab = true
84-
}
75+
buildFeatures {
76+
prefab = true
8577
}
8678

8779
kotlinOptions {
@@ -107,14 +99,12 @@ android {
10799

108100
resValue("string", "app_name", project.ext.react.appName)
109101

110-
def cppStd = reactNativeVersion >= v(0, 74, 0) ? "-std=c++20" : "-std=c++17"
102+
def cppStd = "-std=c++20"
111103
if (enableNewArchitecture) {
112104
externalNativeBuild {
113105
cmake {
114106
arguments("-DANDROID_STL=c++_shared",
115-
"-DNODE_MODULES_DIR=${reactNativePath}/..",
116107
"-DPROJECT_BUILD_DIR=${buildDir}",
117-
"-DREACT_ANDROID_BUILD_DIR=${reactNativePath}/ReactAndroid/build",
118108
"-DREACT_ANDROID_DIR=${reactNativePath}/ReactAndroid")
119109
cppFlags(cppStd, "-frtti", "-fexceptions", "-DWITH_INSPECTOR=1")
120110
}
@@ -142,28 +132,6 @@ android {
142132
}
143133
}
144134

145-
if (!enableNewArchitecture && !usePrefabs) {
146-
def version = getPackageVersion("react-native", rootDir)
147-
def allAar = file("${reactNativePath}/android/com/facebook/react/react-native/${version}/react-native-${version}.aar")
148-
149-
def prepareDebugJSI = tasks.register("prepareDebugJSI", Copy) {
150-
def debugAar = file("${reactNativePath}/android/com/facebook/react/react-native/${version}/react-native-${version}-debug.aar")
151-
from(zipTree(debugAar.exists() ? debugAar : allAar).matching({ it.include "**/libjsi.so" }))
152-
into("${buildDir}/outputs/jniLibs/debug")
153-
}
154-
155-
def prepareReleaseJSI = tasks.register("prepareReleaseJSI", Copy) {
156-
def releaseAar = file("${reactNativePath}/android/com/facebook/react/react-native/${version}/react-native-${version}-release.aar")
157-
from(zipTree(releaseAar.exists() ? releaseAar : allAar).matching({ it.include "**/libjsi.so" }))
158-
into("${buildDir}/outputs/jniLibs/release")
159-
}
160-
161-
afterEvaluate {
162-
preDebugBuild.dependsOn(prepareDebugJSI)
163-
preReleaseBuild.dependsOn(prepareReleaseJSI)
164-
}
165-
}
166-
167135
lintOptions {
168136
lintConfig = file("lint.xml")
169137
}
@@ -198,52 +166,12 @@ android {
198166
? "src/old-arch/java"
199167
: reactNativeVersion >= v(0, 81, 0)
200168
? "src/new-arch-0.81/java"
201-
: reactNativeVersion >= v(0, 73, 0)
202-
? "src/new-arch-0.73/java"
203-
: "src/new-arch/java",
204-
205-
// TODO: Remove this block when we drop support for 0.74
206-
// https://github.com/facebook/react-native/commit/3283202248a36dbda553745afc46a3e3e2ab41a6
207-
reactNativeVersion >= v(0, 75, 0)
208-
? "src/reactactivitydelegate-0.75/java"
209-
// TODO: Remove this block when we drop support for 0.73
210-
: reactNativeVersion >= v(0, 74, 0)
211-
? "src/reactactivitydelegate-0.74/java"
212-
// TODO: Remove this block when we drop support for 0.71
213-
// https://github.com/facebook/react-native/commit/e5dd9cdc6688e63e75a7e0bebf380be1a9a5fe2b
214-
: reactNativeVersion >= v(0, 72, 0)
215-
? "src/reactactivitydelegate-0.72/java"
216-
: "src/reactactivitydelegate-pre-0.72/java",
217-
218-
// TODO: Remove this block when we drop support for 0.74
219-
// https://github.com/facebook/react-native/commit/a1e81185416a53c7c7d0cfc67e40079fd0073e7c
220-
reactNativeVersion >= v(0, 75, 0)
221-
? "src/devserverhelper-0.75/java"
222-
// TODO: Remove this block when we drop support for 0.73
223-
// https://github.com/facebook/react-native/commit/cfa02eec50469059542ccbacbc51643b525ad461
224-
: reactNativeVersion >= v(0, 74, 0)
225-
? "src/devserverhelper-0.74/java"
226-
// TODO: Remove this block when we drop support for 0.72
227-
// https://github.com/facebook/react-native/commit/da358d0ec7a492edb804b9cdce70e7516ee518ae
228-
: reactNativeVersion >= v(0, 73, 0)
229-
? "src/devserverhelper-0.73/java"
230-
: "src/devserverhelper-pre-0.73/java",
231-
232-
// TODO: Remove this block when we drop support for 0.75
233-
// https://github.com/react-native-community/template/commit/f738a366b194dd21d4d2bc14c9215b630714dd70
234-
reactNativeVersion >= v(0, 76, 0)
235-
? "src/reactapplication-0.76/java"
236-
// TODO: Remove this block when we drop support for 0.72
237-
// https://github.com/facebook/react-native/commit/c3f672cef7d4f287d3d729d33650f917ed132a0c
238-
: reactNativeVersion < v(0, 73, 0)
239-
? "src/reactapplication-pre-0.73/java"
240-
: "src/reactapplication-0.73/java",
241-
242-
// TODO: Remove this block when we drop support for 0.75
243-
// https://github.com/react-native-community/template/commit/f738a366b194dd21d4d2bc14c9215b630714dd70
244-
reactNativeVersion >= v(0, 76, 0)
245-
? "src/reacthost-0.76/java"
246-
: "src/reacthost-legacy/java",
169+
: "src/new-arch-0.73/java",
170+
171+
"src/devserverhelper-0.75/java",
172+
"src/reactactivitydelegate-0.75/java",
173+
"src/reactapplication-0.76/java",
174+
"src/reacthost-0.76/java",
247175
]
248176
}
249177

@@ -260,22 +188,8 @@ android {
260188
dependencies {
261189
implementation project(":support")
262190

263-
if (project.ext.react.enableHermes) {
264-
if (autodetectReactNativeVersion) {
265-
implementation("com.facebook.react:hermes-android")
266-
} else {
267-
implementation("com.facebook.react:hermes-engine:+") {
268-
exclude(group: "com.facebook.fbjni")
269-
}
270-
}
271-
}
272-
273-
if (autodetectReactNativeVersion) {
274-
implementation("com.facebook.react:react-android")
275-
} else {
276-
def version = getPackageVersion("react-native", rootDir)
277-
implementation("com.facebook.react:react-native:${version}")
278-
}
191+
implementation("com.facebook.react:hermes-android")
192+
implementation("com.facebook.react:react-android")
279193

280194
implementation(libraries.androidAppCompat)
281195
implementation(libraries.androidCoreKotlinExtensions)
@@ -288,25 +202,10 @@ dependencies {
288202
implementation(libraries.mlKitBarcodeScanning)
289203
}
290204

291-
if (reactNativeVersion == 0 || reactNativeVersion >= v(0, 75, 0)) {
292-
// https://github.com/facebook/react-native/blob/b0c0bb45911434ea654ba7e2feff4686061eba7a/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt#L162
293-
def dependencies = autolinkingInfo(buildDir)
294-
dependencies.each { path, info ->
295-
info.configurations.each { configuration ->
296-
add(configuration, project(path))
297-
}
298-
}
299-
}
300-
}
301-
302-
if (!enableNewArchitecture && !usePrefabs) {
303-
configurations.all {
304-
resolutionStrategy {
305-
// Force version here otherwise Gradle will pick up a newer version:
306-
// https://github.com/facebook/react-native/issues/35210
307-
def version = getPackageVersion("react-native", rootDir)
308-
force("com.facebook.react:react-native:${version}")
309-
force("com.facebook.react:hermes-engine:${version}")
205+
// https://github.com/facebook/react-native/blob/b0c0bb45911434ea654ba7e2feff4686061eba7a/packages/react-native-gradle-plugin/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactExtension.kt#L162
206+
autolinkingInfo(buildDir).each { path, info ->
207+
info.configurations.each { configuration ->
208+
add(configuration, project(path))
310209
}
311210
}
312211
}

android/app/src/devserverhelper-0.73/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt

Lines changed: 0 additions & 15 deletions
This file was deleted.

android/app/src/devserverhelper-0.74/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt

Lines changed: 0 additions & 13 deletions
This file was deleted.

android/app/src/devserverhelper-pre-0.73/java/com/microsoft/reacttestapp/react/DevServerHelperCompat.kt

Lines changed: 0 additions & 16 deletions
This file was deleted.

android/app/src/main/jni/AutolinkingCompat.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,10 @@
1313

1414
#endif // __has_include(<FBReactNativeSpec.h>) // >= 0.81
1515

16-
#if __has_include(<autolinking.h>) // >= 0.75
17-
1816
#include <autolinking.h>
1917

2018
#define autolinking_ModuleProvider facebook::react::autolinking_ModuleProvider
2119
#define autolinking_cxxModuleProvider facebook::react::autolinking_cxxModuleProvider
2220
#define autolinking_registerProviders facebook::react::autolinking_registerProviders
2321

24-
#else // < 0.75
25-
26-
#include <rncli.h>
27-
28-
#define autolinking_ModuleProvider facebook::react::rncli_ModuleProvider
29-
#define autolinking_cxxModuleProvider facebook::react::rncli_cxxModuleProvider
30-
#define autolinking_registerProviders facebook::react::rncli_registerProviders
31-
32-
#endif // __has_include(<autolinking.h>)
33-
3422
#endif // REACTAPP_JNI_AUTOLINKINGCOMPAT_H_

android/app/src/main/jni/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ set(REACTTESTAPP_SOURCE_FILES
1212

1313
# Suppress 'Manually-specified variables were not used by the project' warning
1414
set(UNUSED_VARIABLES
15-
${NODE_MODULES_DIR} # TODO: No longer used in 0.72
16-
${REACT_ANDROID_BUILD_DIR} # TODO: No longer used in 0.72
1715
${REACT_COMMON_DIR}
1816
${REACT_JNILIBS_DIR}
1917
)

android/app/src/main/jni/ComponentsRegistry.cpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,13 @@
22

33
#if !__has_include(<DefaultTurboModuleManagerDelegate.h>)
44

5+
// clang-format off
56
#include "AutolinkingCompat.h"
6-
7-
#if __has_include(<react/fabric/CoreComponentsRegistry.h>) // >= 0.71
8-
#include <react/fabric/CoreComponentsRegistry.h>
9-
#else // < 0.71
10-
#include <CoreComponentsRegistry.h>
11-
#endif // __has_include(<react/fabric/CoreComponentsRegistry.h>)
7+
// clang-format on
128

139
#include <DefaultComponentsRegistry.h>
1410

11+
#include <react/fabric/CoreComponentsRegistry.h>
1512
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
1613
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
1714
#include <react/renderer/components/rncore/ComponentDescriptors.h>

android/app/src/main/jni/ComponentsRegistry.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33

44
#include <fbjni/fbjni.h>
55

6-
#if __has_include(<react/fabric/ComponentFactory.h>) // >= 0.71
76
#include <react/fabric/ComponentFactory.h>
8-
#else // < 0.71
9-
#include <ComponentFactory.h>
10-
#endif
117

128
namespace ReactTestApp
139
{

android/app/src/main/jni/OnLoad.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ namespace
3131
std::shared_ptr<TurboModule> javaModuleProvider(const std::string &name,
3232
const JavaTurboModule::InitParams &params)
3333
{
34-
#if __has_include(<autolinking.h>) // >= 0.75
3534
// We first try to look up core modules
3635
if (auto module = rncore_ModuleProvider(name, params)) {
3736
return module;
3837
}
39-
#endif // __has_include(<autolinking.h>)
4038

4139
// And we fallback to the module providers autolinked by RN CLI
4240
return autolinking_ModuleProvider(name, params);

0 commit comments

Comments
 (0)