@flareapp/react 2.4.0 → 2.5.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/dist/index.cjs CHANGED
@@ -1,227 +1,11 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- //#region \0rolldown/runtime.js
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
12
- key = keys[i];
13
- if (!__hasOwnProp.call(to, key) && key !== except) {
14
- __defProp(to, key, {
15
- get: ((k) => from[k]).bind(null, key),
16
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
17
- });
18
- }
19
- }
20
- }
21
- return to;
22
- };
23
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
24
- value: mod,
25
- enumerable: true
26
- }) : target, mod));
27
-
28
- //#endregion
2
+ const require_flareReactErrorHandler = require('./flareReactErrorHandler-9xZVBY7Q.cjs');
29
3
  let _flareapp_js = require("@flareapp/js");
30
- let react = require("react");
31
- react = __toESM(react);
32
-
33
- //#region src/constants.ts
34
- const CHROMIUM_STACK_REGEX = /^at\s+(\S+)(?:\s+\((.+):(\d+):(\d+)\))?$/;
35
- const FIREFOX_SAFARI_STACK_REGEX = /^(\S+?)@(.+):(\d+):(\d+)$/;
36
- const PACKAGE_VERSION = typeof process !== "undefined" && true ? "2.4.0" : "?";
37
-
38
- //#endregion
39
- //#region src/identify.ts
40
- let registered = false;
41
- function registerReactSdkIdentity() {
42
- if (registered) return;
43
- registered = true;
44
- _flareapp_js.flare.setSdkInfo({
45
- name: "@flareapp/react",
46
- version: PACKAGE_VERSION
47
- });
48
- _flareapp_js.flare.setFramework({
49
- name: "React",
50
- version: react.version
51
- });
52
- }
53
-
54
- //#endregion
55
- //#region src/formatComponentStack.ts
56
- function formatComponentStack(stack) {
57
- return stack.split(/\s*\n\s*/g).filter((line) => line.length > 0);
58
- }
59
-
60
- //#endregion
61
- //#region src/parseComponentStack.ts
62
- function parseComponentStack(stack) {
63
- return stack.split(/\s*\n\s*/g).filter((line) => line.length > 0).map((line) => {
64
- const chromeMatch = line.match(CHROMIUM_STACK_REGEX);
65
- if (chromeMatch) return {
66
- component: chromeMatch[1],
67
- file: chromeMatch[2] ?? null,
68
- line: chromeMatch[3] ? Number(chromeMatch[3]) : null,
69
- column: chromeMatch[4] ? Number(chromeMatch[4]) : null
70
- };
71
- const firefoxSafariMatch = line.match(FIREFOX_SAFARI_STACK_REGEX);
72
- if (firefoxSafariMatch) return {
73
- component: firefoxSafariMatch[1],
74
- file: firefoxSafariMatch[2],
75
- line: Number(firefoxSafariMatch[3]),
76
- column: Number(firefoxSafariMatch[4])
77
- };
78
- return {
79
- component: line.replace(/^at\s+/, ""),
80
- file: null,
81
- line: null,
82
- column: null
83
- };
84
- });
85
- }
86
-
87
- //#endregion
88
- //#region src/parseMinifiedReactError.ts
89
- const NUMBER_PATTERN = /Minified React error #(\d+)/;
90
- const ARG_PATTERN = /args\[\]=([^&\s]*)/g;
91
- const URL_PATTERN = /(https?:\/\/\S+)/;
92
- function safeDecode(value) {
93
- try {
94
- return decodeURIComponent(value);
95
- } catch {
96
- return value;
97
- }
98
- }
99
- function parseMinifiedReactError(error) {
100
- const message = error?.message;
101
- if (!message) return null;
102
- const numberMatch = message.match(NUMBER_PATTERN);
103
- if (!numberMatch) return null;
104
- const args = [];
105
- for (const match of message.matchAll(ARG_PATTERN)) args.push(safeDecode(match[1]));
106
- const urlMatch = message.match(URL_PATTERN);
107
- return {
108
- number: Number(numberMatch[1]),
109
- args,
110
- url: urlMatch ? urlMatch[1] : null
111
- };
112
- }
113
-
114
- //#endregion
115
- //#region src/buildReactContext.ts
116
- function buildReactContext(rawStack, error) {
117
- const minifiedError = parseMinifiedReactError(error);
118
- return { react: {
119
- componentStack: formatComponentStack(rawStack),
120
- componentStackFrames: parseComponentStack(rawStack),
121
- version: react.version,
122
- ...minifiedError ? { minifiedError } : {}
123
- } };
124
- }
125
-
126
- //#endregion
127
- //#region src/contextToAttributes.ts
128
- function contextToAttributes(context) {
129
- return { "context.custom": { react: {
130
- componentStack: context.react.componentStack,
131
- componentStackFrames: context.react.componentStackFrames,
132
- ...context.react.version ? { version: context.react.version } : {},
133
- ...context.react.minifiedError ? { minifiedError: context.react.minifiedError } : {}
134
- } } };
135
- }
136
4
 
