Skip to content

Commit 9ffc282

Browse files
committed
ref(core): Cleanup todos & internal types
These are small changes, cleaning up outdated (I believe?) TODOs, and some internal type stuff.
1 parent 888b05a commit 9ffc282

File tree

8 files changed

+18
-29
lines changed

8 files changed

+18
-29
lines changed

packages/browser-utils/src/metrics/inp.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,8 @@ function _trackINP(): () => void {
127127

128128
/**
129129
* Register a listener to cache route information for INP interactions.
130-
* TODO(v9): `latestRoute` no longer needs to be passed in and will be removed in v9.
131130
*/
132-
export function registerInpInteractionListener(_latestRoute?: unknown): void {
131+
export function registerInpInteractionListener(): void {
133132
const handleEntries = ({ entries }: { entries: PerformanceEntry[] }): void => {
134133
const activeSpan = getActiveSpan();
135134
const activeRootSpan = activeSpan && getRootSpan(activeSpan);

packages/browser/src/sdk.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,9 +198,7 @@ export function init(browserOptions: BrowserOptions = {}): Client | undefined {
198198
* All properties the report dialog supports
199199
*/
200200
export interface ReportDialogOptions {
201-
// TODO(v9): Change this to [key: string]: unknkown;
202-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
203-
[key: string]: any;
201+
[key: string]: unknown;
204202
eventId?: string;
205203
dsn?: DsnLike;
206204
user?: {

packages/browser/src/transports/fetch.ts

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { clearCachedImplementation, getNativeImplementation } from '@sentry-internal/browser-utils';
22
import type { Transport, TransportMakeRequestResponse, TransportRequest } from '@sentry/core';
3-
import { createTransport, rejectedSyncPromise } from '@sentry/core';
3+
import { createTransport, rejectedSyncPromise, suppressTracing } from '@sentry/core';
44
import type { WINDOW } from '../helpers';
55
import type { BrowserTransportOptions } from './types';
66

@@ -45,18 +45,19 @@ export function makeFetchTransport(
4545
}
4646

4747
try {
48-
// TODO: This may need a `suppressTracing` call in the future when we switch the browser SDK to OTEL
49-
return nativeFetch(options.url, requestOptions).then(response => {
50-
pendingBodySize -= requestSize;
51-
pendingCount--;
52-
return {
53-
statusCode: response.status,
54-
headers: {
55-
'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
56-
'retry-after': response.headers.get('Retry-After'),
57-
},
58-
};
59-
});
48+
return suppressTracing(() =>
49+
nativeFetch(options.url, requestOptions).then(response => {
50+
pendingBodySize -= requestSize;
51+
pendingCount--;
52+
return {
53+
statusCode: response.status,
54+
headers: {
55+
'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),
56+
'retry-after': response.headers.get('Retry-After'),
57+
},
58+
};
59+
}),
60+
);
6061
} catch (e) {
6162
clearCachedImplementation('fetch');
6263
pendingBodySize -= requestSize;

packages/core/src/api.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ export function getEnvelopeEndpointWithUrlEncodedAuth(dsn: DsnComponents, tunnel
4747
export function getReportDialogEndpoint(
4848
dsnLike: DsnLike,
4949
dialogOptions: {
50-
// TODO(v9): Change this to [key: string]: unknown;
51-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
52-
[key: string]: any;
50+
[key: string]: unknown;
5351
user?: { name?: string; email?: string };
5452
},
5553
): string {

packages/core/src/integrations/inboundfilters.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ function _isIgnoredTransaction(event: Event, ignoreTransactions?: Array<string |
131131
}
132132

133133
function _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean {
134-
// TODO: Use Glob instead?
135134
if (!denyUrls || !denyUrls.length) {
136135
return false;
137136
}
@@ -140,7 +139,6 @@ function _isDeniedUrl(event: Event, denyUrls?: Array<string | RegExp>): boolean
140139
}
141140

142141
function _isAllowedUrl(event: Event, allowUrls?: Array<string | RegExp>): boolean {
143-
// TODO: Use Glob instead?
144142
if (!allowUrls || !allowUrls.length) {
145143
return true;
146144
}

packages/core/src/types-hoist/wrappedfunction.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*/
44
// eslint-disable-next-line @typescript-eslint/ban-types
55
export type WrappedFunction<T extends Function = Function> = T & {
6-
// TODO(v9): Remove this
7-
[key: string]: any;
86
__sentry_wrapped__?: WrappedFunction<T>;
97
__sentry_original__?: T;
108
};

packages/core/src/utils-hoist/time.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ interface Performance {
1919

2020
/**
2121
* Returns a timestamp in seconds since the UNIX epoch using the Date API.
22-
*
23-
* TODO(v8): Return type should be rounded.
2422
*/
2523
export function dateTimestampInSeconds(): number {
2624
return Date.now() / ONE_SECOND_IN_MS;

packages/opentelemetry/src/utils/contextData.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@ export function setContextOnScope(scope: Scope, context: Context): void {
3232

3333
/**
3434
* Get the context related to a scope.
35-
* TODO v8: Use this for the `trace` functions.
36-
* */
35+
*/
3736
export function getContextFromScope(scope: Scope): Context | undefined {
3837
return (scope as { [SCOPE_CONTEXT_FIELD]?: Context })[SCOPE_CONTEXT_FIELD];
3938
}

0 commit comments

Comments
 (0)