Skip to content

Commit c27a09a

Browse files
authored
feat(tanstackstart): Refine initial API (#15574)
- Adds a config param to the build time wrapping so that TS doesn't complain when people copy paste a docs snippet. - Adds `wrapCreateRootRouteWithSentry` which will be used for server->client tracing because we inject meta tags into the initial SSR html.
1 parent dfc2b52 commit c27a09a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

packages/tanstackstart/src/common/index.ts

+7
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,10 @@ export function sentryGlobalServerMiddlewareHandler() {
1414
export function wrapStreamHandlerWithSentry<H>(handler: H): H {
1515
return handler;
1616
}
17+
18+
/**
19+
* Wraps the create root route function with Sentry for server-client tracing with SSR.
20+
*/
21+
export function wrapCreateRootRouteWithSentry<F>(createRootRoute: F): F {
22+
return createRootRoute;
23+
}
+11-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
/**
22
* Wraps a TanStack Start config.
33
*/
4-
export function wrapVinxiConfigWithSentry<C>(config: C): C {
4+
export function wrapVinxiConfigWithSentry<C>(
5+
config: C,
6+
// TODO: Expand this type in the future. Right now it is just so that TS doesn't complain for our users when they copy paste from the docs.
7+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
8+
sentryBuildOptions: {
9+
org?: string;
10+
project?: string;
11+
silent?: boolean;
12+
authToken?: boolean;
13+
} = {},
14+
): C {
515
return config;
616
}

0 commit comments

Comments
 (0)