Skip to content

Commit 6b9147b

Browse files
Merge f96cf53 into 9d86532
2 parents 9d86532 + f96cf53 commit 6b9147b

File tree

62 files changed

+2856
-102
lines changed

Some content is hidden

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

62 files changed

+2856
-102
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,3 +74,6 @@ yalc.lock
7474

7575
# E2E tests
7676
test/react-native/versions
77+
78+
# Created by Sentry Metro Plugin
79+
.sentry/

CHANGELOG.md

Lines changed: 99 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,31 @@
22

33
## Unreleased
44

5+
### Features
6+
7+
- Redact `react-native-svg` SVGs when `maskAllVectors` ([#3930](https://github.com/getsentry/sentry-react-native/pull/3930))
8+
- Add `annotateReactComponents` option to `@sentry/react-native/metro` ([#3916](https://github.com/getsentry/sentry-react-native/pull/3916))
9+
10+
```js
11+
// For Expo
12+
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
13+
const config = getSentryExpoConfig(__dirname, { annotateReactComponents: true });
14+
15+
// For RN
16+
const { getDefaultConfig } = require('@react-native/metro-config');
17+
const { withSentryConfig } = require('@sentry/react-native/metro');
18+
module.exports = withSentryConfig(getDefaultConfig(__dirname), { annotateReactComponents: true });
19+
```
20+
21+
### Fixes
22+
23+
- Add `app.foreground/background` breadcrumbs to iOS Replays ([#3932](https://github.com/getsentry/sentry-react-native/pull/3932))
24+
525
### Dependencies
626

27+
- Bump Android SDK from v7.11.0-alpha.2 to v7.12.0-alpha.4 ([#3830](https://github.com/getsentry/sentry-react-native/pull/3830))
28+
- [changelog](https://github.com/getsentry/sentry-java/blob/7.12.0-alpha.3/CHANGELOG.md#7120-alpha4)
29+
- [diff](https://github.com/getsentry/sentry-java/compare/7.11.0-alpha.2...7.12.0-alpha.4)
730
- Bump Cocoa SDK from v8.30.0 to v8.30.1 ([#3936](https://github.com/getsentry/sentry-react-native/pull/3936))
831
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8301)
932
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.30.0...8.30.1)
@@ -31,6 +54,30 @@
3154
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#7110)
3255
- [diff](https://github.com/getsentry/sentry-java/compare/7.10.0...7.11.0)
3356

57+
## 5.25.0-alpha.2
58+
59+
### Features
60+
61+
- Improve touch event component info if annotated with [`@sentry/babel-plugin-component-annotate`](https://www.npmjs.com/package/@sentry/babel-plugin-component-annotate) ([#3899](https://github.com/getsentry/sentry-react-native/pull/3899))
62+
- Add replay breadcrumbs for touch & navigation events ([#3846](https://github.com/getsentry/sentry-react-native/pull/3846))
63+
- Add network data to Session Replays ([#3912](https://github.com/getsentry/sentry-react-native/pull/3912))
64+
- Filter Sentry Event Breadcrumbs from Mobile Replays ([#3925](https://github.com/getsentry/sentry-react-native/pull/3925))
65+
66+
### Fixes
67+
68+
- `sentry-expo-upload-sourcemaps` no longer requires Sentry url when uploading sourcemaps to `sentry.io` ([#3915](https://github.com/getsentry/sentry-react-native/pull/3915))
69+
70+
### Dependencies
71+
72+
- Bump Cocoa SDK from v8.25.0-alpha.0 to v8.30.0 ([#3914](https://github.com/getsentry/sentry-react-native/pull/3914))
73+
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8300)
74+
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.25.0-alpha.0...8.30.0)
75+
- Bump Android SDK from v7.9.0-alpha.1 to v7.11.0-alpha.2 ([#3830](https://github.com/getsentry/sentry-react-native/pull/3830))
76+
- [changelog](https://github.com/getsentry/sentry-java/blob/7.11.0-alpha.2/CHANGELOG.md#7110-alpha2)
77+
- [diff](https://github.com/getsentry/sentry-java/compare/7.9.0-alpha.1...7.11.0-alpha.2)
78+
79+
Access to Mobile Replay is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)
80+
3481
## 5.24.1
3582

3683
### Fixes
@@ -130,6 +177,14 @@ This release does *not* build on iOS. Please use `5.23.1` or newer.
130177
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8270)
131178
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.26.0...8.27.0)
132179

180+
## 5.23.0-alpha.1
181+
182+
### Fixes
183+
184+
- Pass `replaysSessionSampleRate` option to Android ([#3714](https://github.com/getsentry/sentry-react-native/pull/3714))
185+
186+
Access to Mobile Replay is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)
187+
133188
## 5.22.3
134189

135190
### Fixes
@@ -163,6 +218,47 @@ This release does *not* build on iOS. Please use `5.23.1` or newer.
163218
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8250)
164219
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.24.0...8.25.0)
165220

221+
## 5.23.0-alpha.0
222+
223+
### Features
224+
225+
- Mobile Session Replay Alpha ([#3714](https://github.com/getsentry/sentry-react-native/pull/3714))
226+
227+
To enable Replay for React Native on mobile and web add the following options.
228+
229+
```js
230+
Sentry.init({
231+
_experiments: {
232+
replaysSessionSampleRate: 1.0,
233+
replaysOnErrorSampleRate: 1.0,
234+
},
235+
});
236+
```
237+
238+
To change the default Mobile Replay options add the `mobileReplayIntegration`.
239+
240+
```js
241+
Sentry.init({
242+
_experiments: {
243+
replaysSessionSampleRate: 1.0,
244+
replaysOnErrorSampleRate: 1.0,
245+
},
246+
integration: [
247+
Sentry.mobileReplayIntegration({
248+
maskAllText: true,
249+
maskAllImages: true,
250+
}),
251+
],
252+
});
253+
```
254+
255+
Access is limited to early access orgs on Sentry. If you're interested, [sign up for the waitlist](https://sentry.io/lp/mobile-replay-beta/)
256+
257+
### Dependencies
258+
259+
- Bump Cocoa SDK to [8.25.0-alpha.0](https://github.com/getsentry/sentry-cocoa/releases/tag/8.25.0-alpha.0)
260+
- Bump Android SDK to [7.9.0-alpha.1](https://github.com/getsentry/sentry-java/releases/tag/7.9.0-alpha.1)
261+
166262
## 5.22.0
167263

168264
### Features
@@ -441,7 +537,7 @@ see [the Expo guide](https://docs.sentry.io/platforms/react-native/manual-setup/
441537
const { getSentryExpoConfig } = require("@sentry/react-native/metro");
442538

443539
// const config = getDefaultConfig(__dirname);
444-
const config = getSentryExpoConfig(config, {});
540+
const config = getSentryExpoConfig(__dirname);
445541
```
446542

447543
- New `npx sentry-expo-upload-sourcemaps` for simple EAS Update (`npx expo export`) source maps upload ([#3491](https://github.com/getsentry/sentry-react-native/pull/3491), [#3510](https://github.com/getsentry/sentry-react-native/pull/3510), [#3515](https://github.com/getsentry/sentry-react-native/pull/3515), [#3507](https://github.com/getsentry/sentry-react-native/pull/3507))
@@ -673,7 +769,7 @@ This release is compatible with `[email protected]` and newer.
673769
});
674770
```
675771

676-
Read more at https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7690
772+
Read more at <https://github.com/getsentry/sentry-javascript/blob/develop/CHANGELOG.md#7690>
677773

678774
- Report current screen in `contexts.app.view_names` ([#3339](https://github.com/getsentry/sentry-react-native/pull/3339))
679775

@@ -2712,7 +2808,7 @@ We are looking into ways making this more stable and plan to re-enable it again
27122808

27132809
## v0.23.2
27142810

2715-
- Fixed #228 again ¯\\_(ツ)_
2811+
- Fixed #228 again ¯\\*(ツ)*
27162812

27172813
## v0.23.1
27182814

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
package io.sentry.rnsentryandroidtester
2+
3+
import io.sentry.Breadcrumb
4+
import io.sentry.react.RNSentryReplayBreadcrumbConverter
5+
import io.sentry.rrweb.RRWebBreadcrumbEvent
6+
import org.junit.Assert.assertEquals
7+
import org.junit.Test
8+
import org.junit.runner.RunWith
9+
import org.junit.runners.JUnit4
10+
11+
@RunWith(JUnit4::class)
12+
class RNSentryReplayBreadcrumbConverterTest {
13+
14+
@Test
15+
fun testConvertForegroundBreadcrumb() {
16+
val converter = RNSentryReplayBreadcrumbConverter()
17+
val testBreadcrumb = Breadcrumb()
18+
testBreadcrumb.type = "navigation"
19+
testBreadcrumb.category = "app.lifecycle"
20+
testBreadcrumb.setData("state", "foreground");
21+
val actual = converter.convert(testBreadcrumb) as RRWebBreadcrumbEvent
22+
23+
assertEquals("app.foreground", actual.category)
24+
}
25+
26+
@Test
27+
fun testConvertBackgroundBreadcrumb() {
28+
val converter = RNSentryReplayBreadcrumbConverter()
29+
val testBreadcrumb = Breadcrumb()
30+
testBreadcrumb.type = "navigation"
31+
testBreadcrumb.category = "app.lifecycle"
32+
testBreadcrumb.setData("state", "background");
33+
val actual = converter.convert(testBreadcrumb) as RRWebBreadcrumbEvent
34+
35+
assertEquals("app.background", actual.category)
36+
}
37+
38+
@Test
39+
fun doesNotConvertSentryEventBreadcrumb() {
40+
val converter = RNSentryReplayBreadcrumbConverter()
41+
val testBreadcrumb = Breadcrumb();
42+
testBreadcrumb.category = "sentry.event"
43+
val actual = converter.convert(testBreadcrumb)
44+
assertEquals(null, actual)
45+
}
46+
47+
@Test
48+
fun doesNotConvertSentryTransactionBreadcrumb() {
49+
val converter = RNSentryReplayBreadcrumbConverter()
50+
val testBreadcrumb = Breadcrumb();
51+
testBreadcrumb.category = "sentry.transaction"
52+
val actual = converter.convert(testBreadcrumb)
53+
assertEquals(null, actual)
54+
}
55+
56+
@Test
57+
fun doesNotConvertNullPath() {
58+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(null)
59+
assertEquals(null, actual)
60+
}
61+
62+
@Test
63+
fun doesNotConvertPathContainingNull() {
64+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(arrayListOf(arrayOfNulls<Any>(1)))
65+
assertEquals(null, actual)
66+
}
67+
68+
@Test
69+
fun doesNotConvertPathWithValuesMissingNameAndLevel() {
70+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(arrayListOf(mapOf(
71+
"element" to "element4",
72+
"file" to "file4")))
73+
assertEquals(null, actual)
74+
}
75+
76+
@Test
77+
fun doesConvertValidPathExample1() {
78+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(listOf(
79+
mapOf("label" to "label0"),
80+
mapOf("name" to "name1"),
81+
mapOf("name" to "item2", "label" to "label2"),
82+
mapOf("name" to "item3", "label" to "label3", "element" to "element3"),
83+
mapOf("name" to "item4", "label" to "label4", "file" to "file4"),
84+
mapOf("name" to "item5", "label" to "label5", "element" to "element5", "file" to "file5")))
85+
assertEquals("label3(element3) > label2 > name1 > label0", actual)
86+
}
87+
88+
@Test
89+
fun doesConvertValidPathExample2() {
90+
val actual = RNSentryReplayBreadcrumbConverter.getTouchPathMessage(listOf(
91+
mapOf("name" to "item2", "label" to "label2"),
92+
mapOf("name" to "item3", "label" to "label3", "element" to "element3"),
93+
mapOf("name" to "item4", "label" to "label4", "file" to "file4"),
94+
mapOf("name" to "item5", "label" to "label5", "element" to "element5", "file" to "file5"),
95+
mapOf("label" to "label6"),
96+
mapOf("name" to "name7")))
97+
assertEquals("label5(element5, file5) > label4(file4) > label3(element3) > label2", actual)
98+
}
99+
}

RNSentryCocoaTester/RNSentryCocoaTester.xcodeproj/project.pbxproj

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
3360843D2C340C76008CC412 /* RNSentryBreadcrumbTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3360843C2C340C76008CC412 /* RNSentryBreadcrumbTests.swift */; };
10+
330F308C2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 330F308B2C0F3840002A0D4E /* RNSentryBreadcrumbTests.m */; };
11+
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */; };
1112
33958C692BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33958C682BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m */; };
1213
33AFDFED2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AFDFEC2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m */; };
1314
33AFDFF12B8D15E500AAB120 /* RNSentryDependencyContainerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 33AFDFF02B8D15E500AAB120 /* RNSentryDependencyContainerTests.m */; };
@@ -18,7 +19,9 @@
1819
/* Begin PBXFileReference section */
1920
1482D5685A340AB93348A43D /* Pods-RNSentryCocoaTesterTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNSentryCocoaTesterTests.release.xcconfig"; path = "Target Support Files/Pods-RNSentryCocoaTesterTests/Pods-RNSentryCocoaTesterTests.release.xcconfig"; sourceTree = "<group>"; };
2021
330F308D2C0F385A002A0D4E /* RNSentryBreadcrumb.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryBreadcrumb.h; path = ../ios/RNSentryBreadcrumb.h; sourceTree = "<group>"; };
21-
3360843B2C340C75008CC412 /* RNSentryCocoaTesterTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNSentryCocoaTesterTests-Bridging-Header.h"; sourceTree = "<group>"; };
22+
336084372C32E382008CC412 /* RNSentryCocoaTesterTests-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RNSentryCocoaTesterTests-Bridging-Header.h"; sourceTree = "<group>"; };
23+
336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RNSentryReplayBreadcrumbConverterTests.swift; sourceTree = "<group>"; };
24+
3360843A2C32E3A8008CC412 /* RNSentryReplayBreadcrumbConverter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNSentryReplayBreadcrumbConverter.h; path = ../ios/RNSentryReplayBreadcrumbConverter.h; sourceTree = "<group>"; };
2225
3360843C2C340C76008CC412 /* RNSentryBreadcrumbTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RNSentryBreadcrumbTests.swift; sourceTree = "<group>"; };
2326
3360898D29524164007C7730 /* RNSentryCocoaTesterTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNSentryCocoaTesterTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
2427
338739072A7D7D2800950DDD /* RNSentryTests.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNSentryTests.h; sourceTree = "<group>"; };
@@ -77,6 +80,7 @@
7780
3360899029524164007C7730 /* RNSentryCocoaTesterTests */ = {
7881
isa = PBXGroup;
7982
children = (
83+
336084382C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift */,
8084
33F58ACF2977037D008F60EA /* RNSentryTests.mm */,
8185
338739072A7D7D2800950DDD /* RNSentryTests.h */,
8286
33AFDFEC2B8D14B300AAB120 /* RNSentryFramesTrackerListenerTests.m */,
@@ -93,6 +97,7 @@
9397
33AFE0122B8F319000AAB120 /* RNSentry */ = {
9498
isa = PBXGroup;
9599
children = (
100+
3360843A2C32E3A8008CC412 /* RNSentryReplayBreadcrumbConverter.h */,
96101
330F308D2C0F385A002A0D4E /* RNSentryBreadcrumb.h */,
97102
33958C672BFCEF5A00AD1FB6 /* RNSentryOnDrawReporter.h */,
98103
33AFE0132B8F31AF00AAB120 /* RNSentryDependencyContainer.h */,
@@ -136,6 +141,7 @@
136141
isa = PBXProject;
137142
attributes = {
138143
BuildIndependentTargetsInParallel = 1;
144+
LastSwiftUpdateCheck = 1540;
139145
LastUpgradeCheck = 1420;
140146
TargetAttributes = {
141147
3360898C29524164007C7730 = {
@@ -210,6 +216,7 @@
210216
buildActionMask = 2147483647;
211217
files = (
212218
33AFDFF12B8D15E500AAB120 /* RNSentryDependencyContainerTests.m in Sources */,
219+
336084392C32E382008CC412 /* RNSentryReplayBreadcrumbConverterTests.swift in Sources */,
213220
33F58AD02977037D008F60EA /* RNSentryTests.mm in Sources */,
214221
33958C692BFCF12600AD1FB6 /* RNSentryOnDrawReporterTests.m in Sources */,
215222
3360843D2C340C76008CC412 /* RNSentryBreadcrumbTests.swift in Sources */,
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
5+
#import "RNSentryReplayBreadcrumbConverter.h"
16
#import "RNSentryBreadcrumb.h"

0 commit comments

Comments
 (0)