@sentry/svelte 8.53.0 → 8.55.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.
@@ -21,30 +21,23 @@ function withSentryConfig(
21
21
  const mergedOptions = {
22
22
  ...DEFAULT_SENTRY_OPTIONS,
23
23
  ...sentryOptions,
24
+ componentTracking: {
25
+ ...DEFAULT_SENTRY_OPTIONS.componentTracking,
26
+ ...(sentryOptions && sentryOptions.componentTracking),
27
+ },
24
28
  };
25
29
 
26
30
  const originalPreprocessors = getOriginalPreprocessorArray(originalConfig);
27
31
 
28
- // Map is insertion-order-preserving. It's important to add preprocessors
29
- // to this map in the right order we want to see them being executed.
30
- // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
31
- const sentryPreprocessors = new Map();
32
-
33
- const shouldTrackComponents = mergedOptions.componentTracking && mergedOptions.componentTracking.trackComponents;
34
- if (shouldTrackComponents) {
35
- const firstPassPreproc = preprocessors.componentTrackingPreprocessor(mergedOptions.componentTracking);
36
- sentryPreprocessors.set(firstPassPreproc.sentryId || '', firstPassPreproc);
32
+ // Bail if users already added the preprocessor
33
+ if (originalPreprocessors.find((p) => !!(p ).sentryId)) {
34
+ return originalConfig;
37
35
  }
38
36
 
39
- // We prioritize user-added preprocessors, so we don't insert sentry processors if they
40
- // have already been added by users.
41
- originalPreprocessors.forEach((p) => {
42
- if (p.sentryId) {
43
- sentryPreprocessors.delete(p.sentryId);
44
- }
45
- });
46
-
47
- const mergedPreprocessors = [...sentryPreprocessors.values(), ...originalPreprocessors];
37
+ const mergedPreprocessors = [...originalPreprocessors];
38
+ if (mergedOptions.componentTracking.trackComponents) {
39
+ mergedPreprocessors.unshift(preprocessors.componentTrackingPreprocessor(mergedOptions.componentTracking));
40
+ }
48
41
 
49
42
  return {
50
43
  ...originalConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/config.ts"],"sourcesContent":["import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\n\nimport { componentTrackingPreprocessor, defaultComponentTrackingOptions } from './preprocessors';\nimport type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from './types';\n\nconst DEFAULT_SENTRY_OPTIONS: SentrySvelteConfigOptions = {\n componentTracking: defaultComponentTrackingOptions,\n};\n\n/**\n * Add Sentry options to the Svelte config to be exported from the user's `svelte.config.js` file.\n *\n * @param originalConfig The existing config to be exported prior to adding Sentry\n * @param sentryOptions The configuration of the Sentry-added options\n *\n * @return The wrapped and modified config to be exported\n */\nexport function withSentryConfig(\n originalConfig: SvelteConfig,\n sentryOptions?: SentrySvelteConfigOptions,\n): SvelteConfig {\n const mergedOptions = {\n ...DEFAULT_SENTRY_OPTIONS,\n ...sentryOptions,\n };\n\n const originalPreprocessors = getOriginalPreprocessorArray(originalConfig);\n\n // Map is insertion-order-preserving. It's important to add preprocessors\n // to this map in the right order we want to see them being executed.\n // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\n const sentryPreprocessors = new Map<string, SentryPreprocessorGroup>();\n\n const shouldTrackComponents = mergedOptions.componentTracking && mergedOptions.componentTracking.trackComponents;\n if (shouldTrackComponents) {\n const firstPassPreproc: SentryPreprocessorGroup = componentTrackingPreprocessor(mergedOptions.componentTracking);\n sentryPreprocessors.set(firstPassPreproc.sentryId || '', firstPassPreproc);\n }\n\n // We prioritize user-added preprocessors, so we don't insert sentry processors if they\n // have already been added by users.\n originalPreprocessors.forEach((p: SentryPreprocessorGroup) => {\n if (p.sentryId) {\n sentryPreprocessors.delete(p.sentryId);\n }\n });\n\n const mergedPreprocessors = [...sentryPreprocessors.values(), ...originalPreprocessors];\n\n return {\n ...originalConfig,\n preprocess: mergedPreprocessors,\n };\n}\n\n/**\n * Standardizes the different ways the user-provided preprocessor option can be specified.\n * Users can specify an array of preprocessors, a single one or no preprocessor.\n *\n * @param originalConfig the user-provided svelte config oject\n * @return an array of preprocessors or an empty array if no preprocessors were specified\n */\nfunction getOriginalPreprocessorArray(originalConfig: SvelteConfig): PreprocessorGroup[] {\n if (originalConfig.preprocess) {\n if (Array.isArray(originalConfig.preprocess)) {\n return originalConfig.preprocess;\n }\n return [originalConfig.preprocess];\n }\n return [];\n}\n"],"names":["defaultComponentTrackingOptions","componentTrackingPreprocessor"],"mappings":";;;;AAKA,MAAM,sBAAsB,GAA8B;AAC1D,EAAE,iBAAiB,EAAEA,6CAA+B;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC,EAAE,cAAc;AAChB,EAAE,aAAa;AACf,EAAgB;AAChB,EAAE,MAAM,gBAAgB;AACxB,IAAI,GAAG,sBAAsB;AAC7B,IAAI,GAAG,aAAa;AACpB,GAAG;;AAEH,EAAE,MAAM,qBAAsB,GAAE,4BAA4B,CAAC,cAAc,CAAC;;AAE5E;AACA;AACA;AACA,EAAE,MAAM,mBAAoB,GAAE,IAAI,GAAG,EAAmC;;AAExE,EAAE,MAAM,qBAAsB,GAAE,aAAa,CAAC,iBAAkB,IAAG,aAAa,CAAC,iBAAiB,CAAC,eAAe;AAClH,EAAE,IAAI,qBAAqB,EAAE;AAC7B,IAAI,MAAM,gBAAgB,GAA4BC,2CAA6B,CAAC,aAAa,CAAC,iBAAiB,CAAC;AACpH,IAAI,mBAAmB,CAAC,GAAG,CAAC,gBAAgB,CAAC,QAAA,IAAY,EAAE,EAAE,gBAAgB,CAAC;AAC9E;;AAEA;AACA;AACA,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,KAA8B;AAChE,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE;AACpB,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5C;AACA,GAAG,CAAC;;AAEJ,EAAE,MAAM,mBAAA,GAAsB,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,EAAE,GAAG,qBAAqB,CAAC;;AAEzF,EAAE,OAAO;AACT,IAAI,GAAG,cAAc;AACrB,IAAI,UAAU,EAAE,mBAAmB;AACnC,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,cAAc,EAAqC;AACzF,EAAE,IAAI,cAAc,CAAC,UAAU,EAAE;AACjC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;AAClD,MAAM,OAAO,cAAc,CAAC,UAAU;AACtC;AACA,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC;AACtC;AACA,EAAE,OAAO,EAAE;AACX;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../src/config.ts"],"sourcesContent":["import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\n\nimport { componentTrackingPreprocessor, defaultComponentTrackingOptions } from './preprocessors';\nimport type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from './types';\n\nconst DEFAULT_SENTRY_OPTIONS: SentrySvelteConfigOptions = {\n componentTracking: defaultComponentTrackingOptions,\n};\n\n/**\n * Add Sentry options to the Svelte config to be exported from the user's `svelte.config.js` file.\n *\n * @param originalConfig The existing config to be exported prior to adding Sentry\n * @param sentryOptions The configuration of the Sentry-added options\n *\n * @return The wrapped and modified config to be exported\n */\nexport function withSentryConfig(\n originalConfig: SvelteConfig,\n sentryOptions?: SentrySvelteConfigOptions,\n): SvelteConfig {\n const mergedOptions = {\n ...DEFAULT_SENTRY_OPTIONS,\n ...sentryOptions,\n componentTracking: {\n ...DEFAULT_SENTRY_OPTIONS.componentTracking,\n ...(sentryOptions && sentryOptions.componentTracking),\n },\n };\n\n const originalPreprocessors = getOriginalPreprocessorArray(originalConfig);\n\n // Bail if users already added the preprocessor\n if (originalPreprocessors.find((p: PreprocessorGroup) => !!(p as SentryPreprocessorGroup).sentryId)) {\n return originalConfig;\n }\n\n const mergedPreprocessors = [...originalPreprocessors];\n if (mergedOptions.componentTracking.trackComponents) {\n mergedPreprocessors.unshift(componentTrackingPreprocessor(mergedOptions.componentTracking));\n }\n\n return {\n ...originalConfig,\n preprocess: mergedPreprocessors,\n };\n}\n\n/**\n * Standardizes the different ways the user-provided preprocessor option can be specified.\n * Users can specify an array of preprocessors, a single one or no preprocessor.\n *\n * @param originalConfig the user-provided svelte config oject\n * @return an array of preprocessors or an empty array if no preprocessors were specified\n */\nfunction getOriginalPreprocessorArray(originalConfig: SvelteConfig): PreprocessorGroup[] {\n if (originalConfig.preprocess) {\n if (Array.isArray(originalConfig.preprocess)) {\n return originalConfig.preprocess;\n }\n return [originalConfig.preprocess];\n }\n return [];\n}\n"],"names":["defaultComponentTrackingOptions","componentTrackingPreprocessor"],"mappings":";;;;AAKA,MAAM,sBAAsB,GAA8B;AAC1D,EAAE,iBAAiB,EAAEA,6CAA+B;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC,EAAE,cAAc;AAChB,EAAE,aAAa;AACf,EAAgB;AAChB,EAAE,MAAM,gBAAgB;AACxB,IAAI,GAAG,sBAAsB;AAC7B,IAAI,GAAG,aAAa;AACpB,IAAI,iBAAiB,EAAE;AACvB,MAAM,GAAG,sBAAsB,CAAC,iBAAiB;AACjD,MAAM,IAAI,aAAA,IAAiB,aAAa,CAAC,iBAAiB,CAAC;AAC3D,KAAK;AACL,GAAG;;AAEH,EAAE,MAAM,qBAAsB,GAAE,4BAA4B,CAAC,cAAc,CAAC;;AAE5E;AACA,EAAE,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAwB,CAAC,CAAC,CAAC,CAAA,GAA8B,QAAQ,CAAC,EAAE;AACvG,IAAI,OAAO,cAAc;AACzB;;AAEA,EAAE,MAAM,mBAAoB,GAAE,CAAC,GAAG,qBAAqB,CAAC;AACxD,EAAE,IAAI,aAAa,CAAC,iBAAiB,CAAC,eAAe,EAAE;AACvD,IAAI,mBAAmB,CAAC,OAAO,CAACC,2CAA6B,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;AAC/F;;AAEA,EAAE,OAAO;AACT,IAAI,GAAG,cAAc;AACrB,IAAI,UAAU,EAAE,mBAAmB;AACnC,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,cAAc,EAAqC;AACzF,EAAE,IAAI,cAAc,CAAC,UAAU,EAAE;AACjC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;AAClD,MAAM,OAAO,cAAc,CAAC,UAAU;AACtC;AACA,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC;AACtC;AACA,EAAE,OAAO,EAAE;AACX;;;;"}
@@ -3,7 +3,6 @@ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  const browser = require('@sentry/browser');
4
4
  const svelte = require('svelte');
5
5
  const core = require('@sentry/core');
6
- const constants = require('./constants.js');
7
6
 
8
7
  const defaultTrackComponentOptions
9
8
 
@@ -26,21 +25,27 @@ function trackComponent(options) {
26
25
 
27
26
  const customComponentName = mergedOptions.componentName;
28
27
 
29
- const componentName = `<${customComponentName || constants.DEFAULT_COMPONENT_NAME}>`;
28
+ const componentName = `<${customComponentName || 'Svelte Component'}>`;
30
29
 
31
30
  if (mergedOptions.trackInit) {
32
31
  recordInitSpan(componentName);
33
32
  }
34
33
 
35
34
  if (mergedOptions.trackUpdates) {
36
- recordUpdateSpans(componentName);
35
+ try {
36
+ recordUpdateSpans(componentName);
37
+ } catch (e) {
38
+ core.logger.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
+ );
41
+ }
37
42
  }
38
43
  }
39
44
 
40
45
  function recordInitSpan(componentName) {
41
46
  const initSpan = core.startInactiveSpan({
42
47
  onlyIfParent: true,
43
- op: constants.UI_SVELTE_INIT,
48
+ op: 'ui.svelte.init',
44
49
  name: componentName,
45
50
  attributes: { [browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
46
51
  });
@@ -55,7 +60,7 @@ function recordUpdateSpans(componentName) {
55
60
  svelte.beforeUpdate(() => {
56
61
  updateSpan = core.startInactiveSpan({
57
62
  onlyIfParent: true,
58
- op: constants.UI_SVELTE_UPDATE,
63
+ op: 'ui.svelte.update',
59
64
  name: componentName,
60
65
  attributes: { [browser.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
61
66
  });
@@ -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 { afterUpdate, beforeUpdate, onMount } from 'svelte';\n\nimport { startInactiveSpan } 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 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 || DEFAULT_COMPONENT_NAME}>`;\n\n if (mergedOptions.trackInit) {\n recordInitSpan(componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName);\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":["DEFAULT_COMPONENT_NAME","startInactiveSpan","UI_SVELTE_INIT","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","onMount","beforeUpdate","UI_SVELTE_UPDATE","afterUpdate"],"mappings":";;;;;;;AAQA,MAAM;;AAIN,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,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,aAAc,GAAE,CAAC,CAAC,EAAE,mBAAA,IAAuBA,gCAAsB,CAAC,CAAC,CAAC;;AAE5E,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,cAAc,CAAC,aAAa,CAAC;AACjC;;AAEA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,iBAAiB,CAAC,aAAa,CAAC;AACpC;AACA;;AAEA,SAAS,cAAc,CAAC,aAAa,EAAgB;AACrD,EAAE,MAAM,QAAA,GAAWC,sBAAiB,CAAC;AACrC,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,EAAE,EAAEC,wBAAc;AACtB,IAAI,IAAI,EAAE,aAAa;AACvB,IAAI,UAAU,EAAE,EAAE,CAACC,wCAAgC,GAAG,kBAAkB;AACxE,GAAG,CAAC;;AAEJ,EAAEC,cAAO,CAAC,MAAM;AAChB,IAAI,QAAQ,CAAC,GAAG,EAAE;AAClB,GAAG,CAAC;AACJ;;AAEA,SAAS,iBAAiB,CAAC,aAAa,EAAgB;AACxD,EAAE,IAAI,UAAU;AAChB,EAAEC,mBAAY,CAAC,MAAM;AACrB,IAAI,UAAA,GAAaJ,sBAAiB,CAAC;AACnC,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,EAAE,EAAEK,0BAAgB;AAC1B,MAAM,IAAI,EAAE,aAAa;AACzB,MAAM,UAAU,EAAE,EAAE,CAACH,wCAAgC,GAAG,kBAAkB;AAC1E,KAAK,CAAC;AACN,GAAG,CAAC;;AAEJ,EAAEI,kBAAW,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;;;;"}
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 { afterUpdate, beforeUpdate, onMount } from 'svelte';\n\nimport { logger, startInactiveSpan } from '@sentry/core';\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 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 logger.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":["logger","startInactiveSpan","SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN","onMount","beforeUpdate","afterUpdate"],"mappings":";;;;;;AAOA,MAAM;;AAIN,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,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,aAAc,GAAE,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,OAAM,CAAA,EAAA;AACZ,MAAMA,WAAM,CAAC,IAAI;AACjB,QAAQ,0LAA0L;AAClM,OAAO;AACP;AACA;AACA;;AAEA,SAAS,cAAc,CAAC,aAAa,EAAgB;AACrD,EAAE,MAAM,QAAA,GAAWC,sBAAiB,CAAC;AACrC,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,EAAE,EAAE,gBAAgB;AACxB,IAAI,IAAI,EAAE,aAAa;AACvB,IAAI,UAAU,EAAE,EAAE,CAACC,wCAAgC,GAAG,kBAAkB;AACxE,GAAG,CAAC;;AAEJ,EAAEC,cAAO,CAAC,MAAM;AAChB,IAAI,QAAQ,CAAC,GAAG,EAAE;AAClB,GAAG,CAAC;AACJ;;AAEA,SAAS,iBAAiB,CAAC,aAAa,EAAgB;AACxD,EAAE,IAAI,UAAU;AAChB,EAAEC,mBAAY,CAAC,MAAM;AACrB,IAAI,UAAA,GAAaH,sBAAiB,CAAC;AACnC,MAAM,YAAY,EAAE,IAAI;AACxB,MAAM,EAAE,EAAE,kBAAkB;AAC5B,MAAM,IAAI,EAAE,aAAa;AACzB,MAAM,UAAU,EAAE,EAAE,CAACC,wCAAgC,GAAG,kBAAkB;AAC1E,KAAK,CAAC;AACN,GAAG,CAAC;;AAEJ,EAAEG,kBAAW,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;;;;"}
@@ -19,30 +19,23 @@ function withSentryConfig(
19
19
  const mergedOptions = {
20
20
  ...DEFAULT_SENTRY_OPTIONS,
21
21
  ...sentryOptions,
22
+ componentTracking: {
23
+ ...DEFAULT_SENTRY_OPTIONS.componentTracking,
24
+ ...(sentryOptions && sentryOptions.componentTracking),
25
+ },
22
26
  };
23
27
 
24
28
  const originalPreprocessors = getOriginalPreprocessorArray(originalConfig);
25
29
 
26
- // Map is insertion-order-preserving. It's important to add preprocessors
27
- // to this map in the right order we want to see them being executed.
28
- // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
29
- const sentryPreprocessors = new Map();
30
-
31
- const shouldTrackComponents = mergedOptions.componentTracking && mergedOptions.componentTracking.trackComponents;
32
- if (shouldTrackComponents) {
33
- const firstPassPreproc = componentTrackingPreprocessor(mergedOptions.componentTracking);
34
- sentryPreprocessors.set(firstPassPreproc.sentryId || '', firstPassPreproc);
30
+ // Bail if users already added the preprocessor
31
+ if (originalPreprocessors.find((p) => !!(p ).sentryId)) {
32
+ return originalConfig;
35
33
  }
36
34
 
37
- // We prioritize user-added preprocessors, so we don't insert sentry processors if they
38
- // have already been added by users.
39
- originalPreprocessors.forEach((p) => {
40
- if (p.sentryId) {
41
- sentryPreprocessors.delete(p.sentryId);
42
- }
43
- });
44
-
45
- const mergedPreprocessors = [...sentryPreprocessors.values(), ...originalPreprocessors];
35
+ const mergedPreprocessors = [...originalPreprocessors];
36
+ if (mergedOptions.componentTracking.trackComponents) {
37
+ mergedPreprocessors.unshift(componentTrackingPreprocessor(mergedOptions.componentTracking));
38
+ }
46
39
 
47
40
  return {
48
41
  ...originalConfig,
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sources":["../../src/config.ts"],"sourcesContent":["import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\n\nimport { componentTrackingPreprocessor, defaultComponentTrackingOptions } from './preprocessors';\nimport type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from './types';\n\nconst DEFAULT_SENTRY_OPTIONS: SentrySvelteConfigOptions = {\n componentTracking: defaultComponentTrackingOptions,\n};\n\n/**\n * Add Sentry options to the Svelte config to be exported from the user's `svelte.config.js` file.\n *\n * @param originalConfig The existing config to be exported prior to adding Sentry\n * @param sentryOptions The configuration of the Sentry-added options\n *\n * @return The wrapped and modified config to be exported\n */\nexport function withSentryConfig(\n originalConfig: SvelteConfig,\n sentryOptions?: SentrySvelteConfigOptions,\n): SvelteConfig {\n const mergedOptions = {\n ...DEFAULT_SENTRY_OPTIONS,\n ...sentryOptions,\n };\n\n const originalPreprocessors = getOriginalPreprocessorArray(originalConfig);\n\n // Map is insertion-order-preserving. It's important to add preprocessors\n // to this map in the right order we want to see them being executed.\n // see: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map\n const sentryPreprocessors = new Map<string, SentryPreprocessorGroup>();\n\n const shouldTrackComponents = mergedOptions.componentTracking && mergedOptions.componentTracking.trackComponents;\n if (shouldTrackComponents) {\n const firstPassPreproc: SentryPreprocessorGroup = componentTrackingPreprocessor(mergedOptions.componentTracking);\n sentryPreprocessors.set(firstPassPreproc.sentryId || '', firstPassPreproc);\n }\n\n // We prioritize user-added preprocessors, so we don't insert sentry processors if they\n // have already been added by users.\n originalPreprocessors.forEach((p: SentryPreprocessorGroup) => {\n if (p.sentryId) {\n sentryPreprocessors.delete(p.sentryId);\n }\n });\n\n const mergedPreprocessors = [...sentryPreprocessors.values(), ...originalPreprocessors];\n\n return {\n ...originalConfig,\n preprocess: mergedPreprocessors,\n };\n}\n\n/**\n * Standardizes the different ways the user-provided preprocessor option can be specified.\n * Users can specify an array of preprocessors, a single one or no preprocessor.\n *\n * @param originalConfig the user-provided svelte config oject\n * @return an array of preprocessors or an empty array if no preprocessors were specified\n */\nfunction getOriginalPreprocessorArray(originalConfig: SvelteConfig): PreprocessorGroup[] {\n if (originalConfig.preprocess) {\n if (Array.isArray(originalConfig.preprocess)) {\n return originalConfig.preprocess;\n }\n return [originalConfig.preprocess];\n }\n return [];\n}\n"],"names":[],"mappings":";;AAKA,MAAM,sBAAsB,GAA8B;AAC1D,EAAE,iBAAiB,EAAE,+BAA+B;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC,EAAE,cAAc;AAChB,EAAE,aAAa;AACf,EAAgB;AAChB,EAAE,MAAM,gBAAgB;AACxB,IAAI,GAAG,sBAAsB;AAC7B,IAAI,GAAG,aAAa;AACpB,GAAG;;AAEH,EAAE,MAAM,qBAAsB,GAAE,4BAA4B,CAAC,cAAc,CAAC;;AAE5E;AACA;AACA;AACA,EAAE,MAAM,mBAAoB,GAAE,IAAI,GAAG,EAAmC;;AAExE,EAAE,MAAM,qBAAsB,GAAE,aAAa,CAAC,iBAAkB,IAAG,aAAa,CAAC,iBAAiB,CAAC,eAAe;AAClH,EAAE,IAAI,qBAAqB,EAAE;AAC7B,IAAI,MAAM,gBAAgB,GAA4B,6BAA6B,CAAC,aAAa,CAAC,iBAAiB,CAAC;AACpH,IAAI,mBAAmB,CAAC,GAAG,CAAC,gBAAgB,CAAC,QAAA,IAAY,EAAE,EAAE,gBAAgB,CAAC;AAC9E;;AAEA;AACA;AACA,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC,CAAC,KAA8B;AAChE,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE;AACpB,MAAM,mBAAmB,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5C;AACA,GAAG,CAAC;;AAEJ,EAAE,MAAM,mBAAA,GAAsB,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,EAAE,GAAG,qBAAqB,CAAC;;AAEzF,EAAE,OAAO;AACT,IAAI,GAAG,cAAc;AACrB,IAAI,UAAU,EAAE,mBAAmB;AACnC,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,cAAc,EAAqC;AACzF,EAAE,IAAI,cAAc,CAAC,UAAU,EAAE;AACjC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;AAClD,MAAM,OAAO,cAAc,CAAC,UAAU;AACtC;AACA,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC;AACtC;AACA,EAAE,OAAO,EAAE;AACX;;;;"}
1
+ {"version":3,"file":"config.js","sources":["../../src/config.ts"],"sourcesContent":["import type { PreprocessorGroup } from 'svelte/types/compiler/preprocess';\n\nimport { componentTrackingPreprocessor, defaultComponentTrackingOptions } from './preprocessors';\nimport type { SentryPreprocessorGroup, SentrySvelteConfigOptions, SvelteConfig } from './types';\n\nconst DEFAULT_SENTRY_OPTIONS: SentrySvelteConfigOptions = {\n componentTracking: defaultComponentTrackingOptions,\n};\n\n/**\n * Add Sentry options to the Svelte config to be exported from the user's `svelte.config.js` file.\n *\n * @param originalConfig The existing config to be exported prior to adding Sentry\n * @param sentryOptions The configuration of the Sentry-added options\n *\n * @return The wrapped and modified config to be exported\n */\nexport function withSentryConfig(\n originalConfig: SvelteConfig,\n sentryOptions?: SentrySvelteConfigOptions,\n): SvelteConfig {\n const mergedOptions = {\n ...DEFAULT_SENTRY_OPTIONS,\n ...sentryOptions,\n componentTracking: {\n ...DEFAULT_SENTRY_OPTIONS.componentTracking,\n ...(sentryOptions && sentryOptions.componentTracking),\n },\n };\n\n const originalPreprocessors = getOriginalPreprocessorArray(originalConfig);\n\n // Bail if users already added the preprocessor\n if (originalPreprocessors.find((p: PreprocessorGroup) => !!(p as SentryPreprocessorGroup).sentryId)) {\n return originalConfig;\n }\n\n const mergedPreprocessors = [...originalPreprocessors];\n if (mergedOptions.componentTracking.trackComponents) {\n mergedPreprocessors.unshift(componentTrackingPreprocessor(mergedOptions.componentTracking));\n }\n\n return {\n ...originalConfig,\n preprocess: mergedPreprocessors,\n };\n}\n\n/**\n * Standardizes the different ways the user-provided preprocessor option can be specified.\n * Users can specify an array of preprocessors, a single one or no preprocessor.\n *\n * @param originalConfig the user-provided svelte config oject\n * @return an array of preprocessors or an empty array if no preprocessors were specified\n */\nfunction getOriginalPreprocessorArray(originalConfig: SvelteConfig): PreprocessorGroup[] {\n if (originalConfig.preprocess) {\n if (Array.isArray(originalConfig.preprocess)) {\n return originalConfig.preprocess;\n }\n return [originalConfig.preprocess];\n }\n return [];\n}\n"],"names":[],"mappings":";;AAKA,MAAM,sBAAsB,GAA8B;AAC1D,EAAE,iBAAiB,EAAE,+BAA+B;AACpD,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,gBAAgB;AAChC,EAAE,cAAc;AAChB,EAAE,aAAa;AACf,EAAgB;AAChB,EAAE,MAAM,gBAAgB;AACxB,IAAI,GAAG,sBAAsB;AAC7B,IAAI,GAAG,aAAa;AACpB,IAAI,iBAAiB,EAAE;AACvB,MAAM,GAAG,sBAAsB,CAAC,iBAAiB;AACjD,MAAM,IAAI,aAAA,IAAiB,aAAa,CAAC,iBAAiB,CAAC;AAC3D,KAAK;AACL,GAAG;;AAEH,EAAE,MAAM,qBAAsB,GAAE,4BAA4B,CAAC,cAAc,CAAC;;AAE5E;AACA,EAAE,IAAI,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,KAAwB,CAAC,CAAC,CAAC,CAAA,GAA8B,QAAQ,CAAC,EAAE;AACvG,IAAI,OAAO,cAAc;AACzB;;AAEA,EAAE,MAAM,mBAAoB,GAAE,CAAC,GAAG,qBAAqB,CAAC;AACxD,EAAE,IAAI,aAAa,CAAC,iBAAiB,CAAC,eAAe,EAAE;AACvD,IAAI,mBAAmB,CAAC,OAAO,CAAC,6BAA6B,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC;AAC/F;;AAEA,EAAE,OAAO;AACT,IAAI,GAAG,cAAc;AACrB,IAAI,UAAU,EAAE,mBAAmB;AACnC,GAAG;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,4BAA4B,CAAC,cAAc,EAAqC;AACzF,EAAE,IAAI,cAAc,CAAC,UAAU,EAAE;AACjC,IAAI,IAAI,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,EAAE;AAClD,MAAM,OAAO,cAAc,CAAC,UAAU;AACtC;AACA,IAAI,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC;AACtC;AACA,EAAE,OAAO,EAAE;AACX;;;;"}
@@ -1 +1 @@
1
- {"type":"module","version":"8.53.0","sideEffects":false}
1
+ {"type":"module","version":"8.55.0","sideEffects":false}
@@ -1,7 +1,6 @@
1
1
  import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN } from '@sentry/browser';
2
2
  import { onMount, beforeUpdate, afterUpdate } from 'svelte';
3
- import { startInactiveSpan } from '@sentry/core';
4
- import { UI_SVELTE_INIT, UI_SVELTE_UPDATE, DEFAULT_COMPONENT_NAME } from './constants.js';
3
+ import { logger, startInactiveSpan } from '@sentry/core';
5
4
 
6
5
  const defaultTrackComponentOptions
7
6
 
@@ -24,21 +23,27 @@ function trackComponent(options) {
24
23
 
25
24
  const customComponentName = mergedOptions.componentName;
26
25
 
27
- const componentName = `<${customComponentName || DEFAULT_COMPONENT_NAME}>`;
26
+ const componentName = `<${customComponentName || 'Svelte Component'}>`;
28
27
 
29
28
  if (mergedOptions.trackInit) {
30
29
  recordInitSpan(componentName);
31
30
  }
32
31
 
33
32
  if (mergedOptions.trackUpdates) {
34
- recordUpdateSpans(componentName);
33
+ try {
34
+ recordUpdateSpans(componentName);
35
+ } catch (e) {
36
+ logger.warn(
37
+ "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.",
38
+ );
39
+ }
35
40
  }
36
41
  }
37
42
 
38
43
  function recordInitSpan(componentName) {
39
44
  const initSpan = startInactiveSpan({
40
45
  onlyIfParent: true,
41
- op: UI_SVELTE_INIT,
46
+ op: 'ui.svelte.init',
42
47
  name: componentName,
43
48
  attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
44
49
  });
@@ -53,7 +58,7 @@ function recordUpdateSpans(componentName) {
53
58
  beforeUpdate(() => {
54
59
  updateSpan = startInactiveSpan({
55
60
  onlyIfParent: true,
56
- op: UI_SVELTE_UPDATE,
61
+ op: 'ui.svelte.update',
57
62
  name: componentName,
58
63
  attributes: { [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.svelte' },
59
64
  });
@@ -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 { afterUpdate, beforeUpdate, onMount } from 'svelte';\n\nimport { startInactiveSpan } 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 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 || DEFAULT_COMPONENT_NAME}>`;\n\n if (mergedOptions.trackInit) {\n recordInitSpan(componentName);\n }\n\n if (mergedOptions.trackUpdates) {\n recordUpdateSpans(componentName);\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":";;;;;AAQA,MAAM;;AAIN,GAAI;AACJ,EAAE,SAAS,EAAE,IAAI;AACjB,EAAE,YAAY,EAAE,IAAI;AACpB,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,aAAc,GAAE,CAAC,CAAC,EAAE,mBAAA,IAAuB,sBAAsB,CAAC,CAAC,CAAC;;AAE5E,EAAE,IAAI,aAAa,CAAC,SAAS,EAAE;AAC/B,IAAI,cAAc,CAAC,aAAa,CAAC;AACjC;;AAEA,EAAE,IAAI,aAAa,CAAC,YAAY,EAAE;AAClC,IAAI,iBAAiB,CAAC,aAAa,CAAC;AACpC;AACA;;AAEA,SAAS,cAAc,CAAC,aAAa,EAAgB;AACrD,EAAE,MAAM,QAAA,GAAW,iBAAiB,CAAC;AACrC,IAAI,YAAY,EAAE,IAAI;AACtB,IAAI,EAAE,EAAE,cAAc;AACtB,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,gBAAgB;AAC1B,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;;;;"}
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 { afterUpdate, beforeUpdate, onMount } from 'svelte';\n\nimport { logger, startInactiveSpan } from '@sentry/core';\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 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 logger.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,IAAI;AACpB,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,aAAc,GAAE,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,OAAM,CAAA,EAAA;AACZ,MAAM,MAAM,CAAC,IAAI;AACjB,QAAQ,0LAA0L;AAClM,OAAO;AACP;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;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA2B,yBAAyB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMhG;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,YAAY,EAC5B,aAAa,CAAC,EAAE,yBAAyB,GACxC,YAAY,CAiCd"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAA2B,yBAAyB,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMhG;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,cAAc,EAAE,YAAY,EAC5B,aAAa,CAAC,EAAE,yBAAyB,GACxC,YAAY,CA0Bd"}
@@ -1 +1 @@
1
- {"version":3,"file":"performance.d.ts","sourceRoot":"","sources":["../../src/performance.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAWrD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAcpE"}
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,CAoBpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sentry/svelte",
3
- "version": "8.53.0",
3
+ "version": "8.55.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",
@@ -36,11 +36,12 @@
36
36
  }
37
37
  },
38
38
  "publishConfig": {
39
- "access": "public"
39
+ "access": "public",
40
+ "tag": "v8"
40
41
  },
41
42
  "dependencies": {
42
- "@sentry/browser": "8.53.0",
43
- "@sentry/core": "8.53.0",
43
+ "@sentry/browser": "8.55.0",
44
+ "@sentry/core": "8.55.0",
44
45
  "magic-string": "^0.30.0"
45
46
  },
46
47
  "peerDependencies": {
@@ -1,12 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
-
3
- const UI_SVELTE_INIT = 'ui.svelte.init';
4
-
5
- const UI_SVELTE_UPDATE = 'ui.svelte.update';
6
-
7
- const DEFAULT_COMPONENT_NAME = 'Svelte Component';
8
-
9
- exports.DEFAULT_COMPONENT_NAME = DEFAULT_COMPONENT_NAME;
10
- exports.UI_SVELTE_INIT = UI_SVELTE_INIT;
11
- exports.UI_SVELTE_UPDATE = UI_SVELTE_UPDATE;
12
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const UI_SVELTE_INIT = 'ui.svelte.init';\n\nexport const UI_SVELTE_UPDATE = 'ui.svelte.update';\n\nexport const DEFAULT_COMPONENT_NAME = 'Svelte Component';\n"],"names":[],"mappings":";;AAAO,MAAM,cAAe,GAAE;;AAEvB,MAAM,gBAAiB,GAAE;;AAEzB,MAAM,sBAAuB,GAAE;;;;;;"}
@@ -1,8 +0,0 @@
1
- const UI_SVELTE_INIT = 'ui.svelte.init';
2
-
3
- const UI_SVELTE_UPDATE = 'ui.svelte.update';
4
-
5
- const DEFAULT_COMPONENT_NAME = 'Svelte Component';
6
-
7
- export { DEFAULT_COMPONENT_NAME, UI_SVELTE_INIT, UI_SVELTE_UPDATE };
8
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sources":["../../src/constants.ts"],"sourcesContent":["export const UI_SVELTE_INIT = 'ui.svelte.init';\n\nexport const UI_SVELTE_UPDATE = 'ui.svelte.update';\n\nexport const DEFAULT_COMPONENT_NAME = 'Svelte Component';\n"],"names":[],"mappings":"AAAO,MAAM,cAAe,GAAE;;AAEvB,MAAM,gBAAiB,GAAE;;AAEzB,MAAM,sBAAuB,GAAE;;;;"}
@@ -1,4 +0,0 @@
1
- export declare const UI_SVELTE_INIT = "ui.svelte.init";
2
- export declare const UI_SVELTE_UPDATE = "ui.svelte.update";
3
- export declare const DEFAULT_COMPONENT_NAME = "Svelte Component";
4
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,mBAAmB,CAAC;AAE/C,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,eAAO,MAAM,sBAAsB,qBAAqB,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const UI_SVELTE_INIT = "ui.svelte.init";
2
- export declare const UI_SVELTE_UPDATE = "ui.svelte.update";
3
- export declare const DEFAULT_COMPONENT_NAME = "Svelte Component";
4
- //# sourceMappingURL=constants.d.ts.map