From 8154508a954efdcdaaf03be7c11f29e7a8fae10d Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 5 Mar 2024 11:12:00 -0500 Subject: [PATCH 1/2] feat(v8/remix): Remove remixRouterInstrumentation --- packages/remix/src/client/performance.tsx | 30 +---------------------- packages/remix/src/index.client.tsx | 2 -- packages/remix/src/index.server.ts | 3 +-- 3 files changed, 2 insertions(+), 33 deletions(-) diff --git a/packages/remix/src/client/performance.tsx b/packages/remix/src/client/performance.tsx index fd997544bb8b..f50bd5ac2a0e 100644 --- a/packages/remix/src/client/performance.tsx +++ b/packages/remix/src/client/performance.tsx @@ -13,7 +13,7 @@ import { startBrowserTracingPageLoadSpan, withErrorBoundary, } from '@sentry/react'; -import type { Span, StartSpanOptions, Transaction, TransactionContext } from '@sentry/types'; +import type { Span, StartSpanOptions, TransactionContext } from '@sentry/types'; import { isNodeEnv, logger } from '@sentry/utils'; import * as React from 'react'; @@ -121,34 +121,6 @@ function startNavigationSpan(matches: RouteMatch[]): void { } } -/** - * @deprecated Use `browserTracingIntegration` instead. - * - * Creates a react-router v6 instrumention for Remix applications. - * - * This implementation is slightly different (and simpler) from the react-router instrumentation - * as in Remix, `useMatches` hook is available where in react-router-v6 it's not yet. - */ -export function remixRouterInstrumentation(useEffect: UseEffect, useLocation: UseLocation, useMatches: UseMatches) { - return ( - customStartTransaction: (context: TransactionContext) => Transaction | undefined, - startTransactionOnPageLoad = true, - startTransactionOnLocationChange = true, - ): void => { - setGlobals({ - useEffect, - useLocation, - useMatches, - instrumentNavigation: startTransactionOnLocationChange, - customStartTransaction, - }); - - if (startTransactionOnPageLoad) { - startPageloadSpan(); - } - }; -} - /** * Wraps a remix `root` (see: https://remix.run/docs/en/v1/guides/migrating-react-router-app#creating-the-root-route) * To enable pageload/navigation tracing on every route. diff --git a/packages/remix/src/index.client.tsx b/packages/remix/src/index.client.tsx index a1d21486f6cc..ebefa154dbfc 100644 --- a/packages/remix/src/index.client.tsx +++ b/packages/remix/src/index.client.tsx @@ -3,8 +3,6 @@ import { init as reactInit } from '@sentry/react'; import type { RemixOptions } from './utils/remixOptions'; export { captureRemixErrorBoundaryError } from './client/errors'; export { - // eslint-disable-next-line deprecation/deprecation - remixRouterInstrumentation, withSentry, } from './client/performance'; diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 5860b9c41955..0eb5290781c2 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -96,8 +96,7 @@ export * from '@sentry/node-experimental'; export { captureRemixServerException, wrapRemixHandleError } from './utils/instrumentServer'; export { ErrorBoundary, withErrorBoundary } from '@sentry/react'; -// eslint-disable-next-line deprecation/deprecation -export { remixRouterInstrumentation, withSentry } from './client/performance'; +export { withSentry } from './client/performance'; export { captureRemixErrorBoundaryError } from './client/errors'; export { browserTracingIntegration } from './client/browserTracingIntegration'; export { wrapExpressCreateRequestHandler } from './utils/serverAdapters/express'; From 1574c2c46ba47831eac471c37233c672f581d3eb Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 5 Mar 2024 11:16:13 -0500 Subject: [PATCH 2/2] yarn fix --- packages/remix/src/index.client.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/remix/src/index.client.tsx b/packages/remix/src/index.client.tsx index ebefa154dbfc..17bcf6c46b31 100644 --- a/packages/remix/src/index.client.tsx +++ b/packages/remix/src/index.client.tsx @@ -2,9 +2,7 @@ import { applySdkMetadata, setTag } from '@sentry/core'; import { init as reactInit } from '@sentry/react'; import type { RemixOptions } from './utils/remixOptions'; export { captureRemixErrorBoundaryError } from './client/errors'; -export { - withSentry, -} from './client/performance'; +export { withSentry } from './client/performance'; export { browserTracingIntegration } from './client/browserTracingIntegration';