@spotlightjs/overlay 2.1.0 → 2.2.1

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.
@@ -3,4 +3,3 @@ export declare const DEFAULT_EXPERIMENTS: {
3
3
  'sentry:focus-local-events': boolean;
4
4
  };
5
5
  export declare const DEFAULT_ANCHOR = "bottomRight";
6
- export declare const CONTEXT_LINES_ENDPOINT = "/@spotlight/contextlines";
@@ -1,4 +1,5 @@
1
- import { CONTEXT_LINES_ENDPOINT, DEFAULT_ANCHOR, DEFAULT_EXPERIMENTS, DEFAULT_SIDECAR_URL } from './constants.ts';
1
+ import { CONTEXT_LINES_ENDPOINT } from '@spotlightjs/sidecar/constants';
2
+ import { DEFAULT_ANCHOR, DEFAULT_EXPERIMENTS, DEFAULT_SIDECAR_URL } from './constants.ts';
2
3
  import { off, on, trigger } from './lib/eventTarget.ts';
3
4
  import { React, ReactDOM } from './react-instance.tsx';
4
5
  import { SpotlightOverlayOptions } from './types.ts';
@@ -1,6 +1,6 @@
1
1
  import { Envelope } from '@sentry/types';
2
2
  import { RawEventContext } from '../../../integrations/integration';
3
- import { Sdk, SentryEvent, Span, Trace } from '../types';
3
+ import { Sdk, SentryErrorEvent, SentryEvent, Span, Trace } from '../types';
4
4
  type OnlineSubscription = ['online', (status: boolean) => void];
5
5
  type EventSubscription = ['event', (event: SentryEvent) => void];
6
6
  type TraceSubscription = ['trace', (trace: Trace) => void];
@@ -19,9 +19,11 @@ declare class SentryDataCache {
19
19
  rawEnvelope: RawEventContext;
20
20
  }[];
21
21
  protected subscribers: Map<string, Subscription>;
22
+ protected contextLinesProvider: string;
22
23
  constructor(initial?: (SentryEvent & {
23
24
  event_id?: string;
24
25
  })[]);
26
+ setSidecarUrl(url: string): void;
25
27
  inferSdkFromEvent(event: SentryEvent): Sdk;
26
28
  pushEnvelope({ envelope, rawEnvelope }: {
27
29
  envelope: Envelope;
@@ -56,6 +58,12 @@ declare class SentryDataCache {
56
58
  * information about any session-initiated traces.
57
59
  */
58
60
  isTraceLocal(traceId: string): boolean | null;
61
+ /**
62
+ * Reverses the stack trace and tries to fill missing context lines
63
+ * @param errorEvent
64
+ * @returns
65
+ */
66
+ processStacktrace(errorEvent: SentryErrorEvent): Promise<void[]>;
59
67
  }
60
68
  declare const _default: SentryDataCache;
61
69
  export default _default;
@@ -2,9 +2,9 @@ import { Client, Event } from '@sentry/types';
2
2
  type SpotlightBrowserIntegrationOptions = {
3
3
  /**
4
4
  * The URL of the Sidecar instance to connect and forward events to.
5
- * If not set, Spotlight will try to connect to the Sidecar running on localhost:8969.
5
+ * If not set, Spotlight will try to connect to the Sidecar running on DEFAULT_SIDECAR_URL.
6
6
  *
7
- * @default "http://localhost:8969/stream"
7
+ * @default DEFAULT_SIDECAR_URL
8
8
  */
9
9
  sidecarUrl?: string;
10
10
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@spotlightjs/overlay",
3
3
  "description": "The overlay of Spotlight to add debug interface to your web app.",
4
- "version": "2.1.0",
4
+ "version": "2.2.1",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "files": [
@@ -50,7 +50,8 @@
50
50
  "react-diff-viewer-continued": "^3.4.0",
51
51
  "@types/beautify": "^0.0.3",
52
52
  "react-json-view": "^1.21.3",
53
- "@spotlightjs/tsconfig": "1.0.0"
53
+ "@spotlightjs/tsconfig": "1.0.0",
54
+ "@spotlightjs/sidecar": "1.7.0"
54
55
  },
55
56
  "volta": {
56
57
  "extends": "../../package.json"