137
- //#endregion
138
- //#region src/FlareErrorBoundary.ts
139
- var FlareErrorBoundary = class extends react.Component {
140
- state = {
141
- error: null,
142
- componentStack: []
143
- };
144
- static getDerivedStateFromError(error) {
145
- return { error };
146
- }
147
- componentDidCatch(error, errorInfo) {
148
- this.props.beforeEvaluate?.({
149
- error,
150
- errorInfo
151
- });
152
- const context = buildReactContext(errorInfo.componentStack ?? "", error);
153
- const finalContext = this.props.beforeSubmit?.({
154
- error,
155
- errorInfo,
156
- context
157
- }) ?? context;
158
- this.setState({ componentStack: finalContext.react.componentStack });
159
- _flareapp_js.flare.reportSilently(error, contextToAttributes(finalContext));
160
- this.props.afterSubmit?.({
161
- error,
162
- errorInfo,
163
- context: finalContext
164
- });
165
- }
166
- componentDidUpdate(prevProps) {
167
- if (this.state.error === null || !this.props.resetKeys) return;
168
- const prevKeys = prevProps.resetKeys;
169
- const nextKeys = this.props.resetKeys;
170
- const lengthChanged = prevKeys?.length !== nextKeys.length;
171
- const valuesChanged = nextKeys.some((key, i) => !Object.is(key, prevKeys?.[i]));
172
- if (lengthChanged || valuesChanged) this.reset();
173
- }
174
- reset = () => {
175
- const { error } = this.state;
176
- this.props.onReset?.(error);
177
- this.setState({
178
- error: null,
179
- componentStack: []
180
- });
181
- };
182
- render() {
183
- const { error } = this.state;
184
- if (error !== null) {
185
- const { fallback } = this.props;
186
- if (typeof fallback === "function") return fallback({
187
- error,
188
- componentStack: this.state.componentStack,
189
- resetErrorBoundary: this.reset
190
- });
191
- return fallback ?? null;
192
- }
193
- return this.props.children;
194
- }
195
- };
196
-
197
- //#endregion
198
- //#region src/flareReactErrorHandler.ts
199
- function flareReactErrorHandler(options) {
200
- return (error, errorInfo) => {
201
- const errorObject = (0, _flareapp_js.convertToError)(error);
202
- options?.beforeEvaluate?.({
203
- error: errorObject,
204
- errorInfo
205
- });
206
- const context = buildReactContext(errorInfo.componentStack ?? "", errorObject);
207
- const finalContext = options?.beforeSubmit?.({
208
- error: errorObject,
209
- errorInfo,
210
- context
211
- }) ?? context;
212
- _flareapp_js.flare.reportSilently(errorObject, contextToAttributes(finalContext));
213
- options?.afterSubmit?.({
214
- error: errorObject,
215
- errorInfo,
216
- context: finalContext
217
- });
218
- };
219
- }
220
-
221
- //#endregion
222
5
  //#region src/index.ts
223
- registerReactSdkIdentity();
6
+ require_flareReactErrorHandler.registerDefaultFlare(() => _flareapp_js.flare);
7
+ require_flareReactErrorHandler.registerReactSdkIdentity(_flareapp_js.flare);
224
8
 
225
9
  //#endregion
