@flareapp/vue 2.0.0 → 2.0.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/dist/index.cjs +6 -20
- package/dist/index.mjs +5 -19
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -164,14 +164,6 @@ function buildComponentHierarchyFrames(instance, options) {
|
|
|
164
164
|
return frames;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
//#endregion
|
|
168
|
-
//#region src/convertToError.ts
|
|
169
|
-
function convertToError(error) {
|
|
170
|
-
if (error instanceof Error) return error;
|
|
171
|
-
if (typeof error === "string") return new Error(error);
|
|
172
|
-
return new Error(String(error));
|
|
173
|
-
}
|
|
174
|
-
|
|
175
167
|
//#endregion
|
|
176
168
|
//#region src/getErrorOrigin.ts
|
|
177
169
|
function getErrorOrigin(info) {
|
|
@@ -219,10 +211,7 @@ function vueContextToAttributes(context) {
|
|
|
219
211
|
};
|
|
220
212
|
if (context.vue.componentProps) vue.componentProps = context.vue.componentProps;
|
|
221
213
|
if (context.vue.route) vue.route = context.vue.route;
|
|
222
|
-
return { "context.custom": {
|
|
223
|
-
framework: "vue",
|
|
224
|
-
vue
|
|
225
|
-
} };
|
|
214
|
+
return { "context.custom": { vue } };
|
|
226
215
|
}
|
|
227
216
|
function vueWarningContextToAttributes(context) {
|
|
228
217
|
const vue = {
|
|
@@ -232,10 +221,7 @@ function vueWarningContextToAttributes(context) {
|
|
|
232
221
|
componentTrace: context.vue.componentTrace
|
|
233
222
|
};
|
|
234
223
|
if (context.vue.route) vue.route = context.vue.route;
|
|
235
|
-
return { "context.custom": {
|
|
236
|
-
framework: "vue",
|
|
237
|
-
vue
|
|
238
|
-
} };
|
|
224
|
+
return { "context.custom": { vue } };
|
|
239
225
|
}
|
|
240
226
|
const installedApps = /* @__PURE__ */ new WeakSet();
|
|
241
227
|
const flareVue = (app, options) => {
|
|
@@ -254,7 +240,7 @@ const flareVue = (app, options) => {
|
|
|
254
240
|
const propsDenylist = resolveDenylist(options?.propsDenylist, options?.replaceDefaultDenylist);
|
|
255
241
|
const initialErrorHandler = app.config.errorHandler;
|
|
256
242
|
app.config.errorHandler = (error, instance, info) => {
|
|
257
|
-
const errorToReport = convertToError(error);
|
|
243
|
+
const errorToReport = (0, _flareapp_js.convertToError)(error);
|
|
258
244
|
options?.beforeEvaluate?.({
|
|
259
245
|
error: errorToReport,
|
|
260
246
|
instance,
|
|
@@ -285,7 +271,7 @@ const flareVue = (app, options) => {
|
|
|
285
271
|
info,
|
|
286
272
|
context
|
|
287
273
|
}) ?? context;
|
|
288
|
-
|
|
274
|
+
_flareapp_js.flare.reportSilently(errorToReport, vueContextToAttributes(finalContext));
|
|
289
275
|
options?.afterSubmit?.({
|
|
290
276
|
error: errorToReport,
|
|
291
277
|
instance,
|
|
@@ -378,7 +364,7 @@ const FlareErrorBoundary = (0, vue.defineComponent)({
|
|
|
378
364
|
if (lengthChanged || valuesChanged) resetErrorBoundary();
|
|
379
365
|
});
|
|
380
366
|
(0, vue.onErrorCaptured)((currentError, instance, info) => {
|
|
381
|
-
const errorToReport = convertToError(currentError);
|
|
367
|
+
const errorToReport = (0, _flareapp_js.convertToError)(currentError);
|
|
382
368
|
props.beforeEvaluate?.({
|
|
383
369
|
error: errorToReport,
|
|
384
370
|
instance,
|
|
@@ -414,7 +400,7 @@ const FlareErrorBoundary = (0, vue.defineComponent)({
|
|
|
414
400
|
componentProps.value = finalContext.vue.componentProps;
|
|
415
401
|
componentHierarchy.value = finalContext.vue.componentHierarchy;
|
|
416
402
|
componentHierarchyFrames.value = finalContext.vue.componentHierarchyFrames;
|
|
417
|
-
|
|
403
|
+
_flareapp_js.flare.reportSilently(errorToReport, vueContextToAttributes(finalContext));
|
|
418
404
|
props.afterSubmit?.({
|
|
419
405
|
error: errorToReport,
|
|
420
406
|
instance,
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { flare, redactFullPath, resolveDenylist } from "@flareapp/js";
|
|
1
|
+
import { convertToError, flare, redactFullPath, resolveDenylist } from "@flareapp/js";
|
|
2
2
|
import { defineComponent, getCurrentInstance, onErrorCaptured, ref, watch } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/constants.ts
|
|
@@ -163,14 +163,6 @@ function buildComponentHierarchyFrames(instance, options) {
|
|
|
163
163
|
return frames;
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
//#endregion
|
|
167
|
-
//#region src/convertToError.ts
|
|
168
|
-
function convertToError(error) {
|
|
169
|
-
if (error instanceof Error) return error;
|
|
170
|
-
if (typeof error === "string") return new Error(error);
|
|
171
|
-
return new Error(String(error));
|
|
172
|
-
}
|
|
173
|
-
|
|
174
166
|
//#endregion
|
|
175
167
|
//#region src/getErrorOrigin.ts
|
|
176
168
|
function getErrorOrigin(info) {
|
|
@@ -218,10 +210,7 @@ function vueContextToAttributes(context) {
|
|
|
218
210
|
};
|
|
219
211
|
if (context.vue.componentProps) vue.componentProps = context.vue.componentProps;
|
|
220
212
|
if (context.vue.route) vue.route = context.vue.route;
|
|
221
|
-
return { "context.custom": {
|
|
222
|
-
framework: "vue",
|
|
223
|
-
vue
|
|
224
|
-
} };
|
|
213
|
+
return { "context.custom": { vue } };
|
|
225
214
|
}
|
|
226
215
|
function vueWarningContextToAttributes(context) {
|
|
227
216
|
const vue = {
|
|
@@ -231,10 +220,7 @@ function vueWarningContextToAttributes(context) {
|
|
|
231
220
|
componentTrace: context.vue.componentTrace
|
|
232
221
|
};
|
|
233
222
|
if (context.vue.route) vue.route = context.vue.route;
|
|
234
|
-
return { "context.custom": {
|
|
235
|
-
framework: "vue",
|
|
236
|
-
vue
|
|
237
|
-
} };
|
|
223
|
+
return { "context.custom": { vue } };
|
|
238
224
|
}
|
|
239
225
|
const installedApps = /* @__PURE__ */ new WeakSet();
|
|
240
226
|
const flareVue = (app, options) => {
|
|
@@ -284,7 +270,7 @@ const flareVue = (app, options) => {
|
|
|
284
270
|
info,
|
|
285
271
|
context
|
|
286
272
|
}) ?? context;
|
|
287
|
-
|
|
273
|
+
flare.reportSilently(errorToReport, vueContextToAttributes(finalContext));
|
|
288
274
|
options?.afterSubmit?.({
|
|
289
275
|
error: errorToReport,
|
|
290
276
|
instance,
|
|
@@ -413,7 +399,7 @@ const FlareErrorBoundary = defineComponent({
|
|
|
413
399
|
componentProps.value = finalContext.vue.componentProps;
|
|
414
400
|
componentHierarchy.value = finalContext.vue.componentHierarchy;
|
|
415
401
|
componentHierarchyFrames.value = finalContext.vue.componentHierarchyFrames;
|
|
416
|
-
|
|
402
|
+
flare.reportSilently(errorToReport, vueContextToAttributes(finalContext));
|
|
417
403
|
props.afterSubmit?.({
|
|
418
404
|
error: errorToReport,
|
|
419
405
|
instance,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flareapp/vue",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Vue client for flareapp.io",
|
|
5
5
|
"homepage": "https://flareapp.io",
|
|
6
6
|
"bugs": "https://github.com/spatie/flare-client-js/issues",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"vue-router": "^4.6.4"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
-
"@flareapp/js": "^2.0.
|
|
57
|
+
"@flareapp/js": "^2.0.1",
|
|
58
58
|
"vue": "^3.0.0",
|
|
59
59
|
"vue-router": "^4.0.0"
|
|
60
60
|
},
|