@sentry/svelte 7.107.0 → 8.0.0-alpha.3

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/README.md CHANGED
@@ -10,28 +10,29 @@
10
10
  [![npm dm](https://img.shields.io/npm/dm/@sentry/svelte.svg)](https://www.npmjs.com/package/@sentry/svelte)
11
11
  [![npm dt](https://img.shields.io/npm/dt/@sentry/svelte.svg)](https://www.npmjs.com/package/@sentry/svelte)
12
12
 
13
- This SDK currently only supports [Svelte](https://svelte.dev/) apps in the browser.
14
- If you're using SvelteKit, we recommend using our dedicated [Sentry SvelteKit SDK](https://github.com/getsentry/sentry-javascript/tree/develop/packages/sveltekit).
13
+ This SDK currently only supports [Svelte](https://svelte.dev/) apps in the browser. If you're using SvelteKit, we
14
+ recommend using our dedicated
15
+ [Sentry SvelteKit SDK](https://github.com/getsentry/sentry-javascript/tree/develop/packages/sveltekit).
15
16
 
16
17
  ## General
17
18
 
18
- This package is a wrapper around `@sentry/browser`, providing error monitoring and basic performance monitoring
19
- features for [Svelte](https://svelte.dev/).
19
+ This package is a wrapper around `@sentry/browser`, providing error monitoring and basic performance monitoring features
20
+ for [Svelte](https://svelte.dev/).
20
21
 
21
22
  To use the SDK, initialize Sentry in your Svelte entry point `main.js` before you bootstrap your Svelte app:
22
23
 
23
24
  ```ts
24
25
  // main.js / main.ts
25
26
 
26
- import App from "./App.svelte";
27
+ import App from './App.svelte';
27
28
 
28
- import * as Sentry from "@sentry/svelte";
29
+ import * as Sentry from '@sentry/svelte';
29
30
 
30
31
  // Initialize the Sentry SDK here
31
32
  Sentry.init({
32
- dsn: "__DSN__",
33
- release: "my-project-name@2.3.12",
34
- integrations: [new Sentry.BrowserTracing()],
33
+ dsn: '__DSN__',
34
+ release: 'my-project-name@2.3.12',
35
+ integrations: [Sentry.browserTracingIntegration()],
35
36
 
36
37
  // Set tracesSampleRate to 1.0 to capture 100%
37
38
  // of transactions for performance monitoring.
@@ -41,19 +42,25 @@ Sentry.init({
41
42
 
42
43
  // Then bootstrap your Svelte app
43
44
  const app = new App({
44
- target: document.getElementById("app"),
45
+ target: document.getElementById('app'),
45
46
  });
46
47
 
47
48
  export default app;
48
49
  ```
49
50
 
50
- The Sentry Svelte SDK supports all features from the `@sentry/browser` SDK. Until it becomes more stable, please refer to the Sentry [Browser SDK documentation](https://docs.sentry.io/platforms/javascript/) for more information and usage instructions.
51
+ The Sentry Svelte SDK supports all features from the `@sentry/browser` SDK. Until it becomes more stable, please refer
52
+ to the Sentry [Browser SDK documentation](https://docs.sentry.io/platforms/javascript/) for more information and usage
53
+ instructions.
51
54
 
52
55
  ## Sourcemaps and Releases
53
56
 
54
- To generate source maps of your Svelte app bundle, check our guide [how to configure your bundler](https://docs.sentry.io/platforms/javascript/guides/svelte/sourcemaps/generating/) to emit source maps.
57
+ To generate source maps of your Svelte app bundle, check our guide
58
+ [how to configure your bundler](https://docs.sentry.io/platforms/javascript/guides/svelte/sourcemaps/generating/) to
59
+ emit source maps.
55
60
 
56
- To [create releases and upload source maps](https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/) to Sentry, we recommend using [`sentry-cli`](https://github.com/getsentry/sentry-cli). You can for instance create a bash script to take care of creating a release, uploading source maps and finalizing the release:
61
+ To [create releases and upload source maps](https://docs.sentry.io/platforms/javascript/sourcemaps/uploading/cli/) to
62
+ Sentry, we recommend using [`sentry-cli`](https://github.com/getsentry/sentry-cli). You can for instance create a bash
63
+ script to take care of creating a release, uploading source maps and finalizing the release:
57
64
 
58
65
  ```bash
59
66
  #!/bin/bash
@@ -69,6 +76,12 @@ sentry-cli releases files $VERSION upload-sourcemaps $SOURCEMAPS_PATH --org $ORG
69
76
  sentry-cli releases finalize $VERSION --org $ORG --project $PROJECT
70
77
  ```
71
78
 
72
- Please note that the paths provided in this example work for a typical Svelte project that adheres to the project structure set by [create-vite](https://www.npmjs.com/package/create-vite) with the `svelte(-ts)` template. If your project setup differs from this template, your configuration may need adjustments. Please refer to our documentation of [Advanced `sentry-cli` Sourcemaps Options](https://docs.sentry.io/product/cli/releases/#sentry-cli-sourcemaps) and to our [Sourcemaps Troubleshooting Guide](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/).
79
+ Please note that the paths provided in this example work for a typical Svelte project that adheres to the project
80
+ structure set by [create-vite](https://www.npmjs.com/package/create-vite) with the `svelte(-ts)` template. If your
81
+ project setup differs from this template, your configuration may need adjustments. Please refer to our documentation of
82
+ [Advanced `sentry-cli` Sourcemaps Options](https://docs.sentry.io/product/cli/releases/#sentry-cli-sourcemaps) and to
83
+ our [Sourcemaps Troubleshooting Guide](https://docs.sentry.io/platforms/javascript/sourcemaps/troubleshooting_js/).
73
84
 
74
- Check out our [Svelte source maps uploading](https://docs.sentry.io/platforms/javascript/guides/svelte/sourcemaps/uploading/) guide for more information.
85
+ Check out our
86
+ [Svelte source maps uploading](https://docs.sentry.io/platforms/javascript/guides/svelte/sourcemaps/uploading/) guide
87
+ for more information.
package/cjs/index.js CHANGED
@@ -12,7 +12,14 @@ exports.init = sdk.init;
12
12
  exports.componentTrackingPreprocessor = preprocessors.componentTrackingPreprocessor;
13
13
  exports.trackComponent = performance.trackComponent;
14
14
  exports.withSentryConfig = config.withSentryConfig;
15
- for (const k in browser) {
16
- if (k !== 'default' && !exports.hasOwnProperty(k)) exports[k] = browser[k];
17
- }
15
+ Object.prototype.hasOwnProperty.call(browser, '__proto__') &&
16
+ !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
17
+ Object.defineProperty(exports, '__proto__', {
18
+ enumerable: true,
19
+ value: browser['__proto__']
20
+ });
21
+
22
+ Object.keys(browser).forEach(k => {
23
+ if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = browser[k];
24
+ });
18
25
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;"}
@@ -23,11 +23,6 @@ const defaultTrackComponentOptions
23
23
  function trackComponent(options) {
24
24
  const mergedOptions = { ...defaultTrackComponentOptions, ...options };
25
25
 
26
- const transaction = getActiveTransaction();
27
- if (!transaction) {
28
- return;
29
- }
30
-
31
26
  const customComponentName = mergedOptions.componentName;
32
27
 
33
28
  // current_component.ctor.name is likely to give us the component's name automatically
@@ -36,7 +31,7 @@ function trackComponent(options) {
36
31
 
37
32
  let initSpan = undefined;
38
33
  if (mergedOptions.trackInit) {
39
- initSpan = recordInitSpan(transaction, componentName);
34
+ initSpan = recordInitSpan(componentName);
40
35
  }
41
36
 
42
37
  if (mergedOptions.trackUpdates) {
@@ -44,12 +39,12 @@ function trackComponent(options) {
44
39
  }
45
40
  }
46
41
 
47
- function recordInitSpan(transaction, componentName) {
48
- // eslint-disable-next-line deprecation/deprecation
49
- const initSpan = transaction.startChild({
42
+ function recordInitSpan(componentName) {
43
+ const initSpan = core.startInactiveSpan({
44
+ onlyIfParent: true,
50
45
  op: constants.UI_SVELTE_INIT,
51
- description: componentName,
52
- origin: 'auto.ui.svelte',
46
+ name: componentName,
47
+ attributes: { [browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
53
48
  });
54
49
 
55
50
  svelte.onMount(() => {
@@ -64,21 +59,26 @@ function recordUpdateSpans(componentName, initSpan) {
64
59
  svelte.beforeUpdate(() => {
65
60
  // We need to get the active transaction again because the initial one could
66
61
  // already be finished or there is currently no transaction going on.
67
- const transaction = getActiveTransaction();
68
- if (!transaction) {
62
+ const activeSpan = browser.getActiveSpan();
63
+ if (!activeSpan) {
69
64
  return;
70
65
  }
71
66
 
72
67
  // If we are initializing the component when the update span is started, we start it as child
73
68
  // of the init span. Else, we start it as a child of the transaction.
74
69
  const parentSpan =
75
- initSpan && initSpan.isRecording() && core.getRootSpan(initSpan) === transaction ? initSpan : transaction;
76
-
77
- // eslint-disable-next-line deprecation/deprecation
78
- updateSpan = parentSpan.startChild({
79
- op: constants.UI_SVELTE_UPDATE,
80
- description: componentName,
81
- origin: 'auto.ui.svelte',
70
+ initSpan && initSpan.isRecording() && core.getRootSpan(initSpan) === core.getRootSpan(activeSpan)
71
+ ? initSpan
72
+ : core.getRootSpan(activeSpan);
73
+
74
+ if (!parentSpan) return;
75
+
76
+ updateSpan = core.withActiveSpan(parentSpan, () => {
77
+ return core.startInactiveSpan({
78
+ op: constants.UI_SVELTE_UPDATE,
79
+ name: componentName,
80
+ attributes: { [browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
81
+ });
82
82
  });
83
83
  });
84
84
 
@@ -91,10 +91,5 @@ function recordUpdateSpans(componentName, initSpan) {
91
91
  });
92
92
  }
93
93
 
94
- function getActiveTransaction() {
95
- // eslint-disable-next-line deprecation/deprecation
96
- return browser.getCurrentScope().getTransaction();
97
- }
98
-
99
94
  exports.trackComponent = trackComponent;
100
95
  //# sourceMappingURL=performance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { getCurrentScope } from '@sentry/browser';\nimport type { Span, Transaction } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { getRootSpan } from '@sentry/core';\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\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 transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n const customComponentName = mergedOptions.componentName;\n\n // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(transaction, componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(transaction: Transaction, componentName: string): Span {\n // eslint-disable-next-line deprecation/deprecation\n const initSpan = transaction.startChild({\n op: UI_SVELTE_INIT,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n\n onMount(() => {\n initSpan.end();\n });\n\n return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && initSpan.isRecording() && getRootSpan(initSpan) === transaction ? initSpan : transaction;\n\n // eslint-disable-next-line deprecation/deprecation\n updateSpan = parentSpan.startChild({\n op: UI_SVELTE_UPDATE,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n\nfunction getActiveTransaction(): Transaction | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getTransaction();\n}\n"],"names":["current_component","DEFAULT_COMPONENT_NAME","UI_SVELTE_INIT","onMount","beforeUpdate","getRootSpan","UI_SVELTE_UPDATE","afterUpdate","getCurrentScope"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,CAAC,CAAA;AACJ;AACA,EAAE,OAAO,QAAQ,CAAA;AACjB,CAAA;AACA;AACA,SAAS,iBAAiB,CAAC,aAAa,EAAU,QAAQ,EAAe;AACzE,EAAE,IAAI,UAAU,CAAA;AAChB,EAAEC,mBAAY,CAAC,MAAM;AACrB;AACA;AACA,IAAI,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC9C,IAAI,IAAI,CAAC,WAAW,EAAE;AACtB,MAAM,OAAM;AACZ,KAAI;AACJ;AACA;AACA;AACA,IAAI,MAAM,UAAW;AACrB,MAAM,YAAY,QAAQ,CAAC,WAAW,EAAG,IAAGC,gBAAW,CAAC,QAAQ,CAAE,KAAI,cAAc,QAAA,GAAW,WAAW,CAAA;AAC1G;AACA;AACA,IAAI,UAAW,GAAE,UAAU,CAAC,UAAU,CAAC;AACvC,MAAM,EAAE,EAAEC,0BAAgB;AAC1B,MAAM,WAAW,EAAE,aAAa;AAChC,MAAM,MAAM,EAAE,gBAAgB;AAC9B,KAAK,CAAC,CAAA;AACN,GAAG,CAAC,CAAA;AACJ;AACA,EAAEC,kBAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ,CAAA;AACA;AACA,SAAS,oBAAoB,GAA4B;AACzD;AACA,EAAE,OAAOC,uBAAe,EAAE,CAAC,cAAc,EAAE,CAAA;AAC3C;;;;"}
1
+ {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getActiveSpan } from '@sentry/browser';\nimport type { Span } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { getRootSpan, startInactiveSpan, withActiveSpan } from '@sentry/core';\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\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 // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(componentName: string): Span | undefined {\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 return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && initSpan.isRecording() && getRootSpan(initSpan) === getRootSpan(activeSpan)\n ? initSpan\n : getRootSpan(activeSpan);\n\n if (!parentSpan) return;\n\n updateSpan = withActiveSpan(parentSpan, () => {\n return startInactiveSpan({\n op: UI_SVELTE_UPDATE,\n name: componentName,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },\n });\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n"],"names":["current_component","DEFAULT_COMPONENT_NAME","startInactiveSpan","UI_SVELTE_INIT","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","onMount","beforeUpdate","getActiveSpan","getRootSpan","withActiveSpan","UI_SVELTE_UPDATE","afterUpdate"],"mappings":";;;;;;;;AASA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS,CAAA;AACvE;AACA,EAAE,MAAM,mBAAA,GAAsB,aAAa,CAAC,aAAa,CAAA;AACzD;AACA;AACA;AACA,EAAE,MAAM,aAAc,GAAE,CAAC,CAAC,EAAE,mBAAoB,IAAGA,0BAAiB,CAAC,WAAW,CAAC,IAAA,IAAQC,gCAAsB,CAAC,CAAC,CAAC,CAAA;AAClH;AACA,EAAE,IAAI,QAAQ,GAAqB,SAAS,CAAA;AAC5C,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,QAAS,GAAE,cAAc,CAAC,aAAa,CAAC,CAAA;AAC5C,GAAE;AACF;AACA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;AAC9C,GAAE;AACF,CAAA;AACA;AACA,SAAS,cAAc,CAAC,aAAa,EAA4B;AACjE,EAAE,MAAM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AE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ;;;;"}
@@ -0,0 +1 @@
1
+ { "type": "module" }
@@ -1,7 +1,7 @@
1
- import { getCurrentScope } from '@sentry/browser';
1
+ import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getActiveSpan } from '@sentry/browser';
2
2
  import { onMount, beforeUpdate, afterUpdate } from 'svelte';
3
3
  import { current_component } from 'svelte/internal';
4
- import { getRootSpan } from '@sentry/core';
4
+ import { startInactiveSpan, getRootSpan, withActiveSpan } from '@sentry/core';
5
5
  import { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants.js';
6
6
 
7
7
  const defaultTrackComponentOptions
@@ -21,11 +21,6 @@ const defaultTrackComponentOptions
21
21
  function trackComponent(options) {
22
22
  const mergedOptions = { ...defaultTrackComponentOptions, ...options };
23
23
 
24
- const transaction = getActiveTransaction();
25
- if (!transaction) {
26
- return;
27
- }
28
-
29
24
  const customComponentName = mergedOptions.componentName;
30
25
 
31
26
  // current_component.ctor.name is likely to give us the component's name automatically
@@ -34,7 +29,7 @@ function trackComponent(options) {
34
29
 
35
30
  let initSpan = undefined;
36
31
  if (mergedOptions.trackInit) {
37
- initSpan = recordInitSpan(transaction, componentName);
32
+ initSpan = recordInitSpan(componentName);
38
33
  }
39
34
 
40
35
  if (mergedOptions.trackUpdates) {
@@ -42,12 +37,12 @@ function trackComponent(options) {
42
37
  }
43
38
  }
44
39
 
45
- function recordInitSpan(transaction, componentName) {
46
- // eslint-disable-next-line deprecation/deprecation
47
- const initSpan = transaction.startChild({
40
+ function recordInitSpan(componentName) {
41
+ const initSpan = startInactiveSpan({
42
+ onlyIfParent: true,
48
43
  op: UI_SVELTE_INIT,
49
- description: componentName,
50
- origin: 'auto.ui.svelte',
44
+ name: componentName,
45
+ attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
51
46
  });
52
47
 
53
48
  onMount(() => {
@@ -62,21 +57,26 @@ function recordUpdateSpans(componentName, initSpan) {
62
57
  beforeUpdate(() => {
63
58
  // We need to get the active transaction again because the initial one could
64
59
  // already be finished or there is currently no transaction going on.
65
- const transaction = getActiveTransaction();
66
- if (!transaction) {
60
+ const activeSpan = getActiveSpan();
61
+ if (!activeSpan) {
67
62
  return;
68
63
  }
69
64
 
70
65
  // If we are initializing the component when the update span is started, we start it as child
71
66
  // of the init span. Else, we start it as a child of the transaction.
72
67
  const parentSpan =
73
- initSpan && initSpan.isRecording() && getRootSpan(initSpan) === transaction ? initSpan : transaction;
74
-
75
- // eslint-disable-next-line deprecation/deprecation
76
- updateSpan = parentSpan.startChild({
77
- op: UI_SVELTE_UPDATE,
78
- description: componentName,
79
- origin: 'auto.ui.svelte',
68
+ initSpan && initSpan.isRecording() && getRootSpan(initSpan) === getRootSpan(activeSpan)
69
+ ? initSpan
70
+ : getRootSpan(activeSpan);
71
+
72
+ if (!parentSpan) return;
73
+
74
+ updateSpan = withActiveSpan(parentSpan, () => {
75
+ return startInactiveSpan({
76
+ op: UI_SVELTE_UPDATE,
77
+ name: componentName,
78
+ attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
79
+ });
80
80
  });
81
81
  });
82
82
 
@@ -89,10 +89,5 @@ function recordUpdateSpans(componentName, initSpan) {
89
89
  });
90
90
  }
91
91
 
92
- function getActiveTransaction() {
93
- // eslint-disable-next-line deprecation/deprecation
94
- return getCurrentScope().getTransaction();
95
- }
96
-
97
92
  export { trackComponent };
98
93
  //# sourceMappingURL=performance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { getCurrentScope } from '@sentry/browser';\nimport type { Span, Transaction } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { getRootSpan } from '@sentry/core';\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\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 transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n const customComponentName = mergedOptions.componentName;\n\n // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(transaction, componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(transaction: Transaction, componentName: string): Span {\n // eslint-disable-next-line deprecation/deprecation\n const initSpan = transaction.startChild({\n op: UI_SVELTE_INIT,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n\n onMount(() => {\n initSpan.end();\n });\n\n return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const transaction = getActiveTransaction();\n if (!transaction) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && initSpan.isRecording() && getRootSpan(initSpan) === transaction ? initSpan : transaction;\n\n // eslint-disable-next-line deprecation/deprecation\n updateSpan = parentSpan.startChild({\n op: UI_SVELTE_UPDATE,\n description: componentName,\n origin: 'auto.ui.svelte',\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n\nfunction getActiveTransaction(): Transaction | undefined {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentScope().getTransaction();\n}\n"],"names":[],"mappings":";;;;;;AASA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS,CAAA;AACvE;AACA,EAAE,MAAM,WAAA,GAAc,oBAAoB,EAAE,CAAA;AAC5C,EAAE,IAAI,CAAC,WAAW,EAAE;AACpB,IAAI,OAAM;AACV,GAAE;AACF;AACA,EAAE,MAAM,mBAAA,GAAsB,aAAa,CAAC,aAAa,CAAA;AACzD;AACA;AACA;AACA,EAAE,MAAM,aAAc,GAAE,CAAC,CAAC,EAAE,mBAAoB,IAAG,iBAAiB,CAAC,WAAW,CAAC,IAAA,IAAQ,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAClH;AACA,EAAE,IAAI,QAAQ,GAAqB,SAAS,CAAA;AAC5C,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,WAAW,cAAc,CAAC,WAAW,EAAE,aAAa,CAAC,CAAA;AACzD,GAAE;AACF;AACA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,iBAAiB,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAA;AAC9C,GAAE;AACF,CAAA;AACA;AACA,SAAS,cAAc,CAAC,WAA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AAC,cAAc,EAAE,CAAA;AAC3C;;;;"}
1
+ {"version":3,"file":"performance.js","sources":["../../src/performance.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getActiveSpan } from '@sentry/browser';\nimport type { Span } from '@sentry/types';\nimport { afterUpdate, beforeUpdate, onMount } from 'svelte';\nimport { current_component } from 'svelte/internal';\n\nimport { getRootSpan, startInactiveSpan, withActiveSpan } from '@sentry/core';\nimport { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE } from './constants';\nimport type { TrackComponentOptions } from './types';\n\nconst defaultTrackComponentOptions: {\n trackInit: boolean;\n trackUpdates: boolean;\n componentName?: string;\n} = {\n trackInit: true,\n trackUpdates: true,\n};\n\n/**\n * Tracks the Svelte component's intialization and mounting operation as well as\n * updates and records them as spans.\n * This function is injected automatically into your Svelte components' code\n * if you are using the Sentry componentTrackingPreprocessor.\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 // current_component.ctor.name is likely to give us the component's name automatically\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentName = `<${customComponentName || current_component.constructor.name || DEFAULT_COMPONENT_NAME}>`;\n\n let initSpan: Span | undefined = undefined;\n if (mergedOptions.trackInit) {\n initSpan = recordInitSpan(componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName, initSpan);\n }\n}\n\nfunction recordInitSpan(componentName: string): Span | undefined {\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 return initSpan;\n}\n\nfunction recordUpdateSpans(componentName: string, initSpan?: Span): void {\n let updateSpan: Span | undefined;\n beforeUpdate(() => {\n // We need to get the active transaction again because the initial one could\n // already be finished or there is currently no transaction going on.\n const activeSpan = getActiveSpan();\n if (!activeSpan) {\n return;\n }\n\n // If we are initializing the component when the update span is started, we start it as child\n // of the init span. Else, we start it as a child of the transaction.\n const parentSpan =\n initSpan && initSpan.isRecording() && getRootSpan(initSpan) === getRootSpan(activeSpan)\n ? initSpan\n : getRootSpan(activeSpan);\n\n if (!parentSpan) return;\n\n updateSpan = withActiveSpan(parentSpan, () => {\n return startInactiveSpan({\n op: UI_SVELTE_UPDATE,\n name: componentName,\n attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },\n });\n });\n });\n\n afterUpdate(() => {\n if (!updateSpan) {\n return;\n }\n updateSpan.end();\n updateSpan = undefined;\n });\n}\n"],"names":[],"mappings":";;;;;;AASA,MAAM,4BAA4B;;AAIlC,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,CAAC,CAAA;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,cAAc,CAAC,OAAO,EAAgC;AACtE,EAAE,MAAM,gBAAgB,EAAE,GAAG,4BAA4B,EAAE,GAAG,OAAA,EAAS,CAAA;AACvE;AACA,EAAE,MAAM,mBAAA,GAAsB,aAAa,CAAC,aAAa,CAAA;AACzD;AACA;AACA;AACA,EAAE,MAAM,aAAc,GAAE,CAAC,CAAC,EAAE,mBAAoB,IAAG,iBAAiB,CAAC,WAAW,CAAC,IAAA,IAAQ,sBAAsB,CAAC,CAAC,CAAC,CAAA;AAClH;AACA,EAAE,IAAI,QAAQ,GAAqB,SAAS,CAAA;AAC5C,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,QAAS,GAAE,cAAc,CAAC,aAAa,CAAC,CAAA;AAC5C,GAAE;AACF;AACA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,iBAAiB,C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A;AACN,GAAG,CAAC,CAAA;AACJ;AACA,EAAE,WAAW,CAAC,MAAM;AACpB,IAAI,IAAI,CAAC,UAAU,EAAE;AACrB,MAAM,OAAM;AACZ,KAAI;AACJ,IAAI,UAAU,CAAC,GAAG,EAAE,CAAA;AACpB,IAAI,UAAA,GAAa,SAAS,CAAA;AAC1B,GAAG,CAAC,CAAA;AACJ;;;;"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@sentry/svelte",
3
- "version": "7.107.0",
3
+ "version": "8.0.0-alpha.3",
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",
7
7
  "author": "Sentry",
8
8
  "license": "MIT",
9
9
  "engines": {
10
- "node": ">=8"
10
+ "node": ">=14.18"
11
11
  },
12
12
  "files": [
13
13
  "cjs",
@@ -18,6 +18,19 @@
18
18
  "main": "cjs/index.js",
19
19
  "module": "esm/index.js",
20
20
  "types": "types/index.d.ts",
21
+ "exports": {
22
+ "./package.json": "./package.json",
23
+ ".": {
24
+ "import": {
25
+ "types": "./types/index.d.ts",
26
+ "default": "./esm/index.js"
27
+ },
28
+ "require": {
29
+ "types": "./types/index.d.ts",
30
+ "default": "./cjs/index.js"
31
+ }
32
+ }
33
+ },
21
34
  "typesVersions": {
22
35
  "<4.9": {
23
36
  "types/index.d.ts": [
@@ -29,19 +42,19 @@
29
42
  "access": "public"
30
43
  },
31
44
  "dependencies": {
32
- "@sentry/browser": "7.107.0",
33
- "@sentry/core": "7.107.0",
34
- "@sentry/types": "7.107.0",
35
- "@sentry/utils": "7.107.0",
45
+ "@sentry/browser": "8.0.0-alpha.3",
46
+ "@sentry/core": "8.0.0-alpha.3",
47
+ "@sentry/types": "8.0.0-alpha.3",
48
+ "@sentry/utils": "8.0.0-alpha.3",
36
49
  "magic-string": "^0.30.0"
37
50
  },
38
51
  "peerDependencies": {
39
52
  "svelte": "3.x || 4.x"
40
53
  },
41
54
  "devDependencies": {
55
+ "@sveltejs/vite-plugin-svelte": "1.4.0",
42
56
  "@testing-library/svelte": "^3.2.1",
43
- "svelte": "3.49.0",
44
- "svelte-jester": "^2.3.2"
57
+ "svelte": "3.49.0"
45
58
  },
46
59
  "sideEffects": false
47
60
  }
@@ -1 +1 @@
1
- {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/performance.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWrD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAsBpE"}
1
+ {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/performance.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWrD;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAiBpE"}
package/types/types.d.ts CHANGED
@@ -51,6 +51,11 @@ export type ComponentTrackingInitOptions = {
51
51
  trackComponents?: boolean | string[];
52
52
  } & SpanOptions;
53
53
  export type TrackComponentOptions = {
54
+ /**
55
+ * The name of the component to be used in the recorded spans.
56
+ *
57
+ * @default to <Svelte Component> if not specified
58
+ */
54
59
  componentName?: string;
55
60
  } & SpanOptions;
56
61
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAI1E,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MA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AAM,MAAM,WAAW,GAAG;IACxB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAC;CACtC,GAAG,WAAW,CAAC;AAEhB,MAAM,MAAM,qBAAqB,GAAG;IAClC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,GAAG,WAAW,CAAC"}
@@ -51,6 +51,11 @@ export type ComponentTrackingInitOptions = {
51
51
  trackComponents?: boolean | string[];
52
52
  } & SpanOptions;
53
53
  export type TrackComponentOptions = {
54
+ /**
55
+ * The name of the component to be used in the recorded spans.
56
+ *
57
+ * @default to <Svelte Component> if not specified
58
+ */
54
59
  componentName?: string;
55
60
  } & SpanOptions;
56
61
  //# sourceMappingURL=types.d.ts.map