Skip to content

fix(node): Remove dom lib types #9090

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

Merged
merged 1 commit into from
Sep 25, 2023
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
3 changes: 2 additions & 1 deletion packages/node/src/integrations/undici/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Vendored from https://github.com/DefinitelyTyped/DefinitelyTyped/blob/5a94716c6788f654aea7999a5fc28f4f1e7c48ad/types/node/diagnostics_channel.d.ts

import type { Span } from '@sentry/core';
import type { URL } from 'url';

// License:
// This project is licensed under the MIT license.
Expand Down Expand Up @@ -224,7 +225,7 @@ export interface UndiciRequest {
method?: string;
path: string;
headers: string;
addHeader(key: string, value: string): Request;
addHeader(key: string, value: string): RequestWithSentry;
}

export interface UndiciResponse {
Expand Down
8 changes: 1 addition & 7 deletions packages/node/src/requestdata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,11 +320,5 @@ function extractQueryParams(req: PolymorphicRequest): string | Record<string, un
originalUrl = `http://dogs.are.great${originalUrl}`;
}

return (
req.query ||
(typeof URL !== undefined && new URL(originalUrl).search.replace('?', '')) ||
// In Node 8, `URL` isn't in the global scope, so we have to use the built-in module from Node
url.parse(originalUrl).query ||
undefined
);
return req.query || new url.URL(originalUrl).search.replace('?', '') || undefined;
}
4 changes: 2 additions & 2 deletions packages/node/test/async/domain.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ describe('domains', () => {
if (d2done) {
done();
}
});
}, 0);
});

runWithAsyncContext(() => {
Expand All @@ -131,7 +131,7 @@ describe('domains', () => {
if (d1done) {
done();
}
});
}, 0);
});
});
});
4 changes: 2 additions & 2 deletions packages/node/test/async/hooks.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ conditionalTest({ min: 12 })('async_hooks', () => {
if (d2done) {
done();
}
});
}, 0);
});

runWithAsyncContext(() => {
Expand All @@ -142,7 +142,7 @@ conditionalTest({ min: 12 })('async_hooks', () => {
if (d1done) {
done();
}
});
}, 0);
});
});
});
2 changes: 1 addition & 1 deletion packages/node/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"include": ["src/**/*"],

"compilerOptions": {
// package-specific options
"lib": ["es6"]
}
}