Skip to content

Commit 1d1535c

Browse files
Merge pull request #630 from DataDog/jmoskovich/rum-2575/update-to-0.73
Support RN 0.73
2 parents 5b8a26c + 631660e commit 1d1535c

File tree

71 files changed

+4632
-4828
lines changed

Some content is hidden

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

71 files changed

+4632
-4828
lines changed

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset']
2+
presets: ['module:@react-native/babel-preset']
33
};
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
3+
extends: '@react-native',
44
};

example-new-architecture/.node-version

Lines changed: 0 additions & 1 deletion
This file was deleted.

example-new-architecture/App.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
LearnMoreLinks,
2929
ReloadInstructions,
3030
} from 'react-native/Libraries/NewAppScreen';
31+
// @ts-ignore
3132
import {APPLICATION_ID, CLIENT_TOKEN, ENVIRONMENT} from './ddCredentials';
3233

3334
(async () => {
@@ -59,7 +60,7 @@ type SectionProps = PropsWithChildren<{
5960
title: string;
6061
}>;
6162

62-
function Section({children, title}: SectionProps): JSX.Element {
63+
function Section({children, title}: SectionProps): React.JSX.Element {
6364
const isDarkMode = useColorScheme() === 'dark';
6465
return (
6566
<View style={styles.sectionContainer}>
@@ -85,7 +86,7 @@ function Section({children, title}: SectionProps): JSX.Element {
8586
);
8687
}
8788

88-
function App(): JSX.Element {
89+
function App(): React.JSX.Element {
8990
const isDarkMode = useColorScheme() === 'dark';
9091

9192
const backgroundStyle = {

example-new-architecture/Gemfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '>= 2.6.10'
5-
6-
gem 'cocoapods', '>= 1.11.3'
4+
ruby ">= 2.6.10"
5+
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'

example-new-architecture/Gemfile.lock

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
CFPropertyList (3.0.6)
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
57
rexml
68
activesupport (7.0.5)
79
concurrent-ruby (~> 1.0, >= 1.0.2)
810
i18n (>= 1.6, < 2)
911
minitest (>= 5.1)
1012
tzinfo (~> 2.0)
11-
addressable (2.8.4)
13+
addressable (2.8.6)
1214
public_suffix (>= 2.0.2, < 6.0)
1315
algoliasearch (1.27.5)
1416
httpclient (~> 2.8, >= 2.8.3)
1517
json (>= 1.5.1)
1618
atomos (0.1.3)
19+
base64 (0.2.0)
1720
claide (1.1.0)
18-
cocoapods (1.12.1)
21+
cocoapods (1.14.3)
1922
addressable (~> 2.8)
2023
claide (>= 1.0.2, < 2.0)
21-
cocoapods-core (= 1.12.1)
24+
cocoapods-core (= 1.14.3)
2225
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23-
cocoapods-downloader (>= 1.6.0, < 2.0)
26+
cocoapods-downloader (>= 2.1, < 3.0)
2427
cocoapods-plugins (>= 1.0.0, < 2.0)
2528
cocoapods-search (>= 1.0.0, < 2.0)
2629
cocoapods-trunk (>= 1.6.0, < 2.0)
@@ -32,8 +35,8 @@ GEM
3235
molinillo (~> 0.8.0)
3336
nap (~> 1.0)
3437
ruby-macho (>= 2.3.0, < 3.0)
35-
xcodeproj (>= 1.21.0, < 2.0)
36-
cocoapods-core (1.12.1)
38+
xcodeproj (>= 1.23.0, < 2.0)
39+
cocoapods-core (1.14.3)
3740
activesupport (>= 5.0, < 8)
3841
addressable (~> 2.8)
3942
algoliasearch (~> 1.0)
@@ -44,7 +47,7 @@ GEM
4447
public_suffix (~> 4.0)
4548
typhoeus (~> 1.0)
4649
cocoapods-deintegrate (1.0.5)
47-
cocoapods-downloader (1.6.3)
50+
cocoapods-downloader (2.1)
4851
cocoapods-plugins (1.0.0)
4952
nap
5053
cocoapods-search (1.0.1)
@@ -57,27 +60,28 @@ GEM
5760
escape (0.0.4)
5861
ethon (0.16.0)
5962
ffi (>= 1.15.0)
60-
ffi (1.15.5)
63+
ffi (1.16.3)
6164
fourflusher (2.3.1)
6265
fuzzy_match (2.0.4)
6366
gh_inspector (1.1.3)
6467
httpclient (2.8.3)
6568
i18n (1.14.1)
6669
concurrent-ruby (~> 1.0)
67-
json (2.6.3)
70+
json (2.7.1)
6871
minitest (5.18.0)
6972
molinillo (0.8.0)
7073
nanaimo (0.3.0)
7174
nap (1.1.0)
7275
netrc (0.11.0)
76+
nkf (0.2.0)
7377
public_suffix (4.0.7)
74-
rexml (3.2.5)
78+
rexml (3.2.6)
7579
ruby-macho (2.5.1)
76-
typhoeus (1.4.0)
80+
typhoeus (1.4.1)
7781
ethon (>= 0.9.0)
7882
tzinfo (2.0.6)
7983
concurrent-ruby (~> 1.0)
80-
xcodeproj (1.22.0)
84+
xcodeproj (1.24.0)
8185
CFPropertyList (>= 2.3.3, < 4.0)
8286
atomos (~> 0.1.3)
8387
claide (>= 1.0.2, < 2.0)
@@ -89,7 +93,8 @@ PLATFORMS
8993
ruby
9094

9195
DEPENDENCIES
92-
cocoapods (>= 1.11.3)
96+
activesupport (>= 6.1.7.5, < 7.1.0)
97+
cocoapods (>= 1.13, < 1.15)
9398

9499
RUBY VERSION
95100
ruby 2.7.5p203

example-new-architecture/android/app/build.gradle

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

4-
import com.android.build.OutputFile
5-
65
/**
76
* This is the configuration block to customize your React Native Android app.
87
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -13,8 +12,8 @@ react {
1312
// root = file("../")
1413
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
1514
// reactNativeDir = file("../node_modules/react-native")
16-
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
17-
// codegenDir = file("../node_modules/react-native-codegen")
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")
1817
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
1918
// cliFile = file("../node_modules/react-native/cli.js")
2019

@@ -52,14 +51,6 @@ react {
5251
// hermesFlags = ["-O", "-output-source-map"]
5352
}
5453

55-
/**
56-
* Set this to true to create four separate APKs instead of one,
57-
* one for each native architecture. This is useful if you don't
58-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
59-
* and want to have separate APKs to upload to the Play Store.
60-
*/
61-
def enableSeparateBuildPerCPUArchitecture = false
62-
6354
/**
6455
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
6556
*/
@@ -78,19 +69,9 @@ def enableProguardInReleaseBuilds = false
7869
*/
7970
def jscFlavor = 'org.webkit:android-jsc:+'
8071

81-
/**
82-
* Private function to get the list of Native Architectures you want to build.
83-
* This reads the value from reactNativeArchitectures in your gradle.properties
84-
* file and works together with the --active-arch-only flag of react-native run-android.
85-
*/
86-
def reactNativeArchitectures() {
87-
def value = project.getProperties().get("reactNativeArchitectures")
88-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
89-
}
90-
9172
android {
9273
ndkVersion rootProject.ext.ndkVersion
93-
74+
buildToolsVersion rootProject.ext.buildToolsVersion
9475
compileSdkVersion rootProject.ext.compileSdkVersion
9576

9677
namespace "com.ddsdkreactnativeexample"
@@ -102,14 +83,6 @@ android {
10283
versionName "1.0"
10384
}
10485

105-
splits {
106-
abi {
107-
reset()
108-
enable enableSeparateBuildPerCPUArchitecture
109-
universalApk false // If true, also generate a universal APK
110-
include (*reactNativeArchitectures())
111-
}
112-
}
11386
buildTypes {
11487
release {
11588
// Caution! In production, you need to generate your own keystore file.
@@ -118,36 +91,13 @@ android {
11891
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
11992
}
12093
}
121-
122-
// applicationVariants are e.g. debug, release
123-
applicationVariants.all { variant ->
124-
variant.outputs.each { output ->
125-
// For each separate APK per architecture, set a unique version code as described here:
126-
// https://developer.android.com/studio/build/configure-apk-splits.html
127-
// Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc.
128-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
129-
def abi = output.getFilter(OutputFile.ABI)
130-
if (abi != null) { // null for the universal-debug, universal-release variants
131-
output.versionCodeOverride =
132-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
133-
}
134-
135-
}
136-
}
13794
}
13895

13996
dependencies {
14097
// The version of react-native is set by the React Native Gradle Plugin
14198
implementation("com.facebook.react:react-android")
99+
implementation("com.facebook.react:flipper-integration")
142100

143-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
144-
145-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
146-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
147-
exclude group:'com.squareup.okhttp3', module:'okhttp'
148-
}
149-
150-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
151101
if (hermesEnabled.toBoolean()) {
152102
implementation("com.facebook.react:hermes-android")
153103
} else {

example-new-architecture/android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

example-new-architecture/android/app/src/debug/java/com/ddsdkreactnativeexample/ReactNativeFlipper.java

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

example-new-architecture/android/app/src/main/java/com/ddsdkreactnativeexample/MainActivity.java

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

0 commit comments

Comments
 (0)