Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from '@react-router/dev/config';
import { sentryOnBuildEnd } from '@sentry/react-router';
import { sentryOnBuildEnd } from '@sentry/react-router/vite';

export default {
appDirectory: 'app',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { hydrogen } from '@shopify/hydrogen/vite';
import { oxygen } from '@shopify/mini-oxygen/vite';
import { defineConfig } from 'vite';
import tsconfigPaths from 'vite-tsconfig-paths';
import { sentryReactRouter, type SentryReactRouterBuildOptions } from '@sentry/react-router';
import { sentryReactRouter, type SentryReactRouterBuildOptions } from '@sentry/react-router/vite';

const sentryConfig: SentryReactRouterBuildOptions = {
org: 'example-org',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { reactRouter } from '@react-router/dev/vite';
import { sentryReactRouter } from '@sentry/react-router';
import { sentryReactRouter } from '@sentry/react-router/vite';
import { defineConfig } from 'vite';

export default defineConfig(async config => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cloudflare } from '@cloudflare/vite-plugin';
import { reactRouter } from '@react-router/dev/vite';
import { sentryReactRouter } from '@sentry/react-router';
import { sentryReactRouter } from '@sentry/react-router/vite';
import { defineConfig } from 'vite';

export default defineConfig(async config => ({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { reactRouter } from '@react-router/dev/vite';
import { sentryReactRouter } from '@sentry/react-router';
import { sentryReactRouter } from '@sentry/react-router/vite';
import { defineConfig } from 'vite';

export default defineConfig(config => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Config } from '@react-router/dev/config';
import { sentryOnBuildEnd } from '@sentry/react-router';
import { sentryOnBuildEnd } from '@sentry/react-router/vite';

export default {
ssr: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { reactRouter } from '@react-router/dev/vite';
import { sentryReactRouter, type SentryReactRouterBuildOptions } from '@sentry/react-router';
import { sentryReactRouter, type SentryReactRouterBuildOptions } from '@sentry/react-router/vite';
import { defineConfig } from 'vite';

// Guards against debug IDs being injected twice - once by the Vite plugin and once by
Expand Down
18 changes: 18 additions & 0 deletions docs/migration/v11-end-state.md
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,24 @@ Affected SDKs: `@sentry/cloudflare`.
+ import { wrapRequestHandler } from '@sentry/cloudflare/request';
```

### React Router: Vite plugin moved to `@sentry/react-router/vite`

Affected SDKs: `@sentry/react-router`.

`sentryReactRouter`, `sentryOnBuildEnd`, `makeConfigInjectorPlugin` and the `SentryReactRouterBuildOptions` type are no longer available from the main `@sentry/react-router` entry point. Import them from the dedicated subpath instead:

```diff
// vite.config.ts
- import { sentryReactRouter } from '@sentry/react-router';
+ import { sentryReactRouter } from '@sentry/react-router/vite';
```

```diff
// react-router.config.ts
- import { sentryOnBuildEnd } from '@sentry/react-router';
+ import { sentryOnBuildEnd } from '@sentry/react-router/vite';
```

## 3. Removed APIs

### `@sentry/core` / All SDKs
Expand Down
4 changes: 2 additions & 2 deletions packages/react-router/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ Update your vite.config.ts file to include the `sentryReactRouter` plugin and al

```ts
import { reactRouter } from '@react-router/dev/vite';
import { sentryReactRouter } from '@sentry/react-router';
import { sentryReactRouter } from '@sentry/react-router/vite';
import { defineConfig } from 'vite';

const sentryConfig = {
Expand All @@ -177,7 +177,7 @@ Next, in your `react-router.config.ts` file, include the `sentryOnBuildEnd` hook

```ts
import type { Config } from '@react-router/dev/config';
import { sentryOnBuildEnd } from '@sentry/react-router';
import { sentryOnBuildEnd } from '@sentry/react-router/vite';

export default {
ssr: true,
Expand Down
5 changes: 5 additions & 0 deletions packages/react-router/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@
"require": "./build/cjs/cloudflare/index.js",
"types": "./build/types/cloudflare/index.d.ts",
"default": "./build/esm/cloudflare/index.js"
},
"./vite": {
"types": "./build/types/vite/index.d.ts",
"import": "./build/esm/vite/index.js",
"require": "./build/cjs/vite/index.js"
}
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-router/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { makeBaseNPMConfig, makeNPMConfigVariants } from '@sentry-internal/rollu
export default [
...makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/cloudflare/index.ts'],
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/cloudflare/index.ts', 'src/vite/index.ts'],
packageSpecificConfig: {
external: ['react-router', 'react-router-dom', 'react', 'react/jsx-runtime', 'vite'],
output: {
Expand Down
1 change: 0 additions & 1 deletion packages/react-router/src/index.server.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
export * from './server';
export * from './vite';
1 change: 0 additions & 1 deletion packages/react-router/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import type * as serverSdk from './server';
// re-define colliding type exports below
export * from './client';
export * from './server';
export * from './vite';

/** Initializes Sentry React Router SDK */
export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): void;
Expand Down
Loading