@xoong/core 0.0.42 → 0.0.43
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/package.json +1 -1
- package/src/signals.js +6 -3
- package/src/syntax.js +1 -1
package/package.json
CHANGED
package/src/signals.js
CHANGED
|
@@ -35,12 +35,15 @@ function flush() {
|
|
|
35
35
|
try {
|
|
36
36
|
// Effects may schedule more effects while running; loop until stable.
|
|
37
37
|
let guard = 0;
|
|
38
|
+
/** @type {Map<unknown, number>} */ const runs = new Map();
|
|
38
39
|
while (pending.size) {
|
|
39
|
-
|
|
40
|
+
const [next] = pending;
|
|
41
|
+
const n = (runs.get(next) ?? 0) + 1;
|
|
42
|
+
runs.set(next, n);
|
|
43
|
+
if (++guard > 10000 || n > 200) { // the same effect 200 times in one flush: it keeps triggering itself (or a pair of effects trigger each other)
|
|
40
44
|
pending.clear();
|
|
41
|
-
throw new Error(
|
|
45
|
+
throw new Error(`xoong: effect loop did not settle (an effect keeps writing a signal it reads): ${String(/** @type {any} */ (next).fn).replace(/\s+/g, ' ').slice(0, 200)}`);
|
|
42
46
|
}
|
|
43
|
-
const [next] = pending;
|
|
44
47
|
pending.delete(next);
|
|
45
48
|
// One broken effect must not stop the others from running.
|
|
46
49
|
try { next.run(); } catch (e) { errors.push(e); }
|
package/src/syntax.js
CHANGED
|
@@ -12,7 +12,7 @@ export const XO_ELEMENTS = ['xo-view'];
|
|
|
12
12
|
|
|
13
13
|
/** Attributes and elements that come with @xoong/ui (the admin set). */
|
|
14
14
|
export const XO_UI_ATTRIBUTES = ['xo-open', 'xo-close', 'xo-route', 'xo-layout', 'xo-outlet', 'xo-guard'];
|
|
15
|
-
export const XO_UI_ELEMENTS = ['xo-table', 'xo-form', 'xo-dialog', 'xo-toast', 'xo-router'];
|
|
15
|
+
export const XO_UI_ELEMENTS = ['xo-table', 'xo-form', 'xo-dialog', 'xo-toast', 'xo-router', 'xo-pager'];
|
|
16
16
|
|
|
17
17
|
/** Attributes and elements of @xoong/controls and @xoong/richtext. */
|
|
18
18
|
export const XO_CONTROL_ATTRIBUTES = ['xo-tab', 'xo-menu-trigger', 'xo-tooltip', 'xo-consent-open'];
|