Skip to content

Commit

Permalink
Rename to withSentry and deprecate withSentryRouteTracing.
Browse files Browse the repository at this point in the history
  • Loading branch information
onurtemizkan committed Jul 6, 2022
1 parent fc33554 commit 341cd65
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/remix/src/index.client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { configureScope, init as reactInit, Integrations } from '@sentry/react';

import { buildMetadata } from './utils/metadata';
import { RemixOptions } from './utils/remixOptions';
export { remixRouterInstrumentation, withSentryRouteTracing } from './performance/client';
export { remixRouterInstrumentation, withSentry, withSentryRouteTracing } from './performance/client';
export { BrowserTracing } from '@sentry/tracing';
export * from '@sentry/react';

Expand Down
2 changes: 1 addition & 1 deletion packages/remix/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { buildMetadata } from './utils/metadata';
import { RemixOptions } from './utils/remixOptions';

export { ErrorBoundary, withErrorBoundary } from '@sentry/react';
export { remixRouterInstrumentation, withSentryRouteTracing } from './performance/client';
export { remixRouterInstrumentation, withSentry, withSentryRouteTracing } from './performance/client';
export { BrowserTracing, Integrations } from '@sentry/tracing';
export * from '@sentry/node';

Expand Down
17 changes: 16 additions & 1 deletion packages/remix/src/performance/client.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,26 @@ export function remixRouterInstrumentation(useEffect: UseEffect, useLocation: Us
};
}

/**
* @deprecated Please use `withSentry` instead.
*
* 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.
*/
export function withSentryRouteTracing<P extends Record<string, unknown>, R extends React.FC<P>>(App: R): R {
// @ts-ignore Setting more specific React Component typing for `R` generic above
// will break advanced type inference done by react router params
return withSentry(App);
}

/**
* 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.
*
* @param OrigApp The Remix root to wrap
* @param options The options for ErrorBoundary wrapper.
*/
export function withSentryRouteTracing<P extends Record<string, unknown>, R extends React.FC<P>>(
export function withSentry<P extends Record<string, unknown>, R extends React.FC<P>>(
OrigApp: R,
options: {
wrapWithErrorBoundary?: boolean;
Expand Down

0 comments on commit 341cd65

Please sign in to comment.