226
- exports.FlareErrorBoundary = FlareErrorBoundary;
227
- exports.flareReactErrorHandler = flareReactErrorHandler;
10
+ exports.FlareErrorBoundary = require_flareReactErrorHandler.FlareErrorBoundary;
11
+ exports.flareReactErrorHandler = require_flareReactErrorHandler.flareReactErrorHandler;
package/dist/index.d.cts CHANGED
@@ -1,90 +1,2 @@
1
- import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react";
2
-
3
- //#region src/types.d.ts
4
- type ComponentStackFrame = {
5
- component: string;
6
- file: string | null;
7
- line: number | null;
8
- column: number | null;
9
- };
10
- type MinifiedReactError = {
11
- number: number;
12
- args: string[];
13
- url: string | null;
14
- };
15
- type FlareReactContext = {
16
- react: {
17
- componentStack: string[];
18
- componentStackFrames: ComponentStackFrame[];
19
- version?: string;
20
- minifiedError?: MinifiedReactError;
21
- };
22
- };
23
- //#endregion
24
- //#region src/FlareErrorBoundary.d.ts
25
- type FlareErrorBoundaryFallbackProps = {
26
- error: Error;
27
- componentStack: string[];
28
- resetErrorBoundary: () => void;
29
- };
30
- type FlareErrorBoundaryProps = PropsWithChildren<{
31
- fallback?: ReactNode | ((props: FlareErrorBoundaryFallbackProps) => ReactNode);
32
- resetKeys?: unknown[];
33
- beforeEvaluate?: (params: {
34
- error: Error;
35
- errorInfo: ErrorInfo;
36
- }) => void;
37
- beforeSubmit?: (params: {
38
- error: Error;
39
- errorInfo: ErrorInfo;
40
- context: FlareReactContext;
41
- }) => FlareReactContext;
42
- afterSubmit?: (params: {
43
- error: Error;
44
- errorInfo: ErrorInfo;
45
- context: FlareReactContext;
46
- }) => void;
47
- onReset?: (error: Error | null) => void;
48
- }>;
49
- type FlareErrorBoundaryState = {
50
- error: Error | null;
51
- componentStack: string[];
52
- };
53
- declare class FlareErrorBoundary extends Component<FlareErrorBoundaryProps, FlareErrorBoundaryState> {
54
- state: FlareErrorBoundaryState;
55
- static getDerivedStateFromError(error: Error): Partial<FlareErrorBoundaryState>;
56
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
57
- componentDidUpdate(prevProps: FlareErrorBoundaryProps): void;
58
- reset: () => void;
59
- render(): ReactNode;
60
- }
61
- //#endregion
62
- //#region src/flareReactErrorHandler.d.ts
63
- type FlareReactErrorHandlerCallback = (error: unknown, errorInfo: {
64
- componentStack?: string;
65
- }) => void;
66
- type FlareReactErrorHandlerOptions = {
67
- beforeEvaluate?: (params: {
68
- error: Error;
69
- errorInfo: {
70
- componentStack?: string;
71
- };
72
- }) => void;
73
- beforeSubmit?: (params: {
74
- error: Error;
75
- errorInfo: {
76
- componentStack?: string;
77
- };
78
- context: FlareReactContext;
79
- }) => FlareReactContext;
80
- afterSubmit?: (params: {
81
- error: Error;
82
- errorInfo: {
83
- componentStack?: string;
84
- };
85
- context: FlareReactContext;
86
- }) => void;
87
- };
88
- declare function flareReactErrorHandler(options?: FlareReactErrorHandlerOptions): FlareReactErrorHandlerCallback;
89
- //#endregion
1
+ import { a as FlareErrorBoundaryFallbackProps, c as FlareReactContext, i as FlareErrorBoundary, l as MinifiedReactError, n as FlareReactErrorHandlerOptions, o as FlareErrorBoundaryProps, r as flareReactErrorHandler, s as ComponentStackFrame, t as FlareReactErrorHandlerCallback } from "./flareReactErrorHandler-4Vgqlths.cjs";
90
2
  export { type ComponentStackFrame, FlareErrorBoundary, type FlareErrorBoundaryFallbackProps, type FlareErrorBoundaryProps, type FlareReactContext, type FlareReactErrorHandlerCallback, type FlareReactErrorHandlerOptions, type MinifiedReactError, flareReactErrorHandler };
