Skip to content

Commit 7c3ec38

Browse files
author
getsentry-bot
committed
Merge branch 'release/3.0.0-beta.1'
2 parents 84501db + 43ba90e commit 7c3ec38

Some content is hidden

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

68 files changed

+3144
-650
lines changed

CHANGELOG.md

Lines changed: 101 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,106 @@
66
> [migration guide](https://docs.sentry.io/platforms/javascript/guides/capacitor/migration/) first.
77
<!-- prettier-ignore-end -->
88
9+
## 3.0.0-beta.1
10+
11+
### Break Changes
12+
13+
#### Sentry JavaScript V10
14+
15+
Version 10 of the Sentry JavaScript SDK primarily focuses on upgrading underlying OpenTelemetry dependencies to v2 with minimal breaking changes.
16+
17+
Version 10 of the SDK is compatible with Sentry self-hosted versions 24.4.2 or higher (unchanged from v9). Lower versions may continue to work, but may not support all features.
18+
19+
### Init changed for Sentry Vue and Nuxt
20+
21+
Instead of adding the Nuxt/Vue options into Sentry.init options, you will now have to add it inside `siblingOptions`, this only applies to parameters specific to the respective SDK, other SDKs like React or Angular won't have to do that:
22+
23+
before
24+
25+
```typescript
26+
Sentry.init({
27+
app: app,
28+
attachErrorHandler: false,
29+
dsn: '...',
30+
enableLogs: true,...
31+
}, vueInit);
32+
```
33+
34+
after
35+
36+
```typescript
37+
Sentry.init({
38+
dsn: '...',
39+
enableLogs: true,
40+
siblingOptions: {
41+
vueOptions: {
42+
app: app,
43+
attachErrorHandler: false,
44+
...
45+
}
46+
},
47+
...
48+
}, vueInit);
49+
50+
```
51+
52+
### Features
53+
54+
- Add experimental Metric support for Web and iOS ([#1055](https://github.com/getsentry/sentry-capacitor/pull/1055))
55+
- Add Fallback to JavaScript SDK when Native SDK fails to initialize ([#1043](https://github.com/getsentry/sentry-capacitor/pull/1043))
56+
- Add spotlight integration `spotlightIntegration`. ([#1039](https://github.com/getsentry/sentry-capacitor/pull/1039))
57+
58+
### Fixes
59+
60+
- Added missing integrations `inboundFiltersIntegration`, `functionToStringIntegration`, `browserApiErrorsIntegration`, `breadcrumbsIntegration`, `globalHandlersIntegration`, `linkedErrorsIntegration`, `dedupeIntegration` and `browserSessionIntegration` ([#1047](https://github.com/getsentry/sentry-capacitor/pull/1047))
61+
- This fixes the following option parameters that weren't working: `ignoreErrors`, `ignoreTransactions`, `allowUrls`, `denyUrls`
62+
- For more information about the Integrations, check the following link: https://docs.sentry.io/platforms/javascript/configuration/integrations.
63+
64+
- Breadcrumbs are now showing and are tied with native breadcrumbs too ([#1047](https://github.com/getsentry/sentry-capacitor/pull/1047))
65+
- Init now showing the correct JSDoc for Vue/Nuxt init parameters. ([#1046](https://github.com/getsentry/sentry-capacitor/pull/1046))
66+
- Replays/Logs/Sessions now have the `capacitor` SDK name as the source of the event. ([#1043](https://github.com/getsentry/sentry-capacitor/pull/1043))
67+
- Sentry Capacitor integrations are now exposed to `@sentry/capacitor` ([#1039](https://github.com/getsentry/sentry-capacitor/pull/1039))
68+
69+
### Removed APIs
70+
71+
The changes outlined in this section detail deprecated APIs that are now removed.
72+
73+
* BaseClient was removed, use Client as a direct replacement.
74+
* hasTracingEnabled was removed, use hasSpansEnabled as a direct replacement.
75+
* The internal logger and type Logger exports in @sentry/core were removed, use debug and type SentryDebugLogger instead. This does not affect the logger export used for [Sentry Logging](https://docs.sentry.io/product/explore/logs/getting-started/).
76+
* The _experiments.enableLogs and _experiments.beforeSendLog options were removed, use the top-level enableLogs and beforeSendLog options instead.
77+
78+
```JavaScript
79+
// before
80+
Sentry.init({
81+
_experiments: {
82+
enableLogs: true,
83+
beforeSendLog: (log) => {
84+
return log;
85+
},
86+
},
87+
});
88+
// after
89+
Sentry.init({
90+
enableLogs: true,
91+
beforeSendLog: (log) => {
92+
return log;
93+
},
94+
});
95+
```
96+
97+
### Removed Options
98+
99+
- `_experimental.enableLogs` was removed, please use the options `enableLogs` from `CapacitorOptions`.
100+
101+
For more informations, please go to the following link: https://docs.sentry.io/platforms/javascript/migration/v9-to-v10
102+
103+
### Dependencies
104+
105+
- Bump JavaScript Sibling SDKs from v9.46.0 to v10.27.0 ([#1013](https://github.com/getsentry/sentry-capacitor/pull/1013), [#1028](https://github.com/getsentry/sentry-capacitor/pull/1028))
106+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/10.27.0/CHANGELOG.md)
107+
- [diff](https://github.com/getsentry/sentry-javascript/compare/9.46.0...10.27.0)
108+
9109
## 2.4.1
10110

11111
### Fixes
@@ -23,7 +123,7 @@
23123
- Bump Cocoa SDK from v8.55.0 to v8.56.2 ([#967](https://github.com/getsentry/sentry-capacitor/pull/967))
24124
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#8562)
25125
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.55.0...8.56.2)
26-
- Bump Android SDK from v8.21.0 to v8.23.0 ([#972](https://github.com/getsentry/sentry-capacitor/pull/972), [#990](https://github.com/getsentry/sentry-capacitor/pull/990))
126+
- Bump Android SDK from v8.21.0 to v8.28.0 ([#972](https://github.com/getsentry/sentry-capacitor/pull/972), [#990](https://github.com/getsentry/sentry-capacitor/pull/990), [#1054](https://github.com/getsentry/sentry-capacitor/pull/1054))
27127
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#8230)
28128
- [diff](https://github.com/getsentry/sentry-java/compare/8.21.0...8.23.0)
29129

CONTRIBUTING.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,22 @@ See the readmes in the specific example app folders for individual instructions:
4949
- [ionic-angular-v2](example/ionic-angular-v2/README.md)
5050
- [ionic-angular-v3](example/ionic-angular/README.md)
5151

52+
### Spotlight
53+
54+
In order to test Spotlight, modify the file environment.local.ts or local.ts from the sample apps with the following value:
55+
56+
```typescript
57+
export const localConfig = {
58+
spotlightSidecarUrl: 'http://IP:8969/stream', // replace IP by your local IP.
59+
};
60+
```
61+
62+
If the file is not present on your sample app, it will be automatically generated on the first build from the sample app.
63+
64+
For running Spotlight, please check the website `https://github.com/getsentry/spotlight/releases` and download the latest `@spotlightjs/sidecar`.
65+
66+
NOTE: When testing spotlight on a device that is not the physical device where spotlight server is running, don't forget to expose the port 8969 for TCP.
67+
5268
## Testing
5369

5470
```sh

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ repositories {
7676

7777
dependencies {
7878
implementation project(':capacitor-android')
79-
implementation 'io.sentry:sentry-android:8.23.0'
79+
implementation 'io.sentry:sentry-android:8.28.0'
8080
}
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
package io.sentry.capacitor;
2+
3+
import java.math.BigDecimal;
4+
import java.math.BigInteger;
5+
import java.util.List;
6+
import java.util.Map;
7+
8+
import com.getcapacitor.JSObject;
9+
import org.json.JSONArray;
10+
import org.json.JSONObject;
11+
12+
import io.sentry.ILogger;
13+
import io.sentry.SentryLevel;
14+
import io.sentry.android.core.AndroidLogger;
15+
16+
public final class CapSentryMapConverter {
17+
public static final String NAME = "CapSentry.MapConverter";
18+
private static final ILogger logger = new AndroidLogger(NAME);
19+
20+
private CapSentryMapConverter() {
21+
throw new AssertionError("Utility class should not be instantiated");
22+
}
23+
24+
public static Object convertToWritable(Object serialized) {
25+
if (serialized instanceof List) {
26+
JSONArray writable = new JSONArray();
27+
for (Object item : (List<?>) serialized) {
28+
addValueToWritableArray(writable, convertToWritable(item));
29+
}
30+
return writable;
31+
} else if (serialized instanceof Map) {
32+
JSObject writable = new JSObject();
33+
for (Map.Entry<?, ?> entry : ((Map<?, ?>) serialized).entrySet()) {
34+
Object key = entry.getKey();
35+
Object value = entry.getValue();
36+
37+
if (key instanceof String) {
38+
addValueToWritableMap(writable, (String) key, convertToWritable(value));
39+
} else {
40+
logger.log(SentryLevel.ERROR, "Only String keys are supported in Map.", key);
41+
}
42+
}
43+
return writable;
44+
} else if (serialized instanceof Byte) {
45+
return Integer.valueOf((Byte) serialized);
46+
} else if (serialized instanceof Short) {
47+
return Integer.valueOf((Short) serialized);
48+
} else if (serialized instanceof Float) {
49+
return Double.valueOf((Float) serialized);
50+
} else if (serialized instanceof Long) {
51+
return Double.valueOf((Long) serialized);
52+
} else if (serialized instanceof BigInteger) {
53+
return ((BigInteger) serialized).doubleValue();
54+
} else if (serialized instanceof BigDecimal) {
55+
return ((BigDecimal) serialized).doubleValue();
56+
} else if (serialized instanceof Integer
57+
|| serialized instanceof Double
58+
|| serialized instanceof Boolean
59+
|| serialized == null
60+
|| serialized instanceof String) {
61+
return serialized;
62+
} else {
63+
logger.log(
64+
SentryLevel.ERROR, "Supplied serialized value could not be converted." + serialized);
65+
return null;
66+
}
67+
}
68+
69+
private static void addValueToWritableArray(JSONArray writableArray, Object value) {
70+
try {
71+
if (value == null) {
72+
writableArray.put(JSONObject.NULL);
73+
} else if (value instanceof Boolean) {
74+
writableArray.put((Boolean) value);
75+
} else if (value instanceof Double) {
76+
writableArray.put((Double) value);
77+
} else if (value instanceof Float) {
78+
writableArray.put(((Float) value).doubleValue());
79+
} else if (value instanceof Integer) {
80+
writableArray.put((Integer) value);
81+
} else if (value instanceof Short) {
82+
writableArray.put(((Short) value).intValue());
83+
} else if (value instanceof Byte) {
84+
writableArray.put(((Byte) value).intValue());
85+
} else if (value instanceof Long) {
86+
writableArray.put(((Long) value).doubleValue());
87+
} else if (value instanceof BigInteger) {
88+
writableArray.put(((BigInteger) value).doubleValue());
89+
} else if (value instanceof BigDecimal) {
90+
writableArray.put(((BigDecimal) value).doubleValue());
91+
} else if (value instanceof String) {
92+
writableArray.put((String) value);
93+
} else if (value instanceof JSObject || value instanceof JSONObject) {
94+
writableArray.put(value instanceof JSObject ? (JSObject) value : (JSONObject) value);
95+
} else if (value instanceof JSONArray) {
96+
writableArray.put((JSONArray) value);
97+
} else {
98+
logger.log(SentryLevel.ERROR, "Could not convert object: " + value);
99+
}
100+
} catch (Exception e) {
101+
logger.log(SentryLevel.ERROR, "Error adding value to array: " + e.getMessage(), e);
102+
}
103+
}
104+
105+
private static void addValueToWritableMap(JSObject writableMap, String key, Object value) {
106+
try {
107+
if (value == null) {
108+
writableMap.put(key, JSONObject.NULL);
109+
} else if (value instanceof Boolean) {
110+
writableMap.put(key, (Boolean) value);
111+
} else if (value instanceof Double) {
112+
writableMap.put(key, (Double) value);
113+
} else if (value instanceof Float) {
114+
writableMap.put(key, ((Float) value).doubleValue());
115+
} else if (value instanceof Integer) {
116+
writableMap.put(key, (Integer) value);
117+
} else if (value instanceof Short) {
118+
writableMap.put(key, ((Short) value).intValue());
119+
} else if (value instanceof Byte) {
120+
writableMap.put(key, ((Byte) value).intValue());
121+
} else if (value instanceof Long) {
122+
writableMap.put(key, ((Long) value).doubleValue());
123+
} else if (value instanceof BigInteger) {
124+
writableMap.put(key, ((BigInteger) value).doubleValue());
125+
} else if (value instanceof BigDecimal) {
126+
writableMap.put(key, ((BigDecimal) value).doubleValue());
127+
} else if (value instanceof String) {
128+
writableMap.put(key, (String) value);
129+
} else if (value instanceof JSONArray) {
130+
writableMap.put(key, (JSONArray) value);
131+
} else if (value instanceof JSObject || value instanceof JSONObject) {
132+
writableMap.put(key, value instanceof JSObject ? (JSObject) value : (JSONObject) value);
133+
} else {
134+
logger.log(SentryLevel.ERROR, "Could not convert object: " + value);
135+
}
136+
} catch (Exception e) {
137+
logger.log(SentryLevel.ERROR, "Error adding value to map: " + e.getMessage(), e);
138+
}
139+
}
140+
}

0 commit comments

Comments
 (0)