@base44-preview/vite-plugin 1.0.2-pr.54.4d161c8 → 1.0.2-pr.54.58bdb49

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.
@@ -4,47 +4,35 @@ window.removeEventListener("error", handleWindowError);
4
4
  window.addEventListener("unhandledrejection", handleUnhandledRejection);
5
5
  window.addEventListener("error", handleWindowError);
6
6
  let shouldPropagateErrors = true;
7
- let suppressionTimer = null;
8
- let pendingErrors = [];
7
+ let suppressionTimer;
8
+ let hadSuppressedErrors = false;
9
9
  if (import.meta.hot) {
10
10
  import.meta.hot.on("vite:beforeUpdate", () => {
11
11
  shouldPropagateErrors = false;
12
- pendingErrors = [];
13
- if (suppressionTimer) {
14
- clearTimeout(suppressionTimer);
15
- }
12
+ hadSuppressedErrors = false;
13
+ clearTimeout(suppressionTimer);
16
14
  suppressionTimer = setTimeout(() => {
17
15
  shouldPropagateErrors = true;
18
- suppressionTimer = null;
19
- if (pendingErrors.length > 0) {
20
- window.parent?.postMessage({
21
- type: "sandbox:hmrErrorsRecovered",
22
- errorCount: pendingErrors.length,
23
- }, "*");
24
- pendingErrors = [];
16
+ suppressionTimer = undefined;
17
+ if (hadSuppressedErrors) {
18
+ window.parent?.postMessage({ type: "sandbox:hmrErrorsSuppressed" }, "*");
19
+ hadSuppressedErrors = false;
25
20
  }
26
21
  }, import.meta.env.VITE_HMR_ERROR_SUPPRESSION_DELAY ?? 10000);
27
22
  });
28
23
  import.meta.hot.on("vite:afterUpdate", () => {
29
24
  shouldPropagateErrors = true;
30
- if (suppressionTimer) {
31
- clearTimeout(suppressionTimer);
32
- suppressionTimer = null;
33
- }
34
- if (pendingErrors.length > 0) {
35
- window.parent?.postMessage({
36
- type: "sandbox:hmrErrorsRecovered",
37
- errorCount: pendingErrors.length,
38
- }, "*");
39
- pendingErrors = [];
25
+ clearTimeout(suppressionTimer);
26
+ suppressionTimer = undefined;
27
+ if (hadSuppressedErrors) {
28
+ window.parent?.postMessage({ type: "sandbox:hmrErrorsSuppressed" }, "*");
29
+ hadSuppressedErrors = false;
40
30
  }
41
31
  });
42
32
  import.meta.hot.on("vite:beforeFullReload", () => {
43
33
  shouldPropagateErrors = false;
44
- if (suppressionTimer) {
45
- clearTimeout(suppressionTimer);
46
- suppressionTimer = null;
47
- }
34
+ clearTimeout(suppressionTimer);
35
+ suppressionTimer = undefined;
48
36
  });
49
37
  }
50
38
  function onAppError({ title, details, componentName, originalError, }) {
@@ -52,12 +40,7 @@ function onAppError({ title, details, componentName, originalError, }) {
52
40
  return;
53
41
  }
54
42
  if (!shouldPropagateErrors) {
55
- pendingErrors.push({
56
- title: title.toString(),
57
- details: details?.toString(),
58
- componentName: componentName?.toString(),
59
- stack: originalError?.stack?.toString(),
60
- });
43
+ hadSuppressedErrors = true;
61
44
  return;
62
45
  }
63
46
  window.parent?.postMessage({
@@ -1 +1 @@
1
- {"version":3,"file":"unhandled-errors-handlers.js","sourceRoot":"","sources":["../../src/injections/unhandled-errors-handlers.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,MAAM,CAAC,mBAAmB,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAC;AAC3E,MAAM,CAAC,mBAAmB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAEvD,MAAM,CAAC,gBAAgB,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAC;AACxE,MAAM,CAAC,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC;AAEpD,IAAI,qBAAqB,GAAG,IAAI,CAAC;AACjC,IAAI,gBAAgB,GAAyC,IAAI,CAAC;AAClE,IAAI,aAAa,GAAkF,EAAE,CAAC;AAEtG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;IACpB,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC3C,qBAAqB,GAAG,KAAK,CAAC;QAC9B,aAAa,GA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AAU;IACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC;IACjC,IAAI,YAAY,GAAG,KAAK,CAAC,KAAK,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAI,YAAY,KAAK,MAAM,EAAE,CAAC;QAC5B,YAAY,GAAG,IAAI,CAAC;IACtB,CAAC;IAED,MAAM,GAAG,GAAG,YAAY;QACtB,CAAC,CAAC,MAAM,YAAY,KAAK,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,EAAE;QACjD,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC3B,UAAU,CAAC;QACT,KAAK,EAAE,GAAG;QACV,OAAO,EAAE,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE;QAC/B,aAAa,EAAE,YAAY;QAC3B,aAAa,EAAE,KAAK,CAAC,KAAK;KAC3B,CAAC,CAAC;AACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/vite-plugin",
3
- "version": "1.0.2-pr.54.4d161c8",
3
+ "version": "1.0.2-pr.54.58bdb49",
4
4
  "description": "The Vite plugin for base44 based applications",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -7,50 +7,38 @@ window.addEventListener("unhandledrejection", handleUnhandledRejection);
7
7
  window.addEventListener("error", handleWindowError);
8
8
 
9
9
  let shouldPropagateErrors = true;
10
- let suppressionTimer: ReturnType<typeof setTimeout> | null = null;
11
- let pendingErrors: Array<{title: string; details: string; componentName: string; stack: string}> = [];
10
+ let suppressionTimer: ReturnType<typeof setTimeout> | undefined;
11
+ let hadSuppressedErrors = false;
12
12
 
13
13
  if (import.meta.hot) {
14
14
  import.meta.hot.on("vite:beforeUpdate", () => {
15
15
  shouldPropagateErrors = false;
16
- pendingErrors = [];
16
+ hadSuppressedErrors = false;
17
17
 
18
- if (suppressionTimer) {
19
- clearTimeout(suppressionTimer);
20
- }
18
+ clearTimeout(suppressionTimer);
21
19
 
22
20
  suppressionTimer = setTimeout(() => {
23
21
  shouldPropagateErrors = true;
24
- suppressionTimer = null;
25
- if (pendingErrors.length > 0) {
26
- window.parent?.postMessage({
27
- type: "sandbox:hmrErrorsRecovered",
28
- errorCount: pendingErrors.length,
29
- }, "*");
30
- pendingErrors = [];
22
+ suppressionTimer = undefined;
23
+ if (hadSuppressedErrors) {
24
+ window.parent?.postMessage({ type: "sandbox:hmrErrorsSuppressed" }, "*");
25
+ hadSuppressedErrors = false;
31
26
  }
32
27
  }, import.meta.env.VITE_HMR_ERROR_SUPPRESSION_DELAY ?? 10000);
33
28
  });
34
29
  import.meta.hot.on("vite:afterUpdate", () => {
35
30
  shouldPropagateErrors = true;
36
- if (suppressionTimer) {
37
- clearTimeout(suppressionTimer);
38
- suppressionTimer = null;
39
- }
40
- if (pendingErrors.length > 0) {
41
- window.parent?.postMessage({
42
- type: "sandbox:hmrErrorsRecovered",
43
- errorCount: pendingErrors.length,
44
- }, "*");
45
- pendingErrors = [];
31
+ clearTimeout(suppressionTimer);
32
+ suppressionTimer = undefined;
33
+ if (hadSuppressedErrors) {
34
+ window.parent?.postMessage({ type: "sandbox:hmrErrorsSuppressed" }, "*");
35
+ hadSuppressedErrors = false;
46
36
  }
47
37
  });
48
38
  import.meta.hot.on("vite:beforeFullReload", () => {
49
39
  shouldPropagateErrors = false;
50
- if (suppressionTimer) {
51
- clearTimeout(suppressionTimer);
52
- suppressionTimer = null;
53
- }
40
+ clearTimeout(suppressionTimer);
41
+ suppressionTimer = undefined;
54
42
  });
55
43
  }
56
44
 
@@ -69,12 +57,7 @@ function onAppError({
69
57
  return;
70
58
  }
71
59
  if (!shouldPropagateErrors) {
72
- pendingErrors.push({
73
- title: title.toString(),
74
- details: details?.toString(),
75
- componentName: componentName?.toString(),
76
- stack: originalError?.stack?.toString(),
77
- });
60
+ hadSuppressedErrors = true;
78
61
  return;
79
62
  }
80
63
  window.parent?.postMessage(