package/dist/index.d.mts CHANGED
@@ -1,90 +1,2 @@
1
- import { Component, ErrorInfo, PropsWithChildren, ReactNode } from "react";
2
-
3
- //#region src/types.d.ts
4
- type ComponentStackFrame = {
5
- component: string;
6
- file: string | null;
7
- line: number | null;
8
- column: number | null;
9
- };
10
- type MinifiedReactError = {
11
- number: number;
12
- args: string[];
13
- url: string | null;
14
- };
15
- type FlareReactContext = {
16
- react: {
17
- componentStack: string[];
18
- componentStackFrames: ComponentStackFrame[];
19
- version?: string;
20
- minifiedError?: MinifiedReactError;
21
- };
22
- };
23
- //#endregion
24
- //#region src/FlareErrorBoundary.d.ts
25
- type FlareErrorBoundaryFallbackProps = {
26
- error: Error;
27
- componentStack: string[];
28
- resetErrorBoundary: () => void;
29
- };
30
- type FlareErrorBoundaryProps = PropsWithChildren<{
31
- fallback?: ReactNode | ((props: FlareErrorBoundaryFallbackProps) => ReactNode);
32
- resetKeys?: unknown[];
33
- beforeEvaluate?: (params: {
34
- error: Error;
35
- errorInfo: ErrorInfo;
36
- }) => void;
37
- beforeSubmit?: (params: {
38
- error: Error;
39
- errorInfo: ErrorInfo;
40
- context: FlareReactContext;
41
- }) => FlareReactContext;
42
- afterSubmit?: (params: {
43
- error: Error;
44
- errorInfo: ErrorInfo;
45
- context: FlareReactContext;
46
- }) => void;
47
- onReset?: (error: Error | null) => void;
48
- }>;
49
- type FlareErrorBoundaryState = {
50
- error: Error | null;
51
- componentStack: string[];
52
- };
53
- declare class FlareErrorBoundary extends Component<FlareErrorBoundaryProps, FlareErrorBoundaryState> {
54
- state: FlareErrorBoundaryState;
55
- static getDerivedStateFromError(error: Error): Partial<FlareErrorBoundaryState>;
56
- componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
57
- componentDidUpdate(prevProps: FlareErrorBoundaryProps): void;
58
- reset: () => void;
59
- render(): ReactNode;
60
- }
61
- //#endregion
62
- //#region src/flareReactErrorHandler.d.ts
63
- type FlareReactErrorHandlerCallback = (error: unknown, errorInfo: {
64
- componentStack?: string;
65
- }) => void;
66
- type FlareReactErrorHandlerOptions = {
67
- beforeEvaluate?: (params: {
68
- error: Error;
69
- errorInfo: {
70
- componentStack?: string;
71
- };
72
- }) => void;
73
- beforeSubmit?: (params: {
74
- error: Error;
75
- errorInfo: {
76
- componentStack?: string;
77
- };
78
- context: FlareReactContext;
79
- }) => FlareReactContext;
80
- afterSubmit?: (params: {
81
- error: Error;
82
- errorInfo: {
83
- componentStack?: string;
84
- };
85
- context: FlareReactContext;
86
- }) => void;
87
- };
88
- declare function flareReactErrorHandler(options?: FlareReactErrorHandlerOptions): FlareReactErrorHandlerCallback;
89
- //#endregion
1
+ import { a as FlareErrorBoundaryFallbackProps, c as FlareReactContext, i as FlareErrorBoundary, l as MinifiedReactError, n as FlareReactErrorHandlerOptions, o as FlareErrorBoundaryProps, r as flareReactErrorHandler, s as ComponentStackFrame, t as FlareReactErrorHandlerCallback } from "./flareReactErrorHandler-BcVYRMtC.mjs";
90
2
  export { type ComponentStackFrame, FlareErrorBoundary, type FlareErrorBoundaryFallbackProps, type FlareErrorBoundaryProps, type FlareReactContext, type FlareReactErrorHandlerCallback, type FlareReactErrorHandlerOptions, type MinifiedReactError, flareReactErrorHandler };
