@sentry/browser 8.37.1 → 8.39.0-beta.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/npm/cjs/index.js +5 -0
- package/build/npm/cjs/index.js.map +1 -1
- package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js +71 -0
- package/build/npm/cjs/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/cjs/integrations/spotlight.js +87 -0
- package/build/npm/cjs/integrations/spotlight.js.map +1 -0
- package/build/npm/cjs/profiling/utils.js +1 -52
- package/build/npm/cjs/profiling/utils.js.map +1 -1
- package/build/npm/cjs/utils/featureFlags.js +64 -0
- package/build/npm/cjs/utils/featureFlags.js.map +1 -0
- package/build/npm/cjs/utils/lazyLoadIntegration.js +1 -0
- package/build/npm/cjs/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/esm/index.js +2 -0
- package/build/npm/esm/index.js.map +1 -1
- package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js +68 -0
- package/build/npm/esm/integrations/featureFlags/launchdarkly/integration.js.map +1 -0
- package/build/npm/esm/integrations/spotlight.js +83 -0
- package/build/npm/esm/integrations/spotlight.js.map +1 -0
- package/build/npm/esm/package.json +1 -1
- package/build/npm/esm/profiling/utils.js +2 -53
- package/build/npm/esm/profiling/utils.js.map +1 -1
- package/build/npm/esm/utils/featureFlags.js +61 -0
- package/build/npm/esm/utils/featureFlags.js.map +1 -0
- package/build/npm/esm/utils/lazyLoadIntegration.js +1 -0
- package/build/npm/esm/utils/lazyLoadIntegration.js.map +1 -1
- package/build/npm/types/index.d.ts +2 -0
- package/build/npm/types/index.d.ts.map +1 -1
- package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts +2 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/index.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts +25 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/integration.d.ts.map +1 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts +44 -0
- package/build/npm/types/integrations/featureFlags/launchdarkly/types.d.ts.map +1 -0
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts +2 -0
- package/build/npm/types/integrations-bundle/index.modulemetadata.d.ts.map +1 -0
- package/build/npm/types/profiling/utils.d.ts.map +1 -1
- package/build/npm/types/utils/featureFlags.d.ts +26 -0
- package/build/npm/types/utils/featureFlags.d.ts.map +1 -0
- package/build/npm/types/utils/lazyLoadIntegration.d.ts +1 -0
- package/build/npm/types/utils/lazyLoadIntegration.d.ts.map +1 -1
- package/build/npm/types-ts3.8/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/index.d.ts +2 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/integration.d.ts +25 -0
- package/build/npm/types-ts3.8/integrations/featureFlags/launchdarkly/types.d.ts +44 -0
- package/build/npm/types-ts3.8/integrations-bundle/index.modulemetadata.d.ts +2 -0
- package/build/npm/types-ts3.8/utils/featureFlags.d.ts +26 -0
- package/build/npm/types-ts3.8/utils/lazyLoadIntegration.d.ts +1 -0
- package/package.json +9 -9
|
@@ -16,6 +16,7 @@ declare const LazyLoadableIntegrations: {
|
|
|
16
16
|
readonly rewriteFramesIntegration: "rewriteframes";
|
|
17
17
|
readonly sessionTimingIntegration: "sessiontiming";
|
|
18
18
|
readonly browserProfilingIntegration: "browserprofiling";
|
|
19
|
+
readonly moduleMetadataIntegration: "modulemetadata";
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
21
22
|
* Lazy load an integration from the CDN.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lazyLoadIntegration.d.ts","sourceRoot":"","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAKnD,QAAA,MAAM,wBAAwB
|
|
1
|
+
{"version":3,"file":"lazyLoadIntegration.d.ts","sourceRoot":"","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAKnD,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;CAkBpB,CAAC;AAMX;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,OAAO,wBAAwB,EAC3C,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,aAAa,CAAC,CAwDxB"}
|
|
@@ -18,4 +18,6 @@ export { addTracingExtensions, registerSpanErrorInstrumentation, getActiveSpan,
|
|
|
18
18
|
export { Span } from '@sentry/types';
|
|
19
19
|
export { makeBrowserOfflineTransport } from './transports/offline';
|
|
20
20
|
export { browserProfilingIntegration } from './profiling/integration';
|
|
21
|
+
export { spotlightBrowserIntegration } from './integrations/spotlight';
|
|
22
|
+
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
|
|
21
23
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LDInspectionFlagUsedHandler } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sentry integration for capturing feature flags from LaunchDarkly.
|
|
4
|
+
*
|
|
5
|
+
* See the [feature flag documentation](https://develop.sentry.dev/sdk/expected-features/#feature-flags) for more information.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* import * as Sentry from '@sentry/browser';
|
|
10
|
+
* import {launchDarklyIntegration, buildLaunchDarklyFlagUsedInspector} from '@sentry/browser';
|
|
11
|
+
* import * as LaunchDarkly from 'launchdarkly-js-client-sdk';
|
|
12
|
+
*
|
|
13
|
+
* Sentry.init(..., integrations: [launchDarklyIntegration()])
|
|
14
|
+
* const ldClient = LaunchDarkly.initialize(..., {inspectors: [buildLaunchDarklyFlagUsedHandler()]});
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare const launchDarklyIntegration: () => import("@sentry/types").Integration;
|
|
18
|
+
/**
|
|
19
|
+
* LaunchDarkly hook that listens for flag evaluations and updates the `flags`
|
|
20
|
+
* context in our Sentry scope. This needs to be registered as an
|
|
21
|
+
* 'inspector' in LaunchDarkly initialize() options, separately from
|
|
22
|
+
* `launchDarklyIntegration`. Both are needed to collect feature flags on error.
|
|
23
|
+
*/
|
|
24
|
+
export declare function buildLaunchDarklyFlagUsedHandler(): LDInspectionFlagUsedHandler;
|
|
25
|
+
//# sourceMappingURL=integration.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline definitions of LaunchDarkly types so we don't have to include their
|
|
3
|
+
* SDK in devDependencies. These are only for type-checking and can be extended
|
|
4
|
+
* as needed - for exact definitions, reference `launchdarkly-js-client-sdk`.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Currently, the Sentry integration does not read from values of this type.
|
|
8
|
+
*/
|
|
9
|
+
export type LDContext = object;
|
|
10
|
+
/**
|
|
11
|
+
* An object that combines the result of a feature flag evaluation with information about
|
|
12
|
+
* how it was calculated.
|
|
13
|
+
*/
|
|
14
|
+
export interface LDEvaluationDetail {
|
|
15
|
+
value: unknown;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Callback interface for collecting information about the SDK at runtime.
|
|
19
|
+
*
|
|
20
|
+
* This interface is used to collect information about flag usage.
|
|
21
|
+
*
|
|
22
|
+
* This interface should not be used by the application to access flags for the purpose of controlling application
|
|
23
|
+
* flow. It is intended for monitoring, analytics, or debugging purposes.
|
|
24
|
+
*/
|
|
25
|
+
export interface LDInspectionFlagUsedHandler {
|
|
26
|
+
type: 'flag-used';
|
|
27
|
+
/**
|
|
28
|
+
* Name of the inspector. Will be used for logging issues with the inspector.
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* If `true`, then the inspector will be ran synchronously with evaluation.
|
|
33
|
+
* Synchronous inspectors execute inline with evaluation and care should be taken to ensure
|
|
34
|
+
* they have minimal performance overhead.
|
|
35
|
+
*/
|
|
36
|
+
synchronous?: boolean;
|
|
37
|
+
/**
|
|
38
|
+
* This method is called when a flag is accessed via a variation method, or it can be called based on actions in
|
|
39
|
+
* wrapper SDKs which have different methods of tracking when a flag was accessed. It is not called when a call is made
|
|
40
|
+
* to allFlags.
|
|
41
|
+
*/
|
|
42
|
+
method: (flagKey: string, flagDetail: LDEvaluationDetail, context: LDContext) => void;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { FeatureFlag } from '@sentry/types';
|
|
2
|
+
/**
|
|
3
|
+
* Ordered LRU cache for storing feature flags in the scope context. The name
|
|
4
|
+
* of each flag in the buffer is unique, and the output of getAll() is ordered
|
|
5
|
+
* from oldest to newest.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Max size of the LRU flag buffer stored in Sentry scope and event contexts.
|
|
9
|
+
*/
|
|
10
|
+
export declare const FLAG_BUFFER_SIZE = 100;
|
|
11
|
+
/**
|
|
12
|
+
* Insert into a FeatureFlag array while maintaining ordered LRU properties. Not
|
|
13
|
+
* thread-safe. After inserting:
|
|
14
|
+
* - `flags` is sorted in order of recency, with the newest flag at the end.
|
|
15
|
+
* - No other flags with the same name exist in `flags`.
|
|
16
|
+
* - The length of `flags` does not exceed `maxSize`. The oldest flag is evicted
|
|
17
|
+
* as needed.
|
|
18
|
+
*
|
|
19
|
+
* @param flags The array to insert into.
|
|
20
|
+
* @param name Name of the feature flag to insert.
|
|
21
|
+
* @param value Value of the feature flag.
|
|
22
|
+
* @param maxSize Max number of flags the buffer should store. It's recommended
|
|
23
|
+
* to keep this consistent across insertions. Default is DEFAULT_MAX_SIZE
|
|
24
|
+
*/
|
|
25
|
+
export declare function insertToFlagBuffer(flags: FeatureFlag[], name: string, value: boolean, maxSize?: number): void;
|
|
26
|
+
//# sourceMappingURL=featureFlags.d.ts.map
|
|
@@ -16,6 +16,7 @@ declare const LazyLoadableIntegrations: {
|
|
|
16
16
|
readonly rewriteFramesIntegration: "rewriteframes";
|
|
17
17
|
readonly sessionTimingIntegration: "sessiontiming";
|
|
18
18
|
readonly browserProfilingIntegration: "browserprofiling";
|
|
19
|
+
readonly moduleMetadataIntegration: "modulemetadata";
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
21
22
|
* Lazy load an integration from the CDN.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sentry/browser",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.39.0-beta.0",
|
|
4
4
|
"description": "Official Sentry SDK for browsers",
|
|
5
5
|
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
6
|
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/browser",
|
|
@@ -39,16 +39,16 @@
|
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sentry-internal/browser-utils": "8.
|
|
43
|
-
"@sentry-internal/feedback": "8.
|
|
44
|
-
"@sentry-internal/replay": "8.
|
|
45
|
-
"@sentry-internal/replay-canvas": "8.
|
|
46
|
-
"@sentry/core": "8.
|
|
47
|
-
"@sentry/types": "8.
|
|
48
|
-
"@sentry/utils": "8.
|
|
42
|
+
"@sentry-internal/browser-utils": "8.39.0-beta.0",
|
|
43
|
+
"@sentry-internal/feedback": "8.39.0-beta.0",
|
|
44
|
+
"@sentry-internal/replay": "8.39.0-beta.0",
|
|
45
|
+
"@sentry-internal/replay-canvas": "8.39.0-beta.0",
|
|
46
|
+
"@sentry/core": "8.39.0-beta.0",
|
|
47
|
+
"@sentry/types": "8.39.0-beta.0",
|
|
48
|
+
"@sentry/utils": "8.39.0-beta.0"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@sentry-internal/integration-shims": "8.
|
|
51
|
+
"@sentry-internal/integration-shims": "8.39.0-beta.0",
|
|
52
52
|
"fake-indexeddb": "^4.0.1"
|
|
53
53
|
},
|
|
54
54
|
"scripts": {
|