Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@

Work in this release was contributed by @limbonaut. Thank you for your contribution!

- **feat(tanstackstart-react)!: Export Vite plugin from `@sentry/tanstackstart-react/vite` subpath ([#19182](https://github.com/getsentry/sentry-javascript/pull/19182))**

The `sentryTanstackStart` Vite plugin is now exported from a dedicated subpath. Update your import:

```diff
- import { sentryTanstackStart } from '@sentry/tanstackstart-react';
+ import { sentryTanstackStart } from '@sentry/tanstackstart-react/vite';
```

- **feat(tanstackstart-react): Auto-instrument server function middleware ([#19001](https://github.com/getsentry/sentry-javascript/pull/19001))**

The `sentryTanstackStart` Vite plugin now automatically instruments middleware in `createServerFn().middleware([...])` calls. This captures performance data without requiring manual wrapping with `wrapMiddlewaresWithSentry()`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,23 @@ import tsConfigPaths from 'vite-tsconfig-paths';
import { tanstackStart } from '@tanstack/react-start/plugin/vite';
import viteReact from '@vitejs/plugin-react-swc';
import { nitro } from 'nitro/vite';
import { sentryTanstackStart } from '@sentry/tanstackstart-react';
import { sentryTanstackStart } from '@sentry/tanstackstart-react/vite';

export default defineConfig({
server: {
port: 3000,
},
plugins: [
tsConfigPaths(),
tanstackStart(),
nitro(),
// react's vite plugin must come after start's vite plugin
viteReact(),
sentryTanstackStart({
org: process.env.E2E_TEST_SENTRY_ORG_SLUG,
project: process.env.E2E_TEST_SENTRY_PROJECT,
authToken: process.env.E2E_TEST_AUTH_TOKEN,
debug: true,
}),
tsConfigPaths(),
tanstackStart(),
nitro(),
// react's vite plugin must come after start's vite plugin
viteReact(),
],
});
5 changes: 5 additions & 0 deletions packages/tanstackstart-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
"import": {
"default": "./build/loader-hook.mjs"
}
},
"./vite": {
"types": "./build/types/vite/index.d.ts",
"import": "./build/esm/vite/index.js",
"require": "./build/cjs/vite/index.js"
}
},
"typesVersions": {
Expand Down
8 changes: 7 additions & 1 deletion packages/tanstackstart-react/rollup.npm.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,13 @@ import { makeBaseNPMConfig, makeNPMConfigVariants, makeOtelLoaders } from '@sent
export default [
...makeNPMConfigVariants(
makeBaseNPMConfig({
entrypoints: ['src/index.server.ts', 'src/index.client.ts', 'src/client/index.ts', 'src/server/index.ts'],
entrypoints: [
'src/index.server.ts',
'src/index.client.ts',
'src/client/index.ts',
'src/server/index.ts',
'src/vite/index.ts',
],
}),
),
...makeOtelLoaders('./build', 'sentry-node'),
Expand Down
1 change: 0 additions & 1 deletion packages/tanstackstart-react/src/index.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@
export * from './config';
export * from './server';
export * from './common';
export * from './vite';
1 change: 0 additions & 1 deletion packages/tanstackstart-react/src/index.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export * from './config';
export * from './client';
export * from './server';
export * from './common';
export * from './vite';

/** Initializes Sentry TanStack Start SDK */
export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): Client | undefined;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface SentryTanstackStartOptions extends BuildTimeOptionsBase {
* ```typescript
* // vite.config.ts
* import { defineConfig } from 'vite';
* import { sentryTanstackStart } from '@sentry/tanstackstart-react';
* import { sentryTanstackStart } from '@sentry/tanstackstart-react/vite';
* import { tanstackStart } from '@tanstack/react-start/plugin/vite';
*
* export default defineConfig({
Expand Down
Loading