Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Update Sentry JavaScript to v8.41.0 #1025

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,17 @@
"e2e": "xvfb-maybe vitest run --root=./test/e2e --silent=false --disable-console-intercept"
},
"dependencies": {
"@sentry/browser": "8.40.0",
"@sentry/core": "8.40.0",
"@sentry/node": "8.40.0",
"@sentry/types": "8.40.0",
"@sentry/utils": "8.40.0",
"@sentry/browser": "8.41.0",
"@sentry/core": "8.41.0",
"@sentry/node": "8.41.0",
"@sentry/types": "8.41.0",
"deepmerge": "4.3.1"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-typescript": "^11.1.6",
"@sentry-internal/eslint-config-sdk": "8.40.0",
"@sentry-internal/typescript": "8.40.0",
"@sentry-internal/eslint-config-sdk": "8.41.0",
"@sentry-internal/typescript": "8.41.0",
"@types/busboy": "^1.5.4",
"@types/form-data": "^2.5.0",
"@types/koa": "^2.0.52",
Expand Down
2 changes: 1 addition & 1 deletion src/common/envelope.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { forEachEnvelopeItem } from '@sentry/core';
import { Attachment, AttachmentItem, Envelope, Event, EventItem, Profile } from '@sentry/types';
import { forEachEnvelopeItem } from '@sentry/utils';

/** Pulls an event and additional envelope items out of an envelope. Returns undefined if there was no event */
export function eventFromEnvelope(envelope: Envelope): [Event, Attachment[], Profile | undefined] | undefined {
Expand Down
2 changes: 1 addition & 1 deletion src/main/anr.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { callFrameToStackFrame, logger, stripSentryFramesAndReverse, watchdogTimer } from '@sentry/core';
import { captureEvent, createGetModuleFromFilename, getClient, StackFrame } from '@sentry/node';
import { Event } from '@sentry/types';
import { callFrameToStackFrame, logger, stripSentryFramesAndReverse, watchdogTimer } from '@sentry/utils';
import { app, WebContents } from 'electron';

import { RendererStatus } from '../common/ipc';
Expand Down
2 changes: 1 addition & 1 deletion src/main/electron-normalize.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseSemver } from '@sentry/utils';
import { parseSemver } from '@sentry/core';
import { app } from 'electron';
import { join } from 'path';

Expand Down
2 changes: 2 additions & 0 deletions src/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export {
addEventProcessor,
addIntegration,
addOpenTelemetryInstrumentation,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
captureCheckIn,
Expand All @@ -47,6 +48,7 @@ export {
endSession,
expressErrorHandler,
expressIntegration,
// eslint-disable-next-line deprecation/deprecation
extractRequestData,
extraErrorDataIntegration,
fastifyIntegration,
Expand Down
3 changes: 1 addition & 2 deletions src/main/integrations/electron-minidump.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { applyScopeDataToEvent, defineIntegration } from '@sentry/core';
import { applyScopeDataToEvent, defineIntegration, logger, makeDsn, SentryError, uuid4 } from '@sentry/core';
import { NodeClient, NodeOptions } from '@sentry/node';
import { Event, ScopeData } from '@sentry/types';
import { logger, makeDsn, SentryError, uuid4 } from '@sentry/utils';
import { app, crashReporter } from 'electron';

import { addScopeListener, getScopeData } from '../../common/scope';
Expand Down
14 changes: 6 additions & 8 deletions src/main/integrations/net-breadcrumbs.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import {
addBreadcrumb,
defineIntegration,
dynamicSamplingContextToSentryBaggageHeader,
fill,
generateSentryTraceHeader,
getClient,
getCurrentScope,
getDynamicSamplingContextFromClient,
getDynamicSamplingContextFromSpan,
getIsolationScope,
logger,
LRUMap,
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
SentryNonRecordingSpan,
setHttpStatus,
spanToTraceHeader,
startInactiveSpan,
stringMatchesSomePattern,
} from '@sentry/core';
import { DynamicSamplingContext, TracePropagationTargets } from '@sentry/types';
import {
dynamicSamplingContextToSentryBaggageHeader,
fill,
generateSentryTraceHeader,
logger,
LRUMap,
stringMatchesSomePattern,
} from '@sentry/utils';
import { ClientRequest, ClientRequestConstructorOptions, IncomingMessage, net as electronNet } from 'electron';
import * as urlModule from 'url';

Expand Down
3 changes: 1 addition & 2 deletions src/main/integrations/preload-injection.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineIntegration } from '@sentry/core';
import { logger } from '@sentry/utils';
import { defineIntegration, logger } from '@sentry/core';
import { app } from 'electron';
import { existsSync } from 'fs';
import { isAbsolute, resolve } from 'path';
Expand Down
3 changes: 1 addition & 2 deletions src/main/integrations/renderer-profiling.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { defineIntegration } from '@sentry/core';
import { defineIntegration, forEachEnvelopeItem, LRUMap } from '@sentry/core';
import { Event, Profile } from '@sentry/types';
import { forEachEnvelopeItem, LRUMap } from '@sentry/utils';
import { app } from 'electron';

import { getDefaultEnvironment, getDefaultReleaseName } from '../context';
Expand Down
3 changes: 1 addition & 2 deletions src/main/integrations/screenshots.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineIntegration } from '@sentry/core';
import { logger } from '@sentry/utils';
import { defineIntegration, logger } from '@sentry/core';
import { BrowserWindow } from 'electron';

import { ElectronMainOptions } from '../sdk';
Expand Down
3 changes: 1 addition & 2 deletions src/main/integrations/sentry-minidump/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { applyScopeDataToEvent, captureEvent, defineIntegration, Scope } from '@sentry/core';
import { applyScopeDataToEvent, captureEvent, defineIntegration, logger, Scope, SentryError } from '@sentry/core';
import { NodeClient } from '@sentry/node';
import { Event, ScopeData } from '@sentry/types';
import { logger, SentryError } from '@sentry/utils';
import { app, crashReporter } from 'electron';

import { addScopeListener, getScopeData } from '../../../common/scope';
Expand Down
2 changes: 1 addition & 1 deletion src/main/integrations/sentry-minidump/minidump-loader.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { basename, logger } from '@sentry/core';
import { Attachment } from '@sentry/types';
import { basename, logger } from '@sentry/utils';
import { app } from 'electron';
import { promises as fs } from 'fs';
import { join } from 'path';
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { logger, parseEnvelope, SentryError } from '@sentry/core';
import { captureEvent, getClient, getCurrentScope, metrics } from '@sentry/node';
import { Attachment, Event, ScopeData } from '@sentry/types';
import { logger, parseEnvelope, SentryError } from '@sentry/utils';
import { app, ipcMain, protocol, WebContents, webContents } from 'electron';

import { eventFromEnvelope } from '../common/envelope';
Expand Down
9 changes: 7 additions & 2 deletions src/main/normalize.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { getCurrentScope } from '@sentry/core';
import {
addItemToEnvelope,
createEnvelope,
forEachEnvelopeItem,
getCurrentScope,
normalizeUrlToBase,
} from '@sentry/core';
import { Envelope, Event, Profile, ReplayEvent } from '@sentry/types';
import { addItemToEnvelope, createEnvelope, forEachEnvelopeItem, normalizeUrlToBase } from '@sentry/utils';

/**
* Normalizes all URLs in an event. See {@link normalizeUrl} for more
Expand Down
2 changes: 1 addition & 1 deletion src/main/renderers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { normalizeUrlToBase } from '@sentry/utils';
import { normalizeUrlToBase } from '@sentry/core';
import { app } from 'electron';

interface Renderer {
Expand Down
3 changes: 1 addition & 2 deletions src/main/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getIntegrationsToSetup } from '@sentry/core';
import { getIntegrationsToSetup, logger, stackParserFromStackParserOptions } from '@sentry/core';
import {
consoleIntegration,
contextLinesIntegration,
Expand All @@ -16,7 +16,6 @@ import {
setNodeAsyncContextStrategy,
} from '@sentry/node';
import { Integration, Options } from '@sentry/types';
import { logger, stackParserFromStackParserOptions } from '@sentry/utils';
import { Session, session, WebContents } from 'electron';

import { IPCMode } from '../common/ipc';
Expand Down
2 changes: 1 addition & 1 deletion src/main/sessions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import {
endSession as endSessionCore,
getClient,
getCurrentScope,
logger,
makeSession,
startSession as startSessionCore,
updateSession,
} from '@sentry/core';
import { flush, NodeClient } from '@sentry/node';
import { SerializedSession, Session, SessionContext, SessionStatus } from '@sentry/types';
import { logger } from '@sentry/utils';
import { app } from 'electron';

import { getSentryCachePath } from './electron-normalize';
Expand Down
2 changes: 1 addition & 1 deletion src/main/stack-parse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createStackParser, nodeStackLineParser } from '@sentry/core';
import { createGetModuleFromFilename } from '@sentry/node';
import { StackParser } from '@sentry/types';
import { createStackParser, nodeStackLineParser } from '@sentry/utils';
import { app } from 'electron';

// node.js stack parser but filename normalized before parsing the module
Expand Down
2 changes: 1 addition & 1 deletion src/main/store.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { logger } from '@sentry/utils';
import { logger } from '@sentry/core';
import { promises as fs } from 'fs';
import { dirname, join } from 'path';

Expand Down
3 changes: 1 addition & 2 deletions src/main/transports/electron-net.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { createTransport } from '@sentry/core';
import { createTransport, dropUndefinedKeys } from '@sentry/core';
import {
BaseTransportOptions,
Transport,
TransportMakeRequestResponse,
TransportRequest,
TransportRequestExecutor,
} from '@sentry/types';
import { dropUndefinedKeys } from '@sentry/utils';
import { app, net } from 'electron';
import { Readable, Writable } from 'stream';
import { URL } from 'url';
Expand Down
3 changes: 1 addition & 2 deletions src/main/transports/offline-store.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { OfflineStore } from '@sentry/core';
import { logger, OfflineStore, parseEnvelope, serializeEnvelope, uuid4 } from '@sentry/core';
import { Envelope } from '@sentry/types';
import { logger, parseEnvelope, serializeEnvelope, uuid4 } from '@sentry/utils';
import { promises as fs } from 'fs';
import { join } from 'path';

Expand Down
2 changes: 1 addition & 1 deletion src/main/utility-processes.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { logger, parseEnvelope } from '@sentry/core';
import { captureEvent, getClient } from '@sentry/node';
import { Attachment, Event } from '@sentry/types';
import { logger, parseEnvelope } from '@sentry/utils';
import * as electron from 'electron';

import { eventFromEnvelope } from '../common/envelope';
Expand Down
3 changes: 1 addition & 2 deletions src/renderer/integrations/scope-to-main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { defineIntegration } from '@sentry/core';
import { normalize } from '@sentry/utils';
import { defineIntegration, normalize } from '@sentry/core';

import { addScopeListener } from '../../common/scope';
import { getIPC } from '../ipc';
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/ipc.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-restricted-globals */
/* eslint-disable no-console */
import { logger, uuid4 } from '@sentry/utils';
import { logger, uuid4 } from '@sentry/core';

import {
IPCChannel,
Expand Down
4 changes: 2 additions & 2 deletions src/renderer/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
getDefaultIntegrations as getDefaultBrowserIntegrations,
init as browserInit,
} from '@sentry/browser';
import { logger } from '@sentry/core';
import { Integration } from '@sentry/types';
import { logger } from '@sentry/utils';

import { RendererProcessAnrOptions } from '../common/ipc';
import { enableAnrRendererMessages } from './anr';
Expand Down Expand Up @@ -44,7 +44,7 @@ interface ElectronRendererOptions extends BrowserOptions {
export function init<O extends ElectronRendererOptions>(
options: ElectronRendererOptions & O = {} as ElectronRendererOptions & O,
// This parameter name ensures that TypeScript error messages contain a hint for fixing SDK version mismatches
originalInit: (if_you_get_a_typescript_error_ensure_sdks_use_version_v8_40_0: O) => void = browserInit,
originalInit: (if_you_get_a_typescript_error_ensure_sdks_use_version_v8_41_0: O) => void = browserInit,
): void {
// Ensure the browser SDK is only init'ed once.
if (window?.__SENTRY__RENDERER_INIT__) {
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/stack-parse.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { chromeStackLineParser } from '@sentry/browser';
import { dropUndefinedKeys, nodeStackLineParser, stripSentryFramesAndReverse } from '@sentry/core';
import { StackFrame, StackParser } from '@sentry/types';
import { dropUndefinedKeys, nodeStackLineParser, stripSentryFramesAndReverse } from '@sentry/utils';

const STACKTRACE_FRAME_LIMIT = 50;

Expand Down
2 changes: 2 additions & 0 deletions src/utility/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export {
addEventProcessor,
addIntegration,
addOpenTelemetryInstrumentation,
// eslint-disable-next-line deprecation/deprecation
addRequestDataToEvent,
amqplibIntegration,
captureCheckIn,
Expand All @@ -48,6 +49,7 @@ export {
endSession,
expressErrorHandler,
expressIntegration,
// eslint-disable-next-line deprecation/deprecation
extractRequestData,
extraErrorDataIntegration,
fastifyIntegration,
Expand Down
9 changes: 7 additions & 2 deletions src/utility/sdk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { getIntegrationsToSetup } from '@sentry/core';
import {
createStackParser,
getIntegrationsToSetup,
logger,
nodeStackLineParser,
stackParserFromStackParserOptions,
} from '@sentry/core';
import {
consoleIntegration,
createGetModuleFromFilename,
Expand All @@ -15,7 +21,6 @@ import {
setNodeAsyncContextStrategy,
} from '@sentry/node';
import { Integration, StackParser } from '@sentry/types';
import { createStackParser, logger, nodeStackLineParser, stackParserFromStackParserOptions } from '@sentry/utils';

import { makeUtilityProcessTransport } from './transport';

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/context.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseSemver } from '@sentry/utils';
import { parseSemver } from '@sentry/core';
import { ChildProcess, spawn, spawnSync } from 'child_process';
import { rmSync } from 'fs';
import { homedir } from 'os';
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/recipe/eval.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { parseSemver } from '@sentry/utils';
import { parseSemver } from '@sentry/core';
import { Context, createContext, runInContext } from 'vm';

import { createLogger } from '../utils';
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/recipe/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { parseSemver } from '@sentry/core';
import { Event } from '@sentry/types';
import { parseSemver } from '@sentry/utils';
import { spawnSync } from 'child_process';
import { mkdirSync, writeFileSync } from 'fs';
import { dirname, join } from 'path';
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/server/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { dropUndefinedKeys, forEachEnvelopeItem, parseEnvelope } from '@sentry/core';
import { Event, Profile, ReplayEvent, Session } from '@sentry/types';
import { dropUndefinedKeys, forEachEnvelopeItem, parseEnvelope } from '@sentry/utils';
import { Server } from 'http';
import Koa from 'koa';
import bodyParser from 'koa-bodyparser';
Expand Down
2 changes: 1 addition & 1 deletion test/unit/minidump-loader.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '../../scripts/electron-shim.mjs';

import { uuid4 } from '@sentry/utils';
import { uuid4 } from '@sentry/core';
import { closeSync, existsSync, openSync, utimesSync, writeFileSync, writeSync } from 'fs';
import { join } from 'path';
import * as tmp from 'tmp';
Expand Down
Loading