Skip to content

Commit e507097

Browse files
committed
adjustments
1 parent 7e2a589 commit e507097

File tree

7 files changed

+42
-15
lines changed

7 files changed

+42
-15
lines changed

packages/browser/src/sdk.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ export function init(browserOptions: BrowserOptions = {}): Client | undefined {
149149

150150
/**
151151
* Initialize a browser client with the provided options and default integrations getter function.
152+
* This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
153+
* Instead, use `init()` to initialize the SDK.
154+
*
155+
* @hidden
156+
* @internal
152157
*/
153158
export function initWithDefaultIntegrations(
154159
browserOptions: BrowserOptions = {},

packages/cloudflare/src/sdk.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,10 @@ export function getDefaultIntegrations(options: CloudflareOptions): Integration[
3232
* Initializes the cloudflare SDK.
3333
*/
3434
export function init(options: CloudflareOptions): CloudflareClient | undefined {
35-
const defaultIntegrations = getDefaultIntegrations(options);
36-
3735
const clientOptions: CloudflareClientOptions = {
3836
...options,
3937
stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),
40-
integrations: getIntegrationsToSetup(options, defaultIntegrations),
38+
integrations: getIntegrationsToSetup(options, getDefaultIntegrations(options)),
4139
transport: options.transport || makeCloudflareTransport,
4240
};
4341

packages/core/src/integration.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,21 @@ export function getIntegrationsToSetup(
4646
): Integration[] {
4747
const userIntegrations = options.integrations;
4848

49-
// If `defaultIntegrations: false` is defined, we disable all default integrations
49+
// User-defined defaultIntegrations
5050
// TODO(v10): If an array is passed, we use this - this is deprecated and will eventually be removed
51+
const passedDefaultIntegrations = Array.isArray(options.defaultIntegrations)
52+
? options.defaultIntegrations
53+
: undefined;
54+
55+
if (DEBUG_BUILD && passedDefaultIntegrations) {
56+
logger.warn('Sentry: The `defaultIntegrations` option is deprecated. Use the `integrations` option instead.');
57+
}
58+
59+
// If `defaultIntegrations: false` is defined, we disable all default integrations
60+
5161
// Else, we use the default integrations that are directly passed to this function as second argument
5262
const defaultIntegrationsToUse =
53-
options.defaultIntegrations === false
54-
? []
55-
: Array.isArray(options.defaultIntegrations)
56-
? options.defaultIntegrations
57-
: defaultIntegrations;
63+
options.defaultIntegrations === false ? [] : passedDefaultIntegrations || defaultIntegrations;
5864

5965
// We flag default instances, so that later we can tell them apart from any user-created instances of the same class
6066
defaultIntegrationsToUse.forEach((integration: IntegrationWithDefaultInstance) => {

packages/node/src/sdk/index.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,18 @@ export function init(options: NodeOptions | undefined = {}): NodeClient | undefi
9393

9494
/**
9595
* Initialize Sentry for Node, without any integrations added by default.
96-
*
97-
* @deprecated Use `initWithDefaultIntegrations` directly instead. This function will be removed in the next major version.
9896
*/
9997
export function initWithoutDefaultIntegrations(options: NodeOptions | undefined = {}): NodeClient {
10098
return initWithDefaultIntegrations(options, () => []);
10199
}
102100

103101
/**
104-
* Initialize Sentry for Node, with the specified getter function for default integrations.
102+
* Initialize a Node client with the provided options and default integrations getter function.
103+
* This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
104+
* Instead, use `init()` to initialize the SDK.
105+
*
106+
* @hidden
107+
* @internal
105108
*/
106109
export function initWithDefaultIntegrations(
107110
_options: NodeOptions | undefined = {},

packages/react/src/sdk.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ export function init(options: BrowserOptions): Client | undefined {
2323
}
2424

2525
/**
26-
* Init the React SDK with the given default integrations getter function.
26+
* Initialize a React client with the provided options and default integrations getter function.
27+
* This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
28+
* Instead, use `init()` to initialize the SDK.
29+
*
30+
* @hidden
31+
* @internal
2732
*/
2833
export function initWithDefaultIntegrations(
2934
options: BrowserOptions,

packages/solid/src/sdk.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ export function init(options: BrowserOptions): BrowserClient | undefined {
1414
}
1515

1616
/**
17-
* Initializes the Solid SDK with the given
17+
* Initialize a Solid client with the provided options and default integrations getter function.
18+
* This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
19+
* Instead, use `init()` to initialize the SDK.
20+
*
21+
* @hidden
22+
* @internal
1823
*/
1924
export function initWithDefaultIntegrations(
2025
options: BrowserOptions,

packages/svelte/src/sdk.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ export function init(options: BrowserOptions): Client | undefined {
1414
}
1515

1616
/**
17-
* Inits the Svelte SDK with the given default integrations getter function.
17+
* Initialize a Svelte client with the provided options and default integrations getter function.
18+
* This is an internal method the SDK uses under the hood to set up things - you should not use this as a user!
19+
* Instead, use `init()` to initialize the SDK.
20+
*
21+
* @hidden
22+
* @internal
1823
*/
1924
export function initWithDefaultIntegrations(
2025
options: BrowserOptions,

0 commit comments

Comments
 (0)