Skip to content

Commit 341cd65

Browse files
committed
Rename to withSentry and deprecate withSentryRouteTracing.
1 parent fc33554 commit 341cd65

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

packages/remix/src/index.client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { configureScope, init as reactInit, Integrations } from '@sentry/react';
33

44
import { buildMetadata } from './utils/metadata';
55
import { RemixOptions } from './utils/remixOptions';
6-
export { remixRouterInstrumentation, withSentryRouteTracing } from './performance/client';
6+
export { remixRouterInstrumentation, withSentry, withSentryRouteTracing } from './performance/client';
77
export { BrowserTracing } from '@sentry/tracing';
88
export * from '@sentry/react';
99

packages/remix/src/index.server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { buildMetadata } from './utils/metadata';
77
import { RemixOptions } from './utils/remixOptions';
88

99
export { ErrorBoundary, withErrorBoundary } from '@sentry/react';
10-
export { remixRouterInstrumentation, withSentryRouteTracing } from './performance/client';
10+
export { remixRouterInstrumentation, withSentry, withSentryRouteTracing } from './performance/client';
1111
export { BrowserTracing, Integrations } from '@sentry/tracing';
1212
export * from '@sentry/node';
1313

packages/remix/src/performance/client.tsx

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,26 @@ export function remixRouterInstrumentation(useEffect: UseEffect, useLocation: Us
7878
};
7979
}
8080

81+
/**
82+
* @deprecated Please use `withSentry` instead.
83+
*
84+
* Wraps a remix `root` (see: https://remix.run/docs/en/v1/guides/migrating-react-router-app#creating-the-root-route)
85+
* To enable pageload/navigation tracing on every route.
86+
*/
87+
export function withSentryRouteTracing<P extends Record<string, unknown>, R extends React.FC<P>>(App: R): R {
88+
// @ts-ignore Setting more specific React Component typing for `R` generic above
89+
// will break advanced type inference done by react router params
90+
return withSentry(App);
91+
}
92+
8193
/**
8294
* Wraps a remix `root` (see: https://remix.run/docs/en/v1/guides/migrating-react-router-app#creating-the-root-route)
8395
* To enable pageload/navigation tracing on every route.
96+
*
97+
* @param OrigApp The Remix root to wrap
98+
* @param options The options for ErrorBoundary wrapper.
8499
*/
85-
export function withSentryRouteTracing<P extends Record<string, unknown>, R extends React.FC<P>>(
100+
export function withSentry<P extends Record<string, unknown>, R extends React.FC<P>>(
86101
OrigApp: R,
87102
options: {
88103
wrapWithErrorBoundary?: boolean;

0 commit comments

Comments
 (0)