From 47b6c19c9dcb4bbd82fd367779b1c7dc45fed6ea Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 3 May 2022 17:54:35 +0200 Subject: [PATCH 1/2] chore(browser): Rename `UserAgent` integration to `HttpContext` --- MIGRATION.md | 1 + .../src/integrations/{useragent.ts => httpcontext.ts} | 10 +++++----- packages/browser/src/integrations/index.ts | 2 +- packages/browser/src/sdk.ts | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) rename packages/browser/src/integrations/{useragent.ts => httpcontext.ts} (81%) diff --git a/MIGRATION.md b/MIGRATION.md index a7809c188296..828890a4526a 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -277,6 +277,7 @@ For our efforts to reduce bundle size of the SDK we had to remove and refactor p not present in other Sentry SDKs. For the sake of reducing complexity, increasing consistency with other Sentry SDKs and decreasing bundle-size, `Backend` was removed. - Remove support for Opera browser pre v15 +- Rename `UserAgent` integration to `HttpContext` [TODO]() ## Sentry Angular SDK Changes diff --git a/packages/browser/src/integrations/useragent.ts b/packages/browser/src/integrations/httpcontext.ts similarity index 81% rename from packages/browser/src/integrations/useragent.ts rename to packages/browser/src/integrations/httpcontext.ts index 1160320f9d93..2c7d5aa4e841 100644 --- a/packages/browser/src/integrations/useragent.ts +++ b/packages/browser/src/integrations/httpcontext.ts @@ -4,24 +4,24 @@ import { getGlobalObject } from '@sentry/utils'; const global = getGlobalObject(); -/** UserAgent */ -export class UserAgent implements Integration { +/** HttpContext integration collects information about HTTP request headers */ +export class HttpContext implements Integration { /** * @inheritDoc */ - public static id: string = 'UserAgent'; + public static id: string = 'HttpContext'; /** * @inheritDoc */ - public name: string = UserAgent.id; + public name: string = HttpContext.id; /** * @inheritDoc */ public setupOnce(): void { addGlobalEventProcessor((event: Event) => { - if (getCurrentHub().getIntegration(UserAgent)) { + if (getCurrentHub().getIntegration(HttpContext)) { // if none of the information we want exists, don't bother if (!global.navigator && !global.location && !global.document) { return event; diff --git a/packages/browser/src/integrations/index.ts b/packages/browser/src/integrations/index.ts index a354fdc883e9..e029422f363c 100644 --- a/packages/browser/src/integrations/index.ts +++ b/packages/browser/src/integrations/index.ts @@ -2,5 +2,5 @@ export { GlobalHandlers } from './globalhandlers'; export { TryCatch } from './trycatch'; export { Breadcrumbs } from './breadcrumbs'; export { LinkedErrors } from './linkederrors'; -export { UserAgent } from './useragent'; +export { HttpContext } from './httpcontext'; export { Dedupe } from './dedupe'; diff --git a/packages/browser/src/sdk.ts b/packages/browser/src/sdk.ts index 98dd9e6e3270..584742b26f69 100644 --- a/packages/browser/src/sdk.ts +++ b/packages/browser/src/sdk.ts @@ -18,7 +18,7 @@ import { import { BrowserClient, BrowserClientOptions, BrowserOptions } from './client'; import { IS_DEBUG_BUILD } from './flags'; import { ReportDialogOptions, wrap as internalWrap } from './helpers'; -import { Breadcrumbs, Dedupe, GlobalHandlers, LinkedErrors, TryCatch, UserAgent } from './integrations'; +import { Breadcrumbs, Dedupe, GlobalHandlers, HttpContext, LinkedErrors, TryCatch } from './integrations'; import { defaultStackParser } from './stack-parsers'; import { makeFetchTransport, makeXHRTransport } from './transports'; @@ -30,7 +30,7 @@ export const defaultIntegrations = [ new GlobalHandlers(), new LinkedErrors(), new Dedupe(), - new UserAgent(), + new HttpContext(), ]; /** From e665a740de1e6200771ff65395342f1fe8f1b04a Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Tue, 3 May 2022 18:19:10 +0200 Subject: [PATCH 2/2] update Migration w/ PR ID --- MIGRATION.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MIGRATION.md b/MIGRATION.md index 828890a4526a..d1689972d3e9 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -277,7 +277,7 @@ For our efforts to reduce bundle size of the SDK we had to remove and refactor p not present in other Sentry SDKs. For the sake of reducing complexity, increasing consistency with other Sentry SDKs and decreasing bundle-size, `Backend` was removed. - Remove support for Opera browser pre v15 -- Rename `UserAgent` integration to `HttpContext` [TODO]() +- Rename `UserAgent` integration to `HttpContext` (see [#5027](https://github.com/getsentry/sentry-javascript/pull/5027)) ## Sentry Angular SDK Changes