Skip to content
Merged
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
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@
},
"devDependencies": {
"@rollup/plugin-typescript": "^12.1.3",
"@sentry-internal/typescript": "10.53.1",
"@sentry-internal/eslint-plugin-sdk": "10.53.1",
"@sentry/node-native": "10.53.1",
"@types/busboy": "^1.5.4",
Expand All @@ -139,7 +138,7 @@
"rollup": "^4.44.1",
"tmp": "^0.2.1",
"tslib": "^2.8.1",
"typescript": "~5.0.0",
"typescript": "^6.0.0",
"vitest": "^4.0.18",
"xvfb-maybe": "^0.2.1",
"yaml": "^2.2.1"
Expand All @@ -148,4 +147,4 @@
"node": "22.19.0",
"yarn": "1.22.22"
}
}
}
14 changes: 9 additions & 5 deletions rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ function transpileFiles(format, input, outDir) {
treeshake: { moduleSideEffects: false },
plugins: [
typescript({
outDir,
tsconfig: './tsconfig.build.json',
noEmitOnError: true,
compilerOptions: {
outDir,
rootDir: 'src',
},
Comment thread
timfish marked this conversation as resolved.
}),
format === 'esm' ? modulePackageJson : {},
],
Expand All @@ -64,8 +65,11 @@ function bundlePreload(format, input, output) {
},
plugins: [
typescript({
tsconfig: './tsconfig.preload.json',
noEmitOnError: true,
compilerOptions: {
declaration: false,
declarationMap: false,
rootDir: 'src',
},
}),
],
external,
Expand Down
10 changes: 6 additions & 4 deletions src/main/utility-processes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,12 @@ export function configureUtilityProcessIPC(): void {
// We proxy child.on so we can filter messages from the child SDK and ensure that users do not see them
// eslint-disable-next-line typescript/unbound-method
child.on = new Proxy(child.on, {
apply: (target, thisArg, [event, listener]) => {
apply: (target, thisArg, args: [string, (message: unknown) => unknown]) => {
const [event, listener] = args;

if (event === 'message') {
return target.apply(thisArg, [
'message',
return Reflect.apply(target, thisArg, [
event,
(msg: unknown) => {
if (isMagicMessage(msg)) {
return;
Expand All @@ -66,7 +68,7 @@ export function configureUtilityProcessIPC(): void {
]);
}

return target.apply(thisArg, [event, listener]);
return Reflect.apply(target, thisArg, args);
},
});

Expand Down
13 changes: 12 additions & 1 deletion src/renderer/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,18 @@ function getImplementation(ipcKey: string): IPCInterface {
});
},
sendEnvelope: (body: string | Uint8Array) => {
fetch(ipcUtil.createUrl('envelope'), { method: 'POST', body, headers }).catch(() => {
const requestBody =
typeof body === 'string'
? body
: body.buffer instanceof ArrayBuffer
? body.buffer.slice(body.byteOffset, body.byteOffset + body.byteLength)
: Uint8Array.from(body).buffer;

fetch(ipcUtil.createUrl('envelope'), {
method: 'POST',
body: requestBody,
headers,
}).catch(() => {
// ignore
});
},
Expand Down
10 changes: 6 additions & 4 deletions src/utility/transport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,13 @@ export function makeUtilityProcessTransport(): (options: BaseTransportOptions) =
// We proxy `process.parentPort.on` so we can filter messages from the main SDK and ensure that users do not see them
// eslint-disable-next-line typescript/unbound-method
process.parentPort.on = new Proxy(process.parentPort.on, {
apply: (target, thisArg, [event, listener]) => {
apply: (target, thisArg, args: Parameters<typeof process.parentPort.on>) => {
const [event, listener] = args;

if (event === 'message') {
return target.apply(thisArg, [
'message',
(msg: MessageEvent) => {
event,
(msg) => {
if (isMagicMessage(msg.data)) {
return;
}
Expand All @@ -51,7 +53,7 @@ export function makeUtilityProcessTransport(): (options: BaseTransportOptions) =
]);
}

return target.apply(thisArg, [event, listener]);
return target.apply(thisArg, args);
},
});

Expand Down
17 changes: 0 additions & 17 deletions tsconfig.build.json

This file was deleted.

19 changes: 14 additions & 5 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
{
"extends": "./tsconfig.build.json",
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["node_modules"],
"compilerOptions": {
"rootDir": "."
}
"target": "ES2020",
"lib": ["ES2020", "DOM"],
"module": "ESNext",
"moduleResolution": "Bundler",
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"declaration": true,
"declarationMap": true,
"sourceMap": true
},
"include": ["src/**/*.ts", "test/**/*.ts"],
"exclude": ["node_modules"]
}
9 changes: 0 additions & 9 deletions tsconfig.preload.json

This file was deleted.

8 changes: 0 additions & 8 deletions tsconfig.test.json

This file was deleted.

13 changes: 4 additions & 9 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -805,11 +805,6 @@
"@sentry-internal/browser-utils" "10.53.1"
"@sentry/core" "10.53.1"

"@sentry-internal/typescript@10.53.1":
version "10.53.1"
resolved "https://registry.yarnpkg.com/@sentry-internal/typescript/-/typescript-10.53.1.tgz#216b3e3ec0d5aa7ef3e7055ea50d6371d9786cce"
integrity sha512-7ncY4Ww9MsTf5lsX9qAUaiNeQdKNBeZm7rtFze0UeU8fTLxOKx9ink4jCFa1xB/sztIR1pq/rGmnBs7evvn+aw==

"@sentry/browser@10.53.1":
version "10.53.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-10.53.1.tgz#db8dbbf4fc752acec9fec5073a7105a2b0f58f97"
Expand Down Expand Up @@ -2694,10 +2689,10 @@ type-is@^2.0.1:
media-typer "^1.1.0"
mime-types "^3.0.0"

typescript@~5.0.0:
version "5.0.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b"
integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==
typescript@^6.0.0:
version "6.0.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-6.0.3.tgz#90251dc007916e972786cb94d74d15b185577d21"
integrity sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==

undici-types@~5.26.4:
version "5.26.5"
Expand Down
Loading