package/dist/index.mjs CHANGED
@@ -1,198 +1,9 @@
1
- import { convertToError, flare } from "@flareapp/js";
2
- import * as React from "react";
3
- import { Component, version } from "react";
1
+ import { i as registerReactSdkIdentity, n as FlareErrorBoundary, r as registerDefaultFlare, t as flareReactErrorHandler } from "./flareReactErrorHandler-DSLl6QFX.mjs";
2
+ import { flare } from "@flareapp/js";
4
3
 
5
- //#region src/constants.ts
6
- const CHROMIUM_STACK_REGEX = /^at\s+(\S+)(?:\s+\((.+):(\d+):(\d+)\))?$/;
7
- const FIREFOX_SAFARI_STACK_REGEX = /^(\S+?)@(.+):(\d+):(\d+)$/;
8
- const PACKAGE_VERSION = typeof process !== "undefined" && true ? "2.4.0" : "?";
9
-
10
- //#endregion
11
- //#region src/identify.ts
12
- let registered = false;
13
- function registerReactSdkIdentity() {
14
- if (registered) return;
15
- registered = true;
16
- flare.setSdkInfo({
17
- name: "@flareapp/react",
18
- version: PACKAGE_VERSION
19
- });
20
- flare.setFramework({
21
- name: "React",
22
- version: React.version
23
- });
24
- }
25
-
26
- //#endregion
27
- //#region src/formatComponentStack.ts
28
- function formatComponentStack(stack) {
29
- return stack.split(/\s*\n\s*/g).filter((line) => line.length > 0);
30
- }
31
-
32
- //#endregion
33
- //#region src/parseComponentStack.ts
34
- function parseComponentStack(stack) {
35
- return stack.split(/\s*\n\s*/g).filter((line) => line.length > 0).map((line) => {
36
- const chromeMatch = line.match(CHROMIUM_STACK_REGEX);
37
- if (chromeMatch) return {
38
- component: chromeMatch[1],
39
- file: chromeMatch[2] ?? null,
40
- line: chromeMatch[3] ? Number(chromeMatch[3]) : null,
41
- column: chromeMatch[4] ? Number(chromeMatch[4]) : null
42
- };
43
- const firefoxSafariMatch = line.match(FIREFOX_SAFARI_STACK_REGEX);
44
- if (firefoxSafariMatch) return {
45
- component: firefoxSafariMatch[1],
46
- file: firefoxSafariMatch[2],
47
- line: Number(firefoxSafariMatch[3]),
48
- column: Number(firefoxSafariMatch[4])
49
- };
50
- return {
51
- component: line.replace(/^at\s+/, ""),
52
- file: null,
53
- line: null,
54
- column: null
55
- };
56
- });
57
- }
58
-
59
- //#endregion
60
- //#region src/parseMinifiedReactError.ts
61
- const NUMBER_PATTERN = /Minified React error #(\d+)/;
62
- const ARG_PATTERN = /args\[\]=([^&\s]*)/g;
63
- const URL_PATTERN = /(https?:\/\/\S+)/;
64
- function safeDecode(value) {
65
- try {
66
- return decodeURIComponent(value);
67
- } catch {
68
- return value;
69
- }
70
- }
71
- function parseMinifiedReactError(error) {
72
- const message = error?.message;
73
- if (!message) return null;
74
- const numberMatch = message.match(NUMBER_PATTERN);
75
- if (!numberMatch) return null;
76
- const args = [];
77
- for (const match of message.matchAll(ARG_PATTERN)) args.push(safeDecode(match[1]));
78
- const urlMatch = message.match(URL_PATTERN);
79
- return {
80
- number: Number(numberMatch[1]),
81
- args,
82
- url: urlMatch ? urlMatch[1] : null
83
- };
84
- }
85
-
86
- //#endregion
87
- //#region src/buildReactContext.ts
88
- function buildReactContext(rawStack, error) {
89
- const minifiedError = parseMinifiedReactError(error);
90
- return { react: {
91
- componentStack: formatComponentStack(rawStack),
92
- componentStackFrames: parseComponentStack(rawStack),
93
- version,
94
- ...minifiedError ? { minifiedError } : {}
95
- } };
96
- }
97
-
98
- //#endregion
99
- //#region src/contextToAttributes.ts
100
- function contextToAttributes(context) {
101
- return { "context.custom": { react: {
102
- componentStack: context.react.componentStack,
103
- componentStackFrames: context.react.componentStackFrames,
104
- ...context.react.version ? { version: context.react.version } : {},
105
- ...context.react.minifiedError ? { minifiedError: context.react.minifiedError } : {}
106
- } } };
107
- }
108
-
109
- //#endregion
110
- //#region src/FlareErrorBoundary.ts
111
- var FlareErrorBoundary = class extends Component {
112
- state = {
113
- error: null,
114
- componentStack: []
115
- };
116
- static getDerivedStateFromError(error) {
117
- return { error };
118
- }
119
- componentDidCatch(error, errorInfo) {
120
- this.props.beforeEvaluate?.({
121
- error,
122
- errorInfo
123
- });
124
- const context = buildReactContext(errorInfo.componentStack ?? "", error);
125
- const finalContext = this.props.beforeSubmit?.({
126
- error,
127
- errorInfo,
128
- context
129
- }) ?? context;
130
- this.setState({ componentStack: finalContext.react.componentStack });
131
- flare.reportSilently(error, contextToAttributes(finalContext));
132
- this.props.afterSubmit?.({
133
- error,
134
- errorInfo,
135
- context: finalContext
136
- });
137
- }
138
- componentDidUpdate(prevProps) {
139
- if (this.state.error === null || !this.props.resetKeys) return;
140
- const prevKeys = prevProps.resetKeys;
141
- const nextKeys = this.props.resetKeys;
142
- const lengthChanged = prevKeys?.length !== nextKeys.length;
143
- const valuesChanged = nextKeys.some((key, i) => !Object.is(key, prevKeys?.[i]));
144
- if (lengthChanged || valuesChanged) this.reset();
145
- }
146
- reset = () => {
147
- const { error } = this.state;
148
- this.props.onReset?.(error);
149
- this.setState({
150
- error: null,
151
- componentStack: []
152
- });
153
- };
154
- render() {
155
- const { error } = this.state;
156
- if (error !== null) {
157
- const { fallback } = this.props;
158
- if (typeof fallback === "function") return fallback({
159
- error,
160
- componentStack: this.state.componentStack,
161
- resetErrorBoundary: this.reset
162
- });
163
- return fallback ?? null;
164
- }
165
- return this.props.children;
166
- }
167
- };
168
-
169
- //#endregion
170
- //#region src/flareReactErrorHandler.ts
171
- function flareReactErrorHandler(options) {
172
- return (error, errorInfo) => {
173
- const errorObject = convertToError(error);
174
- options?.beforeEvaluate?.({
175
- error: errorObject,
176
- errorInfo
177
- });
178
- const context = buildReactContext(errorInfo.componentStack ?? "", errorObject);
179
- const finalContext = options?.beforeSubmit?.({
180
- error: errorObject,
181
- errorInfo,
182
- context
183
- }) ?? context;
184
- flare.reportSilently(errorObject, contextToAttributes(finalContext));
185
- options?.afterSubmit?.({
186
- error: errorObject,
187
- errorInfo,
188
- context: finalContext
189
- });
190
- };
191
- }
192
-
193
- //#endregion
194
4
  //#region src/index.ts
