@belvador/react 0.3.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.
Files changed (2) hide show
  1. package/README.md +14 -3
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -6,15 +6,26 @@ Error tracking for React 18 and 19 apps, sending to your [Belvador](https://belv
6
6
  npm install @belvador/react
7
7
  ```
8
8
 
9
- ```tsx
10
- import { createRoot } from "react-dom/client";
11
- import { ErrorBoundary, init, reactErrorHandler } from "@belvador/react";
9
+ `src/instrument.ts`:
10
+
11
+ ```ts
12
+ import { init } from "@belvador/react";
12
13
 
13
14
  init({
14
15
  dsn: "https://<key>@ingest.belvador.dev/<project>",
15
16
  release: import.meta.env.VITE_APP_VERSION,
16
17
  environment: import.meta.env.MODE,
17
18
  });
19
+ ```
20
+
21
+ `src/main.tsx` — import it on the **first line**. Imports run before the rest of a file, so an
22
+ `init` call below `import App` never runs when one of App's modules throws while loading:
23
+
24
+ ```tsx
25
+ import "./instrument";
26
+ import { createRoot } from "react-dom/client";
27
+ import { ErrorBoundary, reactErrorHandler } from "@belvador/react";
28
+ import App from "./App";
18
29
 
19
30
  createRoot(document.getElementById("root")!, {
20
31
  // React 19: report errors React handles itself
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@belvador/react",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "Belvador error tracking for React 18/19: ErrorBoundary and root error handlers, errors only, private by default.",
5
5
  "license": "MIT",
6
6
  "author": "Belvador (https://belvador.dev)",
@@ -37,8 +37,8 @@
37
37
  "node": ">=18"
38
38
  },
39
39
  "dependencies": {
40
- "@belvador/browser": "0.3.0",
41
- "@belvador/core": "0.3.0",
40
+ "@belvador/browser": "0.4.1",
41
+ "@belvador/core": "0.4.1",
42
42
  "@sentry/react": "10.76.2"
43
43
  },
44
44
  "publishConfig": {