@sentry/svelte 9.37.0 → 9.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/debug_build.js +11 -0
- package/build/cjs/debug_build.js.map +1 -0
- package/build/cjs/performance.js +5 -3
- package/build/cjs/performance.js.map +1 -1
- package/build/esm/debug_build.js +9 -0
- package/build/esm/debug_build.js.map +1 -0
- package/build/esm/package.json +1 -1
- package/build/esm/performance.js +6 -4
- package/build/esm/performance.js.map +1 -1
- package/build/types/debug_build.d.ts +7 -0
- package/build/types/debug_build.d.ts.map +1 -0
- package/build/types/performance.d.ts.map +1 -1
- package/build/types-ts3.8/debug_build.d.ts +7 -0
- package/package.json +3 -3
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
5
|
+
*
|
|
6
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
7
|
+
*/
|
|
8
|
+
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
|
|
9
|
+
|
|
10
|
+
exports.DEBUG_BUILD = DEBUG_BUILD;
|
|
11
|
+
//# sourceMappingURL=debug_build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug_build.js","sources":["../../src/debug_build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
package/build/cjs/performance.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
3
3
|
const browser = require('@sentry/browser');
|
|
4
4
|
const core = require('@sentry/core');
|
|
5
5
|
const svelte = require('svelte');
|
|
6
|
+
const debug_build = require('./debug_build.js');
|
|
6
7
|
|
|
7
8
|
const defaultTrackComponentOptions
|
|
8
9
|
|
|
@@ -35,9 +36,10 @@ function trackComponent(options) {
|
|
|
35
36
|
try {
|
|
36
37
|
recordUpdateSpans(componentName);
|
|
37
38
|
} catch {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
debug_build.DEBUG_BUILD &&
|
|
40
|
+
core.debug.warn(
|
|
41
|
+
"Cannot track component updates. This is likely because you're using Svelte 5 in Runes mode. Set `trackUpdates: false` in `withSentryConfig` or `trackComponent` to disable this warning.",
|
|
42
|
+
);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport { debug, startInactiveSpan } from '@sentry/core';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { DEBUG_BUILD } from './debug_build';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: false,\n};\n\n/**\n * Tracks the Svelte component's initialization and mounting operation as well as\n * updates and records them as spans.\n *\n * This function is injected automatically into your Svelte components' code\n * if you are using the withSentryConfig wrapper.\n *\n * Alternatively, you can call it yourself if you don't want to use the preprocessor.\n */\nexport function trackComponent(options?: TrackComponentOptions): void {\n const mergedOptions = { ...defaultTrackComponentOptions, ...options };\n\n const customComponentName = mergedOptions.componentName;\n\n const componentName = `<${customComponentName || 'Svelte Component'}>`;\n\n if (mergedOptions.trackInit) {\n recordInitSpan(componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n try {\n recordUpdateSpans(componentName);\n } catch {\n DEBUG_BUILD &&\n debug.warn(\n \"Cannot track component updates. This is likely because you're using Svelte 5 in Runes mode. Set `trackUpdates: false` in `withSentryConfig` or `trackComponent` to disable this warning.\",\n );\n }\n }\n}\n\nfunction recordInitSpan(componentName: string): void {\n const initSpan = startInactiveSpan({\n onlyIfParent: true,\n op: 'ui.svelte.init',\n name: componentName,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },\n });\n\n onMount(() => {\n initSpan.end();\n });\n}\n\nfunction recordUpdateSpans(componentName: string): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n updateSpan = startInactiveSpan({\n onlyIfParent: true,\n op: 'ui.svelte.update',\n name: componentName,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n"],"names":["DEBUG_BUILD","debug","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","onMount","beforeUpdate","afterUpdate"],"mappings":";;;;;;;AAOA,MAAM;;AAIN,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,KAAK;AACrB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,M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CAAC,UAAU,EAAE;AACrB,MAAM;AACN;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,IAAI,UAAA,GAAa,SAAS;AAC1B,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
3
|
+
*
|
|
4
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
5
|
+
*/
|
|
6
|
+
const DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);
|
|
7
|
+
|
|
8
|
+
export { DEBUG_BUILD };
|
|
9
|
+
//# sourceMappingURL=debug_build.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug_build.js","sources":["../../src/debug_build.ts"],"sourcesContent":["declare const __DEBUG_BUILD__: boolean;\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nexport const DEBUG_BUILD = __DEBUG_BUILD__;\n"],"names":[],"mappings":"AAEA;AACA;AACA;AACA;AACA;AACO,MAAM,WAAA,IAAc,OAAA,gBAAA,KAAA,WAAA,IAAA,gBAAA;;;;"}
|
package/build/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"type":"module","version":"9.
|
|
1
|
+
{"type":"module","version":"9.39.0","sideEffects":false}
|
package/build/esm/performance.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
|
|
2
|
-
import {
|
|
2
|
+
import { debug, startInactiveSpan } from '@sentry/core';
|
|
3
3
|
import { onMount, beforeUpdate, afterUpdate } from 'svelte';
|
|
4
|
+
import { DEBUG_BUILD } from './debug_build.js';
|
|
4
5
|
|
|
5
6
|
const defaultTrackComponentOptions
|
|
6
7
|
|
|
@@ -33,9 +34,10 @@ function trackComponent(options) {
|
|
|
33
34
|
try {
|
|
34
35
|
recordUpdateSpans(componentName);
|
|
35
36
|
} catch {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
DEBUG_BUILD &&
|
|
38
|
+
debug.warn(
|
|
39
|
+
"Cannot track component updates. This is likely because you're using Svelte 5 in Runes mode. Set `trackUpdates: false` in `withSentryConfig` or `trackComponent` to disable this warning.",
|
|
40
|
+
);
|
|
39
41
|
}
|
|
40
42
|
}
|
|
41
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport {
|
|
1
|
+
{"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';\nimport type { Span } from '@sentry/core';\nimport { debug, startInactiveSpan } from '@sentry/core';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { DEBUG_BUILD } from './debug_build';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: false,\n};\n\n/**\n * Tracks the Svelte component's initialization and mounting operation as well as\n * updates and records them as spans.\n *\n * This function is injected automatically into your Svelte components' code\n * if you are using the withSentryConfig wrapper.\n *\n * Alternatively, you can call it yourself if you don't want to use the preprocessor.\n */\nexport function trackComponent(options?: TrackComponentOptions): void {\n const mergedOptions = { ...defaultTrackComponentOptions, ...options };\n\n const customComponentName = mergedOptions.componentName;\n\n const componentName = `<${customComponentName || 'Svelte Component'}>`;\n\n if (mergedOptions.trackInit) {\n recordInitSpan(componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n try {\n recordUpdateSpans(componentName);\n } catch {\n DEBUG_BUILD &&\n debug.warn(\n \"Cannot track component updates. This is likely because you're using Svelte 5 in Runes mode. Set `trackUpdates: false` in `withSentryConfig` or `trackComponent` to disable this warning.\",\n );\n }\n }\n}\n\nfunction recordInitSpan(componentName: string): void {\n const initSpan = startInactiveSpan({\n onlyIfParent: true,\n op: 'ui.svelte.init',\n name: componentName,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },\n });\n\n onMount(() => {\n initSpan.end();\n });\n}\n\nfunction recordUpdateSpans(componentName: string): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n updateSpan = startInactiveSpan({\n onlyIfParent: true,\n op: 'ui.svelte.update',\n name: componentName,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n"],"names":[],"mappings":";;;;;AAOA,MAAM;;AAIN,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,KAAK;AACrB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS;;AAEvE,EAAE,MAAM,mBAAA,GAAsB,aAAa,CAAC,aAAa;;AAEzD,EAAE,MAAM,aAAA,GAAgB,CAAC,CAAC,EAAE,mBAAA,IAAuB,kBAAkB,CAAC,CAAC,CAAC;;AAExE,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,cAAc,CAAC,aAAa,CAAC;AACjC;;AAEA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,IAAI;AACR,MAAM,iBAAiB,CAAC,aAAa,CAAC;AACtC,MAAM,MAAM;AACZ,MAAM,WAAA;AACN,QAAQ,KAAK,CAAC,IAAI;AAClB,UAAU,0LAA0L;AACpM,SAAS;AACT;AACA;AACA;;AAEA,SAAS,cAAc,CAAC,aAAa,EAAgB;AACrD,EAAE,MAAM,QAAA,GAAW,iBAAiB,CAAC;AACrC,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,EAAE,EAAE,gBAAgB;AACxB,IAAI,IAAI,EAAE,aAAa;AACvB,IAAI,UAAU,EAAE,EAAE,CAAC,gCAAgC,GAAG,kBAAkB;AACxE,GAAG,CAAC;;AAEJ,EAAE,OAAO,CAAC,MAAM;AAChB,IAAI,QAAQ,CAAC,GAAG,EAAE;AAClB,GAAG,CAAC;AACJ;;AAEA,SAAS,iBAAiB,CAAC,aAAa,EAAgB;AACxD,EAAE,IAAI,UAAU;AAChB,EAAE,YAAY,CAAC,MAAM;AACrB,IAAI,UAAA,GAAa,iBAAiB,CAAC;AACnC,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,EAAE,EAAE,kBAAkB;AAC5B,MAAM,IAAI,EAAE,aAAa;AACzB,MAAM,UAAU,EAAE,EAAE,CAAC,gCAAgC,GAAG,kBAAkB;AAC1E,KAAK,CAAC;AACN,GAAG,CAAC;;AAEJ,EAAE,WAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM;AACN;AACA,IAAI,UAAU,CAAC,GAAG,EAAE;AACpB,IAAI,UAAA,GAAa,SAAS;AAC1B,GAAG,CAAC;AACJ;;;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
3
|
+
*
|
|
4
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEBUG_BUILD: boolean;
|
|
7
|
+
//# sourceMappingURL=debug_build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug_build.d.ts","sourceRoot":"","sources":["../../src/debug_build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/performance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/performance.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWrD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAqBpE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
3
|
+
*
|
|
4
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEBUG_BUILD: boolean;
|
|
7
|
+
//# sourceMappingURL=debug_build.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/svelte",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.39.0",
|
|
4
4
|
"description": "Official Sentry SDK for Svelte",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/svelte",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sentry/browser": "9.
|
|
43
|
-
"@sentry/core": "9.
|
|
42
|
+
"@sentry/browser": "9.39.0",
|
|
43
|
+
"@sentry/core": "9.39.0",
|
|
44
44
|
"magic-string": "^0.30.0"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|