@belvador/tanstack-start 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -7,15 +7,23 @@ Error tracking for [TanStack Start](https://tanstack.com/start) apps on Cloudfla
|
|
|
7
7
|
npm install @belvador/tanstack-start
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
**Browser** — `src/
|
|
10
|
+
**Browser** — `src/instrument.ts`, imported on the **first line** of both `src/start.ts` and
|
|
11
|
+
`src/router.tsx` (the browser loads `start.ts` and the route tree before the router body runs):
|
|
11
12
|
|
|
12
13
|
```ts
|
|
13
|
-
import {
|
|
14
|
+
import { init } from "@belvador/tanstack-start/client";
|
|
14
15
|
|
|
15
16
|
if (typeof window !== "undefined") {
|
|
16
17
|
init({ dsn: "https://<key>@ingest.belvador.dev/<project>", release: import.meta.env.VITE_APP_VERSION });
|
|
17
18
|
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
// src/router.tsx
|
|
23
|
+
import "./instrument";
|
|
24
|
+
import { belvadorOnCatch } from "@belvador/tanstack-start/client";
|
|
18
25
|
// createRouter({ ..., defaultOnCatch: belvadorOnCatch })
|
|
26
|
+
// defaultOnCatch runs only where an error component exists (root errorComponent or defaultErrorComponent).
|
|
19
27
|
```
|
|
20
28
|
|
|
21
29
|
**Server** — `src/server.ts` (set `tanstackStart: { server: { entry: "server" } }` in `vite.config.ts`):
|
|
@@ -32,6 +40,7 @@ export default withBelvador((env) => ({ release: env.BELVADOR_RELEASE }), {
|
|
|
32
40
|
**Middleware** — `src/start.ts`, last in each list (closest to the handler):
|
|
33
41
|
|
|
34
42
|
```ts
|
|
43
|
+
import "./instrument";
|
|
35
44
|
import { createStart } from "@tanstack/react-start";
|
|
36
45
|
import { belvadorFunctionMiddleware, belvadorRequestMiddleware } from "@belvador/tanstack-start";
|
|
37
46
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@belvador/tanstack-start",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Belvador error tracking for TanStack Start on Cloudflare Workers: client, server entry and middleware.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Belvador (https://belvador.dev)",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"node": ">=18"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@belvador/cloudflare": "0.4.
|
|
46
|
-
"@belvador/core": "0.4.
|
|
47
|
-
"@belvador/react": "0.4.
|
|
45
|
+
"@belvador/cloudflare": "0.4.1",
|
|
46
|
+
"@belvador/core": "0.4.1",
|
|
47
|
+
"@belvador/react": "0.4.1"
|
|
48
48
|
},
|
|
49
49
|
"publishConfig": {
|
|
50
50
|
"access": "public",
|