Skip to content

Commit 6fee48d

Browse files
authored
feat(sampleApps): Update sample apps to React Native 0.80, update other dependencies, improve code quality (#5057)
* feat(sampleApps): update sample apps to React Native 0.80 / update other deps * Lockfile update * Make tests work
1 parent 7480abe commit 6fee48d

Some content is hidden

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

41 files changed

+1793
-904
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@
1010

1111
### Fixes
1212

13+
- Session Replay: Allow excluding `sentry-android-replay` from android targets ([#5174](https://github.com/getsentry/sentry-react-native/pull/5174))
14+
- If you are not interested in using Session Replay, you can exclude the `sentry-android-replay` module from your Android targets as follows (saves nearly 40KB compressed and 80KB uncompressed off the bundle size):
15+
16+
```gradle
17+
// from the android's root build.gradle file
18+
subprojects {
19+
configurations.all {
20+
exclude group: 'io.sentry', module: 'sentry-android-replay'
21+
}
22+
}
23+
```
24+
25+
### Fixes
26+
1327
- Session Replay: Allow excluding `sentry-android-replay` from android targets ([#5174](https://github.com/getsentry/sentry-react-native/pull/5174))
1428
- If you are not interested in using Session Replay, you can exclude the `sentry-android-replay` module from your Android targets as follows (saves nearly 40KB compressed and 80KB uncompressed off the bundle size):
1529

File renamed without changes.

samples/react-native/Gemfile.lock

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ GEM
55
base64
66
nkf
77
rexml
8-
activesupport (7.0.8.6)
8+
activesupport (6.1.7.10)
99
concurrent-ruby (~> 1.0, >= 1.0.2)
1010
i18n (>= 1.6, < 2)
1111
minitest (>= 5.1)
1212
tzinfo (~> 2.0)
13+
zeitwerk (~> 2.3)
1314
addressable (2.8.7)
1415
public_suffix (>= 2.0.2, < 7.0)
1516
algoliasearch (1.27.5)
@@ -83,13 +84,14 @@ GEM
8384
declarative (0.0.20)
8485
digest-crc (0.6.5)
8586
rake (>= 12.0.0, < 14.0.0)
86-
domain_name (0.6.20240107)
87+
domain_name (0.5.20190701)
88+
unf (>= 0.0.5, < 1.0.0)
8789
dotenv (2.8.1)
8890
emoji_regex (3.2.3)
8991
escape (0.0.4)
9092
ethon (0.16.0)
9193
ffi (>= 1.15.0)
92-
excon (0.112.0)
94+
excon (0.109.0)
9395
faraday (1.10.4)
9496
faraday-em_http (~> 1.0)
9597
faraday-em_synchrony (~> 1.0)
@@ -161,6 +163,8 @@ GEM
161163
xcpretty (~> 0.3.0)
162164
xcpretty-travis-formatter (>= 0.0.3, < 2.0.0)
163165
ffi (1.17.0)
166+
ffi (1.17.0-arm64-darwin)
167+
ffi (1.17.0-x86_64-darwin)
164168
fourflusher (2.3.1)
165169
fuzzy_match (2.0.4)
166170
gh_inspector (1.1.3)
@@ -180,28 +184,27 @@ GEM
180184
google-apis-core (>= 0.11.0, < 2.a)
181185
google-apis-storage_v1 (0.31.0)
182186
google-apis-core (>= 0.11.0, < 2.a)
183-
google-cloud-core (1.7.1)
184-
google-cloud-env (>= 1.0, < 3.a)
185-
google-cloud-errors (~> 1.0)
187+
google-cloud-core (1.4.1)
188+
google-cloud-env (~> 1.0)
186189
google-cloud-env (1.6.0)
187190
faraday (>= 0.17.3, < 3.0)
188-
google-cloud-errors (1.4.0)
189-
google-cloud-storage (1.47.0)
190-
addressable (~> 2.8)
191+
google-cloud-storage (1.31.1)
192+
addressable (~> 2.5)
191193
digest-crc (~> 0.4)
192194
google-apis-iamcredentials_v1 (~> 0.1)
193-
google-apis-storage_v1 (~> 0.31.0)
194-
google-cloud-core (~> 1.6)
195-
googleauth (>= 0.16.2, < 2.a)
195+
google-apis-storage_v1 (~> 0.1)
196+
google-cloud-core (~> 1.2)
197+
googleauth (~> 0.9)
196198
mini_mime (~> 1.0)
197-
googleauth (1.8.1)
198-
faraday (>= 0.17.3, < 3.a)
199+
googleauth (0.17.1)
200+
faraday (>= 0.17.3, < 2.0)
199201
jwt (>= 1.4, < 3.0)
202+
memoist (~> 0.16)
200203
multi_json (~> 1.11)
201204
os (>= 0.9, < 2.0)
202-
signet (>= 0.16, < 2.a)
205+
signet (~> 0.15)
203206
highline (2.0.3)
204-
http-cookie (1.0.7)
207+
http-cookie (1.0.8)
205208
domain_name (~> 0.5)
206209
httpclient (2.8.3)
207210
i18n (1.14.6)
@@ -211,6 +214,7 @@ GEM
211214
jwt (2.9.3)
212215
base64
213216
logger (1.7.0)
217+
memoist (0.16.2)
214218
mini_magick (4.13.2)
215219
mini_mime (1.1.5)
216220
minitest (5.25.1)
@@ -239,7 +243,7 @@ GEM
239243
ruby2_keywords (0.0.5)
240244
rubyzip (2.3.2)
241245
security (0.1.5)
242-
signet (0.19.0)
246+
signet (0.18.0)
243247
addressable (~> 2.8)
244248
faraday (>= 0.17.5, < 3.a)
245249
jwt (>= 1.5, < 3.0)
@@ -260,6 +264,7 @@ GEM
260264
tzinfo (2.0.6)
261265
concurrent-ruby (~> 1.0)
262266
uber (0.1.0)
267+
unf (0.2.0)
263268
unicode-display_width (2.6.0)
264269
word_wrap (1.0.0)
265270
xcodeproj (1.25.1)
@@ -273,11 +278,13 @@ GEM
273278
rouge (~> 2.0.7)
274279
xcpretty-travis-formatter (1.0.1)
275280
xcpretty (~> 0.2, >= 0.0.7)
281+
zeitwerk (2.6.18)
276282

277283
PLATFORMS
278284
arm64-darwin-22
279285
arm64-darwin-23
280286
arm64-darwin-24
287+
ruby
281288
x86_64-darwin-20
282289

283290
DEPENDENCIES

samples/react-native/android/app/build.gradle

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ apply plugin: "org.jetbrains.kotlin.android"
33
apply plugin: "com.facebook.react"
44
apply plugin: "io.sentry.android.gradle"
55

6-
project.ext.vectoricons = [
7-
iconFontNames: [ 'Ionicons.ttf' ] // Specify font files
8-
]
9-
10-
apply from: file("../../node_modules/react-native-vector-icons/fonts.gradle")
11-
126
def sentryReactNativePath = ["node", "--print", "require('path').dirname(require.resolve('@sentry/react-native/package.json'))"].execute(null, rootDir).text.trim()
137

148
project.ext.sentryCli = [

samples/react-native/android/app/src/main/java/io/sentry/reactnative/sample/SamplePackage.java

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

33
import com.facebook.react.ReactPackage;
44
import com.facebook.react.bridge.NativeModule;
5+
import com.facebook.react.bridge.Promise;
56
import com.facebook.react.bridge.ReactApplicationContext;
67
import com.facebook.react.bridge.ReactContextBaseJavaModule;
78
import com.facebook.react.bridge.ReactMethod;
@@ -66,9 +67,9 @@ public void crashOrUndefined() {
6667
}
6768

6869
@ReactMethod
69-
public int crashOrNumber() {
70+
public void crashOrNumber(Promise promise) {
7071
this.crashNow();
71-
return 42;
72+
promise.resolve(42);
7273
}
7374

7475
private void crashNow() {
59 Bytes
Binary file not shown.

samples/react-native/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.13-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

samples/react-native/e2e/captureErrorsScreenTransaction.test.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,10 @@ describe('Capture Errors Screen Transaction', () => {
7676
expect(item?.[1]).toEqual(
7777
expect.objectContaining({
7878
measurements: expect.objectContaining({
79-
time_to_initial_display: {
79+
time_to_initial_display: expect.objectContaining({
8080
unit: 'millisecond',
8181
value: expect.any(Number),
82-
},
83-
app_start_cold: {
84-
unit: 'millisecond',
85-
value: expect.any(Number),
86-
},
82+
}),
8783
}),
8884
}),
8985
);
@@ -98,10 +94,10 @@ describe('Capture Errors Screen Transaction', () => {
9894
expect(item?.[1]).toEqual(
9995
expect.objectContaining({
10096
measurements: expect.objectContaining({
101-
time_to_initial_display: {
97+
time_to_initial_display: expect.objectContaining({
10298
unit: 'millisecond',
10399
value: expect.any(Number),
104-
},
100+
}),
105101
}),
106102
}),
107103
);
@@ -116,18 +112,18 @@ describe('Capture Errors Screen Transaction', () => {
116112
expect(item?.[1]).toEqual(
117113
expect.objectContaining({
118114
measurements: expect.objectContaining({
119-
stall_count: {
115+
stall_count: expect.objectContaining({
120116
unit: 'none',
121117
value: expect.any(Number),
122-
},
123-
stall_longest_time: {
118+
}),
119+
stall_longest_time: expect.objectContaining({
124120
unit: 'millisecond',
125121
value: expect.any(Number),
126-
},
127-
stall_total_time: {
122+
}),
123+
stall_total_time: expect.objectContaining({
128124
unit: 'millisecond',
129125
value: expect.any(Number),
130-
},
126+
}),
131127
}),
132128
}),
133129
);

samples/react-native/e2e/utils/maestro.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const maestro = async (test: string) => {
1313
cwd: path.join(__dirname, '..'),
1414
stdio: 'inherit',
1515
});
16-
1716
process.on('close', code => {
1817
if (code !== 0) {
1918
reject(`Maestro test failed with code ${code}. See logs above.`);

samples/react-native/ios/.xcode.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# Customize the NODE_BINARY variable here.
99
# For example, to use nvm with brew, add the following line
10-
#. "$(brew --prefix nvm)/nvm.sh" --no-use
10+
# . "$(brew --prefix nvm)/nvm.sh" --no-use
1111
export NODE_BINARY=$(command -v node)
1212

1313
export EXTRA_COMPILER_ARGS="-w"

0 commit comments

Comments
 (0)