@flareapp/react 2.2.0 → 2.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  # @flareapp/react
2
2
 
3
- React integration for [Flare](https://flareapp.io) error tracking. Provides an error boundary component and a React 19+
4
- error handler for catching and reporting React component errors to Flare.
3
+ React integration for [Flare](https://flareapp.io) error tracking and logging. Provides an error boundary component and
4
+ a React 19+ error handler for catching and reporting React component errors to Flare.
5
5
 
6
6
  ## Installation
7
7
 
@@ -28,6 +28,19 @@ function App() {
28
28
  }
29
29
  ```
30
30
 
31
+ ## Logging
32
+
33
+ Beyond errors, the client can send structured logs. Logs are opt-in: enable them with `enableLogs`, then call any of the
34
+ eight syslog levels (`debug`, `info`, `notice`, `warning`, `error`, `critical`, `alert`, `emergency`).
35
+
36
+ ```tsx
37
+ import { flare } from '@flareapp/js';
38
+
39
+ flare.configure({ enableLogs: true });
40
+
41
+ flare.logger.info('Checkout started', { cartId: cart.id, total: cart.total });
42
+ ```
43
+
31
44
  ## Documentation
32
45
 
33
46
  Full documentation on the error boundary, the React 19+ error handler, lifecycle callbacks, and more is available
package/dist/index.cjs CHANGED
@@ -33,7 +33,7 @@ react = __toESM(react);
33
33
  //#region src/constants.ts
34
34
  const CHROMIUM_STACK_REGEX = /^at\s+(\S+)(?:\s+\((.+):(\d+):(\d+)\))?$/;
35
35
  const FIREFOX_SAFARI_STACK_REGEX = /^(\S+?)@(.+):(\d+):(\d+)$/;
36
- const PACKAGE_VERSION = typeof process !== "undefined" && true ? "2.2.0" : "?";
36
+ const PACKAGE_VERSION = typeof process !== "undefined" && true ? "2.3.0" : "?";
37
37
 
38
38
  //#endregion
39
39
  //#region src/identify.ts
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import { Component } from "react";
5
5
  //#region src/constants.ts
6
6
  const CHROMIUM_STACK_REGEX = /^at\s+(\S+)(?:\s+\((.+):(\d+):(\d+)\))?$/;
7
7
  const FIREFOX_SAFARI_STACK_REGEX = /^(\S+?)@(.+):(\d+):(\d+)$/;
8
- const PACKAGE_VERSION = typeof process !== "undefined" && true ? "2.2.0" : "?";
8
+ const PACKAGE_VERSION = typeof process !== "undefined" && true ? "2.3.0" : "?";
9
9
 
10
10
  //#endregion
11
11
  //#region src/identify.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/react",
3
- "version": "2.2.0",
3
+ "version": "2.3.0",
4
4
  "description": "React client for flareapp.io",
5
5
  "homepage": "https://flareapp.io",
6
6
  "bugs": "https://github.com/spatie/flare-client-js/issues",
@@ -21,6 +21,9 @@
21
21
  "Sebastian De Deyne <sebastian@spatie.be>",
22
22
  "Sébastien Henau <seba@spatie.be>"
23
23
  ],
24
+ "files": [
25
+ "dist"
26
+ ],
24
27
  "main": "./dist/index.cjs",
25
28
  "module": "./dist/index.mjs",
26
29
  "types": "./dist/index.d.cts",
@@ -57,7 +60,7 @@
57
60
  "vitest": "^4.0.0"
58
61
  },
59
62
  "peerDependencies": {
60
- "@flareapp/js": "^2.2.0",
63
+ "@flareapp/js": "^2.3.0",
61
64
  "react": "^16.0.0||^17.0.0||^18.0.0||^19.0.0"
62
65
  },
63
66
  "publishConfig": {
package/.oxlintrc.json DELETED
@@ -1,8 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../../.oxlintrc.json"],
4
- "plugins": ["react"],
5
- "env": {
6
- "browser": true
7
- }
8
- }
package/CHANGELOG.md DELETED
@@ -1,17 +0,0 @@
1
- ## 2.0.0
2
-
3
- ### Breaking changes
4
-
5
- - Bumps peer dependency `@flareapp/js` to `^2.0.0`. See its CHANGELOG for wire format changes.
6
- - `flareReactErrorHandler` no longer passes a third `extraSolutionParameters` arg to `flare.report` (solutions API removed in `@flareapp/js` v2).
7
- - The React component stack now lands on the report as `attributes['context.custom'].react.componentStack` and `attributes['context.custom'].react.componentStackFrames` (was nested under `context.react.*`).
8
-
9
- ### New
10
-
11
- - **`FlareErrorBoundary` lifecycle hooks.** `beforeEvaluate`, `beforeSubmit`, and `afterSubmit` props give full control over the report pipeline from within the boundary.
12
- - **`resetKeys` prop.** Mirrors `react-error-boundary`'s contract: when any element changes by `Object.is`, the boundary auto-resets. Pairs with the `onReset` callback.
13
- - **`FlareErrorBoundaryFallbackProps`** now includes `resetErrorBoundary()` for programmatic reset from fallback UI.
14
- - **`flareReactErrorHandler()` lifecycle hooks.** Same `beforeEvaluate`, `beforeSubmit`, and `afterSubmit` options, for use with third-party error boundaries.
15
- - Non-`Error` values passed to `flareReactErrorHandler` are coerced to `Error`.
16
- - The package self-identifies via `flare.setSdkInfo({ name: '@flareapp/react', version })` and `flare.setFramework({ name: 'React', version: React.version })` on import.
17
- - New exported types: `ComponentStackFrame`, `FlareReactContext`, `FlareReactErrorHandlerCallback`, `FlareReactErrorHandlerOptions`.