195
- registerReactSdkIdentity();
5
+ registerDefaultFlare(() => flare);
6
+ registerReactSdkIdentity(flare);
196
7
 
197
8
  //#endregion
198
9
  export { FlareErrorBoundary, flareReactErrorHandler };
@@ -0,0 +1,5 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_flareReactErrorHandler = require('./flareReactErrorHandler-9xZVBY7Q.cjs');
3
+
4
+ exports.FlareErrorBoundary = require_flareReactErrorHandler.FlareErrorBoundary;
5
+ exports.flareReactErrorHandler = require_flareReactErrorHandler.flareReactErrorHandler;
@@ -0,0 +1,2 @@
1
+ import { a as FlareErrorBoundaryFallbackProps, c as FlareReactContext, i as FlareErrorBoundary, l as MinifiedReactError, n as FlareReactErrorHandlerOptions, o as FlareErrorBoundaryProps, r as flareReactErrorHandler, s as ComponentStackFrame, t as FlareReactErrorHandlerCallback } from "./flareReactErrorHandler-4Vgqlths.cjs";
2
+ export { type ComponentStackFrame, FlareErrorBoundary, type FlareErrorBoundaryFallbackProps, type FlareErrorBoundaryProps, type FlareReactContext, type FlareReactErrorHandlerCallback, type FlareReactErrorHandlerOptions, type MinifiedReactError, flareReactErrorHandler };
@@ -0,0 +1,2 @@
1
+ import { a as FlareErrorBoundaryFallbackProps, c as FlareReactContext, i as FlareErrorBoundary, l as MinifiedReactError, n as FlareReactErrorHandlerOptions, o as FlareErrorBoundaryProps, r as flareReactErrorHandler, s as ComponentStackFrame, t as FlareReactErrorHandlerCallback } from "./flareReactErrorHandler-BcVYRMtC.mjs";
2
+ export { type ComponentStackFrame, FlareErrorBoundary, type FlareErrorBoundaryFallbackProps, type FlareErrorBoundaryProps, type FlareReactContext, type FlareReactErrorHandlerCallback, type FlareReactErrorHandlerOptions, type MinifiedReactError, flareReactErrorHandler };
@@ -0,0 +1,3 @@
1
+ import { n as FlareErrorBoundary, t as flareReactErrorHandler } from "./flareReactErrorHandler-DSLl6QFX.mjs";
2
+
3
+ export { FlareErrorBoundary, flareReactErrorHandler };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flareapp/react",
3
- "version": "2.4.0",
3
+ "version": "2.5.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",
@@ -27,6 +27,10 @@
27
27
  "main": "./dist/index.cjs",
