sigmx 0.1.1 → 0.2.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 +10 -10
- package/dist/kernel/compile.d.ts +8 -9
- package/dist/kernel/compile.js +102 -67
- package/dist/kernel/compile.js.map +2 -2
- package/dist/kernel/contracts.d.ts +11 -5
- package/dist/kernel/index.d.ts +2 -2
- package/dist/kernel/index.js +5 -6
- package/dist/kernel/index.js.map +2 -2
- package/dist/kernel/precompile.d.ts +8 -10
- package/dist/kernel/precompile.js +25 -75
- package/dist/kernel/precompile.js.map +2 -2
- package/dist/kernel/precompiled.d.ts +7 -4
- package/dist/kernel/precompiled.js +5 -5
- package/dist/kernel/precompiled.js.map +2 -2
- package/dist/kernel/reactive.d.ts +8 -2
- package/dist/kernel/reactive.js +91 -62
- package/dist/kernel/reactive.js.map +3 -3
- package/dist/kernel/runtime.js +78 -68
- package/dist/kernel/runtime.js.map +3 -3
- package/dist/kernel/scan.d.ts +1 -1
- package/dist/kernel/scan.js +3 -3
- package/dist/kernel/scan.js.map +2 -2
- package/dist/kernel/state.d.ts +4 -3
- package/dist/kernel/state.js +91 -80
- package/dist/kernel/state.js.map +2 -2
- package/dist/kernel/strict-csp.d.ts +0 -5
- package/dist/kernel/strict-csp.js +2 -2
- package/dist/kernel/strict-csp.js.map +2 -2
- package/dist/lib/casing.d.ts +4 -1
- package/dist/lib/casing.js +8 -1
- package/dist/lib/casing.js.map +2 -2
- package/dist/lib/objects.d.ts +5 -3
- package/dist/lib/objects.js +10 -5
- package/dist/lib/objects.js.map +2 -2
- package/dist/lib/schedule.d.ts +3 -3
- package/dist/lib/schedule.js +12 -10
- package/dist/lib/schedule.js.map +2 -2
- package/dist/lib/sse.d.ts +10 -0
- package/dist/lib/sse.js +32 -29
- package/dist/lib/sse.js.map +2 -2
- package/dist/plugins/def.d.ts +5 -0
- package/dist/plugins/def.js +22 -0
- package/dist/plugins/def.js.map +7 -0
- package/dist/plugins/directives/attribute-sync.js +8 -12
- package/dist/plugins/directives/attribute-sync.js.map +2 -2
- package/dist/plugins/directives/boost.d.ts +1 -1
- package/dist/plugins/directives/boost.js +34 -31
- package/dist/plugins/directives/boost.js.map +2 -2
- package/dist/plugins/directives/busy-flag.js +13 -16
- package/dist/plugins/directives/busy-flag.js.map +2 -2
- package/dist/plugins/directives/class-toggle.js +17 -16
- package/dist/plugins/directives/class-toggle.js.map +2 -2
- package/dist/plugins/directives/cloak.js +2 -7
- package/dist/plugins/directives/cloak.js.map +2 -2
- package/dist/plugins/directives/collapse.js +36 -37
- package/dist/plugins/directives/collapse.js.map +2 -2
- package/dist/plugins/directives/declare.js +5 -8
- package/dist/plugins/directives/declare.js.map +2 -2
- package/dist/plugins/directives/derive.js +9 -18
- package/dist/plugins/directives/derive.js.map +2 -2
- package/dist/plugins/directives/element-ref.js +8 -8
- package/dist/plugins/directives/element-ref.js.map +2 -2
- package/dist/plugins/directives/event-listener.js +18 -26
- package/dist/plugins/directives/event-listener.js.map +2 -2
- package/dist/plugins/directives/frame-loop.js +9 -14
- package/dist/plugins/directives/frame-loop.js.map +2 -2
- package/dist/plugins/directives/html.js +6 -7
- package/dist/plugins/directives/html.js.map +2 -2
- package/dist/plugins/directives/inline-style.js +17 -20
- package/dist/plugins/directives/inline-style.js.map +2 -2
- package/dist/plugins/directives/mask.js +19 -23
- package/dist/plugins/directives/mask.js.map +2 -2
- package/dist/plugins/directives/media-query.d.ts +4 -1
- package/dist/plugins/directives/media-query.js +13 -13
- package/dist/plugins/directives/media-query.js.map +2 -2
- package/dist/plugins/directives/on-mount.js +4 -12
- package/dist/plugins/directives/on-mount.js.map +2 -2
- package/dist/plugins/directives/patch-listener.js +24 -19
- package/dist/plugins/directives/patch-listener.js.map +2 -2
- package/dist/plugins/directives/remove-me.js +7 -8
- package/dist/plugins/directives/remove-me.js.map +2 -2
- package/dist/plugins/directives/scroll-to.d.ts +4 -1
- package/dist/plugins/directives/scroll-to.js +8 -14
- package/dist/plugins/directives/scroll-to.js.map +2 -2
- package/dist/plugins/directives/size-watch.js +7 -12
- package/dist/plugins/directives/size-watch.js.map +2 -2
- package/dist/plugins/directives/state-dump.js +6 -10
- package/dist/plugins/directives/state-dump.js.map +2 -2
- package/dist/plugins/directives/storage-sync.js +13 -9
- package/dist/plugins/directives/storage-sync.js.map +2 -2
- package/dist/plugins/directives/teleport.js +8 -14
- package/dist/plugins/directives/teleport.js.map +2 -2
- package/dist/plugins/directives/text-content.js +6 -7
- package/dist/plugins/directives/text-content.js.map +2 -2
- package/dist/plugins/directives/timer.js +7 -13
- package/dist/plugins/directives/timer.js.map +2 -2
- package/dist/plugins/directives/transition.d.ts +1 -2
- package/dist/plugins/directives/transition.js +32 -34
- package/dist/plugins/directives/transition.js.map +2 -2
- package/dist/plugins/directives/tween.d.ts +2 -2
- package/dist/plugins/directives/tween.js +34 -50
- package/dist/plugins/directives/tween.js.map +2 -2
- package/dist/plugins/directives/two-way-bind.d.ts +1 -1
- package/dist/plugins/directives/two-way-bind.js +70 -97
- package/dist/plugins/directives/two-way-bind.js.map +2 -2
- package/dist/plugins/directives/url-params.js +35 -59
- package/dist/plugins/directives/url-params.js.map +3 -3
- package/dist/plugins/directives/url-replace.js +6 -7
- package/dist/plugins/directives/url-replace.js.map +2 -2
- package/dist/plugins/directives/validity.js +6 -9
- package/dist/plugins/directives/validity.js.map +2 -2
- package/dist/plugins/directives/viewport.js +18 -26
- package/dist/plugins/directives/viewport.js.map +2 -2
- package/dist/plugins/directives/visibility.js +9 -14
- package/dist/plugins/directives/visibility.js.map +2 -2
- package/dist/plugins/directives/watch.js +2 -8
- package/dist/plugins/directives/watch.js.map +2 -2
- package/dist/plugins/functions/bulk-set.js +7 -6
- package/dist/plugins/functions/bulk-set.js.map +2 -2
- package/dist/plugins/functions/bulk-toggle.js +7 -6
- package/dist/plugins/functions/bulk-toggle.js.map +2 -2
- package/dist/plugins/functions/confirm.js +2 -2
- package/dist/plugins/functions/confirm.js.map +2 -2
- package/dist/plugins/functions/copy-text.js +5 -5
- package/dist/plugins/functions/copy-text.js.map +2 -2
- package/dist/plugins/functions/dispatch.js +5 -5
- package/dist/plugins/functions/dispatch.js.map +2 -2
- package/dist/plugins/functions/locale-format.d.ts +4 -1
- package/dist/plugins/functions/locale-format.js +9 -16
- package/dist/plugins/functions/locale-format.js.map +2 -2
- package/dist/plugins/functions/range-map.js +6 -6
- package/dist/plugins/functions/range-map.js.map +2 -2
- package/dist/plugins/functions/request.d.ts +7 -3
- package/dist/plugins/functions/request.js +77 -86
- package/dist/plugins/functions/request.js.map +2 -2
- package/dist/plugins/functions/untracked-read.js +3 -2
- package/dist/plugins/functions/untracked-read.js.map +2 -2
- package/dist/plugins/functions/websocket.d.ts +3 -3
- package/dist/plugins/functions/websocket.js +13 -24
- package/dist/plugins/functions/websocket.js.map +2 -2
- package/dist/plugins/index.d.ts +0 -2
- package/dist/plugins/index.js +0 -4
- package/dist/plugins/index.js.map +2 -2
- package/dist/plugins/server-events/apply-elements.d.ts +1 -1
- package/dist/plugins/server-events/apply-elements.js +41 -43
- package/dist/plugins/server-events/apply-elements.js.map +2 -2
- package/dist/plugins/server-events/apply-state.js +9 -12
- package/dist/plugins/server-events/apply-state.js.map +2 -2
- package/dist/plugins/server-events/morph.js +46 -66
- package/dist/plugins/server-events/morph.js.map +3 -3
- package/dist/presets/all.js +0 -4
- package/dist/presets/all.js.map +2 -2
- package/dist/server.d.ts +10 -4
- package/dist/server.js +42 -14
- package/dist/server.js.map +2 -2
- package/dist/sigmx.standalone.js +1 -1
- package/dist/vite.js +17 -7
- package/dist/vite.js.map +2 -2
- package/package.json +4 -2
- package/dist/plugins/directives/transition-name.d.ts +0 -1
- package/dist/plugins/directives/transition-name.js +0 -11
- package/dist/plugins/directives/transition-name.js.map +0 -7
- package/dist/plugins/directives/trap.d.ts +0 -5
- package/dist/plugins/directives/trap.js +0 -54
- package/dist/plugins/directives/trap.js.map +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/kernel/precompile.ts"],
|
|
4
|
-
"sourcesContent": ["// Build-time expression compiler. Not for the browser: import it from a Vite/Astro plugin.\
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// Build-time expression compiler. Not for the browser: import it from a Vite/Astro plugin.\n// It emits the very same strict-mode bodies the runtime compiles, keyed by source text.\nimport { compileBody, functionCompiler } from './compile.js';\nimport { expressionKey } from './precompiled.js';\n\nexport type Extracted = { src: string; params: string[] };\n\nexport const generateTable = (items: Extracted[]): string => {\n const seen = new Set<string>();\n const lines: string[] = [];\n for (const { src, params } of items) {\n const key = expressionKey(src);\n if (seen.has(key)) continue;\n seen.add(key);\n let body: string;\n try {\n [body] = compileBody(functionCompiler, src, params); // also the syntax check\n } catch {\n continue; // leave it to the runtime fallback (or fail there)\n }\n lines.push(` ${JSON.stringify(key)}: function($, __a, ${params.join(', ')}) { ${body} },`);\n }\n return `export const table = {\\n${lines.join('\\n')}\\n}\\n`;\n};\n\nconst entities: Record<string, string> = {\n '"': '\"',\n ''': \"'\",\n ''': \"'\",\n '<': '<',\n '>': '>',\n '&': '&',\n};\nconst decode = (s: string) =>\n s.replace(/&(?:quot|apos|lt|gt|amp|#\\d+|#x[\\da-f]+);/gi, (m) =>\n m[1] === '#'\n ? String.fromCodePoint(\n Number.parseInt(\n m[2] === 'x' || m[2] === 'X' ? m.slice(3, -1) : m.slice(2, -1),\n m[2] === 'x' || m[2] === 'X' ? 16 : 10,\n ),\n )\n : (entities[m.toLowerCase()] ?? m),\n );\n\nexport type PluginMeta = { name: string; args?: string[]; literal?: boolean };\n\n/**\n * Find directive attributes with literal values in template source. Values must be plain quoted\n * strings; anything interpolated at render time is left to the runtime fallback. Plugins whose value\n * is a literal (mask, teleport, \u2026) are skipped unless the attribute carries `__dynamic`.\n */\nexport const extractExpressions = (\n source: string,\n plugins: PluginMeta[],\n prefixes: string[] = ['data-'],\n): Extracted[] => {\n const byName = new Map(plugins.map((p) => [p.name, p]));\n const out: Extracted[] = [];\n const re = /([a-z][\\w-]*(?::[^\\s=\"'<>]+)?(?:__[^\\s=\"'<>]+)*)=(?:\"([^\"]*)\"|'([^']*)')/g;\n for (const m of source.matchAll(re)) {\n const attr = m[1];\n const value = decode(m[2] ?? m[3] ?? '');\n const prefix = prefixes.find((p) => attr.startsWith(p));\n if (!prefix || !value.trim()) continue;\n const [head, ...mods] = attr.slice(prefix.length).split('__');\n const plugin = byName.get(head.split(':')[0]);\n if (!plugin || (plugin.literal && !mods.some((x) => x.split('.')[0] === 'dynamic'))) continue;\n out.push({ src: value, params: ['el', 'evt', ...(plugin.args ?? [])] });\n }\n return out;\n};\n\n/**\n * Keyed directive attributes whose key contains an uppercase letter. HTML lowercases attribute names,\n * so `data-bind:firstName` reaches the runtime as `firstname`: write `data-bind:first-name`.\n */\nexport const lintSource = (source: string, prefixes: string[] = ['data-']): string[] => {\n const out: string[] = [];\n for (const p of prefixes)\n for (const m of source.matchAll(new RegExp(`(?<![\\\\w-])(${p}[a-z-]+:[^\\\\s=\"'<>]*[A-Z][^\\\\s=\"'<>]*)`, 'g')))\n out.push(`${m[1]}: attribute names are lowercased by HTML; write the key in kebab-case`);\n return out;\n};\n"],
|
|
5
|
+
"mappings": "AAEA,SAAS,aAAa,wBAAwB;AAC9C,SAAS,qBAAqB;AAIvB,MAAM,gBAAgB,CAAC,UAA+B;AAC3D,QAAM,OAAO,oBAAI,IAAY;AAC7B,QAAM,QAAkB,CAAC;AACzB,aAAW,EAAE,KAAK,OAAO,KAAK,OAAO;AACnC,UAAM,MAAM,cAAc,GAAG;AAC7B,QAAI,KAAK,IAAI,GAAG,EAAG;AACnB,SAAK,IAAI,GAAG;AACZ,QAAI;AACJ,QAAI;AACF,OAAC,IAAI,IAAI,YAAY,kBAAkB,KAAK,MAAM;AAAA,IACpD,QAAQ;AACN;AAAA,IACF;AACA,UAAM,KAAK,KAAK,KAAK,UAAU,GAAG,CAAC,sB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CAAC,UAAW,OAAO,WAAW,CAAC,KAAK,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,EAAE,CAAC,MAAM,SAAS,EAAI;AACrF,QAAI,KAAK,EAAE,KAAK,OAAO,QAAQ,CAAC,MAAM,OAAO,GAAI,OAAO,QAAQ,CAAC,CAAE,EAAE,CAAC;AAAA,EACxE;AACA,SAAO;AACT;AAMO,MAAM,aAAa,CAAC,QAAgB,WAAqB,CAAC,OAAO,MAAgB;AACtF,QAAM,MAAgB,CAAC;AACvB,aAAW,KAAK;AACd,eAAW,KAAK,OAAO,SAAS,IAAI,OAAO,eAAe,CAAC,0CAA0C,GAAG,CAAC;AACvG,UAAI,KAAK,GAAG,EAAE,CAAC,CAAC,uEAAuE;AAC3F,SAAO;AACT;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import type { ExpressionCompiler } from './contracts.js';
|
|
2
2
|
export type ExpressionTable = Record<string, (root: any, actions: any, el: any, evt: any, ...args: any[]) => any>;
|
|
3
|
-
/** Key used by the build plugin and the lookup: returns flag, parameter names, trimmed source. */
|
|
4
|
-
export declare const expressionKey: (src: string, params: string[], returns: boolean) => string;
|
|
5
3
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* Key used by the build plugin and the lookup: the trimmed source text. Parameter names are not part
|
|
5
|
+
* of it, so a plugin gaining an argument (arguments are only ever appended) keeps old tables valid.
|
|
6
|
+
*/
|
|
7
|
+
export declare const expressionKey: (src: string) => string;
|
|
8
|
+
/**
|
|
9
|
+
* Look expressions up in a table generated at build time (see `sigmx/precompile`). Table functions
|
|
10
|
+
* take the root store proxy as `$`, exactly like runtime-compiled ones. Pass a `fallback` (for example
|
|
8
11
|
* `runtimeExpressions(functionCompiler)`) for markup assembled at runtime; omit it and the runtime
|
|
9
12
|
* compiler is not bundled at all.
|
|
10
13
|
*/
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
const expressionKey = (src
|
|
2
|
-
const precompiled = (table, fallback, onMiss) => (src, params
|
|
3
|
-
const fn = table[expressionKey(src
|
|
4
|
-
if (fn) return ((store, actions,
|
|
1
|
+
const expressionKey = (src) => src.trim();
|
|
2
|
+
const precompiled = (table, fallback, onMiss) => (src, params) => {
|
|
3
|
+
const fn = table[expressionKey(src)];
|
|
4
|
+
if (fn) return ((store, actions, ...rest) => fn(store.$, actions, ...rest));
|
|
5
5
|
onMiss?.(src);
|
|
6
6
|
if (!fallback) throw new Error(`expression not precompiled: ${src}`);
|
|
7
|
-
return fallback(src, params
|
|
7
|
+
return fallback(src, params);
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
expressionKey,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/kernel/precompiled.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Evaluator, ExpressionCompiler } from './contracts.js';\n\nexport type ExpressionTable = Record<string, (root: any, actions: any, el: any, evt: any, ...args: any[]) => any>;\n\n
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["import type { Evaluator, ExpressionCompiler } from './contracts.js';\n\nexport type ExpressionTable = Record<string, (root: any, actions: any, el: any, evt: any, ...args: any[]) => any>;\n\n/**\n * Key used by the build plugin and the lookup: the trimmed source text. Parameter names are not part\n * of it, so a plugin gaining an argument (arguments are only ever appended) keeps old tables valid.\n */\nexport const expressionKey = (src: string): string => src.trim();\n\n/**\n * Look expressions up in a table generated at build time (see `sigmx/precompile`). Table functions\n * take the root store proxy as `$`, exactly like runtime-compiled ones. Pass a `fallback` (for example\n * `runtimeExpressions(functionCompiler)`) for markup assembled at runtime; omit it and the runtime\n * compiler is not bundled at all.\n */\nexport const precompiled =\n (table: ExpressionTable, fallback?: ExpressionCompiler, onMiss?: (src: string) => void): ExpressionCompiler =>\n (src, params) => {\n const fn = table[expressionKey(src)];\n if (fn) return ((store, actions, ...rest) => fn(store.$, actions, ...rest)) as Evaluator;\n onMiss?.(src);\n if (!fallback) throw new Error(`expression not precompiled: ${src}`);\n return fallback(src, params);\n };\n"],
|
|
5
|
+
"mappings": "AAQO,MAAM,gBAAgB,CAAC,QAAwB,IAAI,KAAK;AAQxD,MAAM,cACX,CAAC,OAAwB,UAA+B,WACxD,CAAC,KAAK,WAAW;AACf,QAAM,KAAK,MAAM,cAAc,GAAG,CAAC;AACnC,MAAI,GAAI,SAAQ,CAAC,OAAO,YAAY,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,IAAI;AACzE,WAAS,GAAG;AACZ,MAAI,CAAC,SAAU,OAAM,IAAI,MAAM,+BAA+B,GAAG,EAAE;AACnE,SAAO,SAAS,KAAK,MAAM;AAC7B;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -14,15 +14,16 @@ export declare class Signal<T> {
|
|
|
14
14
|
bump(): void;
|
|
15
15
|
}
|
|
16
16
|
export declare class Computed<T> extends Signal<T> implements Tracker {
|
|
17
|
+
_fn: () => T;
|
|
17
18
|
_deps: Map<Signal<any>, number>;
|
|
18
19
|
_dirty: boolean;
|
|
19
|
-
_fn: () => T;
|
|
20
20
|
constructor(fn: () => T);
|
|
21
21
|
_refresh(): void;
|
|
22
22
|
get value(): T;
|
|
23
23
|
set value(_: T);
|
|
24
|
-
peek(): T;
|
|
25
24
|
_invalidate(): void;
|
|
25
|
+
/** Unsubscribe from every dependency; the computed is no longer recalculated. Public: the store calls it. */
|
|
26
|
+
dispose(): void;
|
|
26
27
|
}
|
|
27
28
|
export declare const signal: <T>(value: T) => Signal<T>;
|
|
28
29
|
export declare const computed: <T>(fn: () => T) => Computed<T>;
|
|
@@ -31,6 +32,11 @@ export declare const computed: <T>(fn: () => T) => Computed<T>;
|
|
|
31
32
|
* effect are disposed when the parent re-runs. Returns a disposer.
|
|
32
33
|
*/
|
|
33
34
|
export declare const effect: (fn: () => void, onError?: (e: unknown) => void) => (() => void);
|
|
35
|
+
/**
|
|
36
|
+
* Like `effect`, but never owned by the effect that happens to be running: for long-lived effects
|
|
37
|
+
* such as mounted attributes, which must not die when an unrelated parent effect re-runs.
|
|
38
|
+
*/
|
|
39
|
+
export declare const rootEffect: (fn: () => void, onError?: (e: unknown) => void) => (() => void);
|
|
34
40
|
export declare const batch: <R>(fn: () => R) => R;
|
|
35
41
|
export declare const untracked: <R>(fn: () => R) => R;
|
|
36
42
|
export declare const onSettled: (fn: () => void) => (() => void);
|
package/dist/kernel/reactive.js
CHANGED
|
@@ -5,16 +5,15 @@ let flushing = false;
|
|
|
5
5
|
const queue = /* @__PURE__ */ new Set();
|
|
6
6
|
const settled = /* @__PURE__ */ new Set();
|
|
7
7
|
class Signal {
|
|
8
|
-
|
|
9
|
-
e =
|
|
10
|
-
f = /* @__PURE__ */ new Set();
|
|
8
|
+
d = 0;
|
|
9
|
+
e = /* @__PURE__ */ new Set();
|
|
11
10
|
constructor(v) {
|
|
12
11
|
this.a = v;
|
|
13
12
|
}
|
|
14
13
|
get value() {
|
|
15
14
|
if (active) {
|
|
16
|
-
active.b.set(this, this.
|
|
17
|
-
this.
|
|
15
|
+
active.b.set(this, this.d);
|
|
16
|
+
this.e.add(active);
|
|
18
17
|
}
|
|
19
18
|
return this.a;
|
|
20
19
|
}
|
|
@@ -29,22 +28,15 @@ class Signal {
|
|
|
29
28
|
}
|
|
30
29
|
/** Notify subscribers without replacing the value (after mutating an array or object in place). */
|
|
31
30
|
bump() {
|
|
32
|
-
this.
|
|
33
|
-
for (const s of this.
|
|
34
|
-
|
|
31
|
+
this.d++;
|
|
32
|
+
for (const s of this.e) s.g();
|
|
33
|
+
depth || flush();
|
|
35
34
|
}
|
|
36
35
|
}
|
|
37
36
|
const release = (t) => {
|
|
38
|
-
for (const d of t.b.keys()) d.
|
|
37
|
+
for (const d of t.b.keys()) d.e.delete(t);
|
|
39
38
|
t.b.clear();
|
|
40
39
|
};
|
|
41
|
-
const stale = (t) => {
|
|
42
|
-
for (const [d, seen] of t.b) {
|
|
43
|
-
if (d instanceof Computed) d.i();
|
|
44
|
-
if (d.e !== seen) return true;
|
|
45
|
-
}
|
|
46
|
-
return false;
|
|
47
|
-
};
|
|
48
40
|
const capture = (t, fn) => {
|
|
49
41
|
release(t);
|
|
50
42
|
const prev = active;
|
|
@@ -55,82 +47,93 @@ const capture = (t, fn) => {
|
|
|
55
47
|
active = prev;
|
|
56
48
|
}
|
|
57
49
|
};
|
|
50
|
+
const stale = (t) => {
|
|
51
|
+
if (!t.b.size) return true;
|
|
52
|
+
for (const [d, seen] of t.b) {
|
|
53
|
+
if (d instanceof Computed) d.l();
|
|
54
|
+
if (d.d !== seen) return true;
|
|
55
|
+
}
|
|
56
|
+
return false;
|
|
57
|
+
};
|
|
58
58
|
class Computed extends Signal {
|
|
59
59
|
b = /* @__PURE__ */ new Map();
|
|
60
|
-
|
|
61
|
-
c;
|
|
60
|
+
c = true;
|
|
62
61
|
constructor(fn) {
|
|
63
62
|
super(void 0);
|
|
64
|
-
this.
|
|
63
|
+
this.h = fn;
|
|
65
64
|
}
|
|
66
|
-
|
|
67
|
-
if (!this.
|
|
68
|
-
this.
|
|
69
|
-
if (
|
|
70
|
-
const x = capture(this, this.
|
|
65
|
+
l() {
|
|
66
|
+
if (!this.c) return;
|
|
67
|
+
this.c = false;
|
|
68
|
+
if (!stale(this)) return;
|
|
69
|
+
const x = capture(this, this.h);
|
|
71
70
|
if (!Object.is(x, this.a)) {
|
|
72
71
|
this.a = x;
|
|
73
|
-
this.
|
|
72
|
+
this.d++;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
get value() {
|
|
77
|
-
this.
|
|
76
|
+
this.l();
|
|
78
77
|
return super.value;
|
|
79
78
|
}
|
|
80
79
|
set value(_) {
|
|
81
|
-
throw new Error("computed
|
|
82
|
-
}
|
|
83
|
-
peek() {
|
|
84
|
-
this.i();
|
|
85
|
-
return this.a;
|
|
80
|
+
throw new Error("computed is read-only");
|
|
86
81
|
}
|
|
87
|
-
|
|
88
|
-
if (!this.
|
|
89
|
-
this.
|
|
90
|
-
for (const s of this.
|
|
82
|
+
g() {
|
|
83
|
+
if (!this.c) {
|
|
84
|
+
this.c = true;
|
|
85
|
+
for (const s of this.e) s.g();
|
|
91
86
|
}
|
|
92
87
|
}
|
|
88
|
+
/** Unsubscribe from every dependency; the computed is no longer recalculated. Public: the store calls it. */
|
|
89
|
+
dispose() {
|
|
90
|
+
release(this);
|
|
91
|
+
this.c = false;
|
|
92
|
+
}
|
|
93
93
|
}
|
|
94
94
|
class Effect {
|
|
95
95
|
b = /* @__PURE__ */ new Map();
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
c;
|
|
100
|
-
l;
|
|
96
|
+
f = false;
|
|
97
|
+
i = false;
|
|
98
|
+
j = /* @__PURE__ */ new Set();
|
|
101
99
|
constructor(fn, onError) {
|
|
102
|
-
this.
|
|
103
|
-
this.
|
|
100
|
+
this.h = fn;
|
|
101
|
+
this.m = onError;
|
|
104
102
|
}
|
|
105
|
-
|
|
106
|
-
if (!this.
|
|
107
|
-
this.
|
|
103
|
+
g() {
|
|
104
|
+
if (!this.i && !this.f) {
|
|
105
|
+
this.f = true;
|
|
108
106
|
queue.add(this);
|
|
109
107
|
}
|
|
110
108
|
}
|
|
111
109
|
n() {
|
|
112
|
-
this.
|
|
113
|
-
if (this.
|
|
114
|
-
for (const c of this.d) c.m();
|
|
115
|
-
this.d.clear();
|
|
110
|
+
this.f = false;
|
|
111
|
+
if (this.i) return;
|
|
116
112
|
const prevOwner = owner;
|
|
117
113
|
owner = this;
|
|
118
114
|
depth++;
|
|
119
115
|
try {
|
|
120
|
-
|
|
116
|
+
if (stale(this)) {
|
|
117
|
+
this.o();
|
|
118
|
+
capture(this, this.h);
|
|
119
|
+
}
|
|
121
120
|
} catch (e) {
|
|
122
|
-
if (!this.
|
|
123
|
-
this.
|
|
121
|
+
if (!this.m) throw e;
|
|
122
|
+
this.m(e);
|
|
124
123
|
} finally {
|
|
125
124
|
depth--;
|
|
126
125
|
owner = prevOwner;
|
|
127
126
|
}
|
|
128
127
|
}
|
|
129
|
-
|
|
130
|
-
this.k
|
|
128
|
+
o() {
|
|
129
|
+
for (const c of this.j) c.k();
|
|
130
|
+
this.j.clear();
|
|
131
|
+
}
|
|
132
|
+
k() {
|
|
133
|
+
this.i = true;
|
|
131
134
|
release(this);
|
|
132
|
-
|
|
133
|
-
this.
|
|
135
|
+
if (active === this) active = void 0;
|
|
136
|
+
this.o();
|
|
134
137
|
queue.delete(this);
|
|
135
138
|
}
|
|
136
139
|
}
|
|
@@ -138,17 +141,31 @@ const signal = (value) => new Signal(value);
|
|
|
138
141
|
const computed = (fn) => new Computed(fn);
|
|
139
142
|
const effect = (fn, onError) => {
|
|
140
143
|
const e = new Effect(fn, onError);
|
|
141
|
-
owner?.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
144
|
+
owner?.j.add(e);
|
|
145
|
+
try {
|
|
146
|
+
e.n();
|
|
147
|
+
depth || flush();
|
|
148
|
+
} catch (err) {
|
|
149
|
+
e.k();
|
|
150
|
+
throw err;
|
|
151
|
+
}
|
|
152
|
+
return () => e.k();
|
|
153
|
+
};
|
|
154
|
+
const rootEffect = (fn, onError) => {
|
|
155
|
+
const prev = owner;
|
|
156
|
+
owner = void 0;
|
|
157
|
+
try {
|
|
158
|
+
return effect(fn, onError);
|
|
159
|
+
} finally {
|
|
160
|
+
owner = prev;
|
|
161
|
+
}
|
|
145
162
|
};
|
|
146
163
|
const batch = (fn) => {
|
|
147
164
|
depth++;
|
|
148
165
|
try {
|
|
149
166
|
return fn();
|
|
150
167
|
} finally {
|
|
151
|
-
|
|
168
|
+
--depth || flush();
|
|
152
169
|
}
|
|
153
170
|
};
|
|
154
171
|
const untracked = (fn) => {
|
|
@@ -167,21 +184,32 @@ const onSettled = (fn) => {
|
|
|
167
184
|
const flush = () => {
|
|
168
185
|
if (flushing || depth) return;
|
|
169
186
|
flushing = true;
|
|
187
|
+
let thrown;
|
|
188
|
+
let failed = false;
|
|
170
189
|
try {
|
|
171
190
|
let guard = 0;
|
|
172
191
|
while (queue.size) {
|
|
173
192
|
if (++guard > 1e5) {
|
|
193
|
+
for (const e2 of queue) e2.f = false;
|
|
174
194
|
queue.clear();
|
|
175
195
|
throw new Error("effect loop");
|
|
176
196
|
}
|
|
177
197
|
const e = queue.values().next().value;
|
|
178
198
|
queue.delete(e);
|
|
179
|
-
|
|
199
|
+
try {
|
|
200
|
+
e.n();
|
|
201
|
+
} catch (err) {
|
|
202
|
+
if (!failed) {
|
|
203
|
+
failed = true;
|
|
204
|
+
thrown = err;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
180
207
|
}
|
|
181
208
|
} finally {
|
|
182
209
|
flushing = false;
|
|
183
210
|
}
|
|
184
211
|
for (const fn of settled) fn();
|
|
212
|
+
if (failed) throw thrown;
|
|
185
213
|
};
|
|
186
214
|
export {
|
|
187
215
|
Computed,
|
|
@@ -191,6 +219,7 @@ export {
|
|
|
191
219
|
effect,
|
|
192
220
|
flush,
|
|
193
221
|
onSettled,
|
|
222
|
+
rootEffect,
|
|
194
223
|
signal,
|
|
195
224
|
untracked
|
|
196
225
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/kernel/reactive.ts"],
|
|
4
|
-
"sourcesContent": ["// Members prefixed with `_` are internal and get mangled by the build.\n\ninterface Tracker {\n _deps: Map<Signal<any>, number>;\n _invalidate(): void;\n}\n\nlet active: Tracker | undefined;\nlet owner: Effect | undefined;\nlet depth = 0;\nlet flushing = false;\nconst queue = new Set<Effect>();\nconst settled = new Set<() => void>();\n\nexport class Signal<T> {\n _v: T;\n _ver = 0;\n _subs = new Set<Tracker>();\n constructor(v: T) {\n this._v = v;\n }\n get value(): T {\n if (active) {\n active._deps.set(this, this._ver);\n this._subs.add(active);\n }\n return this._v;\n }\n set value(x: T) {\n if (!Object.is(x, this._v)) {\n this._v = x;\n this.bump();\n }\n }\n peek(): T {\n return this._v;\n }\n /** Notify subscribers without replacing the value (after mutating an array or object in place). */\n bump(): void {\n this._ver++;\n for (const s of this._subs) s._invalidate();\n
|
|
5
|
-
"mappings": "AAOA,IAAI;AACJ,IAAI;AACJ,IAAI,QAAQ;AACZ,IAAI,WAAW;AACf,MAAM,QAAQ,oBAAI,IAAY;AAC9B,MAAM,UAAU,oBAAI,IAAgB;AAE7B,MAAM,OAAU;AAAA,
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["// Members prefixed with `_` are internal and get mangled by the build.\n\ninterface Tracker {\n _deps: Map<Signal<any>, number>;\n _invalidate(): void;\n}\n\nlet active: Tracker | undefined;\nlet owner: Effect | undefined;\nlet depth = 0;\nlet flushing = false;\nconst queue = new Set<Effect>();\nconst settled = new Set<() => void>();\n\nexport class Signal<T> {\n declare _v: T;\n _ver = 0;\n _subs = new Set<Tracker>();\n constructor(v: T) {\n this._v = v;\n }\n get value(): T {\n if (active) {\n active._deps.set(this, this._ver);\n this._subs.add(active);\n }\n return this._v;\n }\n set value(x: T) {\n if (!Object.is(x, this._v)) {\n this._v = x;\n this.bump();\n }\n }\n peek(): T {\n return this._v;\n }\n /** Notify subscribers without replacing the value (after mutating an array or object in place). */\n bump(): void {\n this._ver++;\n for (const s of this._subs) s._invalidate();\n depth || flush();\n }\n}\n\n/** Drop `t`'s subscriptions. */\nconst release = (t: Tracker): void => {\n for (const d of t._deps.keys()) d._subs.delete(t);\n t._deps.clear();\n};\n\n/** Drop `t`'s subscriptions, then run `fn` with `t` as the active tracker so its reads re-subscribe. */\nconst capture = <R>(t: Tracker, fn: () => R): R => {\n release(t);\n const prev = active;\n active = t;\n try {\n return fn();\n } finally {\n active = prev;\n }\n};\n\n/** True when `t` has never run or any dependency's version moved since. Refreshes computeds on the way. */\nconst stale = (t: Tracker): boolean => {\n if (!t._deps.size) return true;\n for (const [d, seen] of t._deps) {\n if (d instanceof Computed) d._refresh();\n if (d._ver !== seen) return true;\n }\n return false;\n};\n\nexport class Computed<T> extends Signal<T> implements Tracker {\n declare _fn: () => T;\n _deps = new Map<Signal<any>, number>();\n _dirty = true;\n constructor(fn: () => T) {\n super(undefined as T);\n this._fn = fn;\n }\n _refresh(): void {\n if (!this._dirty) return;\n this._dirty = false;\n if (!stale(this)) return;\n const x = capture(this, this._fn);\n if (!Object.is(x, this._v)) {\n this._v = x;\n this._ver++;\n }\n }\n override get value(): T {\n this._refresh();\n return super.value;\n }\n override set value(_: T) {\n throw new Error('computed is read-only');\n }\n _invalidate(): void {\n if (!this._dirty) {\n this._dirty = true;\n for (const s of this._subs) s._invalidate();\n }\n }\n /** Unsubscribe from every dependency; the computed is no longer recalculated. Public: the store calls it. */\n dispose(): void {\n release(this);\n this._dirty = false;\n }\n}\n\nclass Effect implements Tracker {\n _deps = new Map<Signal<any>, number>();\n _queued = false;\n _dead = false;\n _kids = new Set<Effect>();\n declare _fn: () => void;\n declare _onError?: (e: unknown) => void;\n constructor(fn: () => void, onError?: (e: unknown) => void) {\n this._fn = fn;\n this._onError = onError;\n }\n _invalidate(): void {\n if (!this._dead && !this._queued) {\n this._queued = true;\n queue.add(this);\n }\n }\n _exec(): void {\n this._queued = false;\n if (this._dead) return;\n const prevOwner = owner;\n owner = this;\n depth++;\n try {\n // `stale` refreshes computeds, which may throw: that belongs to this effect's error handling.\n if (stale(this)) {\n this._drop();\n capture(this, this._fn);\n }\n } catch (e) {\n if (!this._onError) throw e;\n this._onError(e);\n } finally {\n depth--;\n owner = prevOwner;\n }\n }\n _drop(): void {\n for (const c of this._kids) c._dispose();\n this._kids.clear();\n }\n _dispose(): void {\n this._dead = true;\n release(this);\n if (active === this) active = undefined; // disposed from inside its own run: stop subscribing\n this._drop();\n queue.delete(this);\n }\n}\n\nexport const signal = <T>(value: T): Signal<T> => new Signal(value);\nexport const computed = <T>(fn: () => T): Computed<T> => new Computed(fn);\n\n/**\n * Run `fn` now and again whenever a signal it read changes. Effects created inside another\n * effect are disposed when the parent re-runs. Returns a disposer.\n */\nexport const effect = (fn: () => void, onError?: (e: unknown) => void): (() => void) => {\n const e = new Effect(fn, onError);\n owner?._kids.add(e);\n try {\n e._exec();\n depth || flush();\n } catch (err) {\n e._dispose(); // a first run that throws (or loops) without a handler leaves nothing subscribed\n throw err;\n }\n return () => e._dispose();\n};\n\n/**\n * Like `effect`, but never owned by the effect that happens to be running: for long-lived effects\n * such as mounted attributes, which must not die when an unrelated parent effect re-runs.\n */\nexport const rootEffect = (fn: () => void, onError?: (e: unknown) => void): (() => void) => {\n const prev = owner;\n owner = undefined;\n try {\n return effect(fn, onError);\n } finally {\n owner = prev;\n }\n};\n\nexport const batch = <R>(fn: () => R): R => {\n depth++;\n try {\n return fn();\n } finally {\n --depth || flush();\n }\n};\n\nexport const untracked = <R>(fn: () => R): R => {\n const prev = active;\n active = undefined;\n try {\n return fn();\n } finally {\n active = prev;\n }\n};\n\nexport const onSettled = (fn: () => void): (() => void) => {\n settled.add(fn);\n return () => settled.delete(fn);\n};\n\nexport const flush = (): void => {\n if (flushing || depth) return;\n flushing = true;\n let thrown: unknown;\n let failed = false;\n try {\n let guard = 0;\n while (queue.size) {\n if (++guard > 1e5) {\n // Leave nothing behind, or every later flush would trip the same guard; the effects stay\n // subscribed and run again on their next change.\n for (const e of queue) e._queued = false;\n queue.clear();\n throw new Error('effect loop');\n }\n const e = queue.values().next().value as Effect;\n queue.delete(e);\n try {\n e._exec();\n } catch (err) {\n // One throwing effect (no onError) must not starve the others; rethrow after the flush.\n if (!failed) {\n failed = true;\n thrown = err;\n }\n }\n }\n } finally {\n flushing = false;\n }\n for (const fn of settled) fn();\n if (failed) throw thrown;\n};\n"],
|
|
5
|
+
"mappings": "AAOA,IAAI;AACJ,IAAI;AACJ,IAAI,QAAQ;AACZ,IAAI,WAAW;AACf,MAAM,QAAQ,oBAAI,IAAY;AAC9B,MAAM,UAAU,oBAAI,IAAgB;AAE7B,MAAM,OAAU;AAAA,EAErBA,IAAO;AAAA,EACPC,IAAQ,oBAA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,MAAI;AACJ,MAAI,SAAS;AACb,MAAI;AACF,QAAI,QAAQ;AACZ,WAAO,MAAM,MAAM;AACjB,UAAI,EAAE,QAAQ,KAAK;AAGjB,mBAAWC,MAAK,MAAO,CAAAA,GAAEP,IAAU;AACnC,cAAM,MAAM;AACZ,cAAM,IAAI,MAAM,aAAa;AAAA,MAC/B;AACA,YAAM,IAAI,MAAM,OAAO,EAAE,KAAK,EAAE;AAChC,YAAM,OAAO,CAAC;AACd,UAAI;AACF,UAAEI,EAAM;AAAA,MACV,SAAS,KAAK;AAEZ,YAAI,CAAC,QAAQ;AACX,mBAAS;AACT,mBAAS;AAAA,QACX;AAAA,MACF;AAAA,IACF;AAAA,EACF,UAAE;AACA,eAAW;AAAA,EACb;AACA,aAAW,MAAM,QAAS,IAAG;AAC7B,MAAI,OAAQ,OAAM;AACpB;",
|
|
6
|
+
"names": ["_ver", "_subs", "_v", "_deps", "_invalidate", "_refresh", "_dirty", "_fn", "_queued", "_dead", "_kids", "_onError", "_exec", "_drop", "_dispose", "e"]
|
|
7
7
|
}
|