28
28
  "module": "./dist/index.mjs",
29
29
  "types": "./dist/index.d.cts",
30
+ "sideEffects": [
31
+ "./dist/index.cjs",
32
+ "./dist/index.mjs"
33
+ ],
30
34
  "exports": {
31
35
  ".": {
32
36
  "import": {
@@ -37,16 +41,31 @@
37
41
  "types": "./dist/index.d.cts",
38
42
  "default": "./dist/index.cjs"
39
43
  }
44
+ },
45
+ "./inject": {
46
+ "import": {
47
+ "types": "./dist/inject.d.mts",
48
+ "default": "./dist/inject.mjs"
49
+ },
50
+ "require": {
51
+ "types": "./dist/inject.d.cts",
52
+ "default": "./dist/inject.cjs"
53
+ }
40
54
  }
41
55
  },
42
56
  "scripts": {
43
57
  "prepublishOnly": "npm run build",
44
- "build": "tsdown src/index.ts --format cjs,esm --dts --env.PACKAGE_VERSION=$(node -p \"require('./package.json').version\") --clean",
58
+ "build": "tsdown src/index.ts src/inject.ts --format cjs,esm --dts --env.PACKAGE_VERSION=$(node -p \"require('./package.json').version\") --clean",
45
59
  "test": "vitest run",
46
60
  "typescript": "tsc --noEmit",
61
+ "verify:inject": "node scripts/verify-inject-no-root.mjs",
47
62
  "release": "release-it"
48
63
  },
64
+ "dependencies": {
65
+ "@flareapp/core": "2.5.0"
66
+ },
49
67
  "devDependencies": {
68
+ "@flareapp/electron": "file:../electron",
50
69
  "@flareapp/js": "file:../js",
51
70
  "@testing-library/jest-dom": "^6.9.1",
52
71
  "@testing-library/react": "^16.0.0",
@@ -60,7 +79,7 @@
60
79
  "vitest": "^4.0.0"
61
80
  },
62
81
  "peerDependencies": {
63
- "@flareapp/js": "^2.4.0",
82
+ "@flareapp/js": "^2.5.0",
64
83
  "react": "^16.0.0||^17.0.0||^18.0.0||^19.0.0"
65
84
  },
66
85
  "publishConfig": {