mutts 1.0.8 → 1.0.9
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 +19 -2
- package/dist/browser.cjs +1030 -4406
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +310 -573
- package/dist/browser.esm.js +18 -24
- package/dist/browser.esm.js.map +1 -1
- package/dist/chunks/{async-browser-CA0jPWIi.cjs → async-browser-lvzLOCgk.cjs} +17 -24
- package/dist/chunks/async-browser-lvzLOCgk.cjs.map +1 -0
- package/dist/chunks/{async-core-UqHzvJ-S.cjs → async-core-CRLKP3l-.cjs} +8 -4
- package/dist/chunks/async-core-CRLKP3l-.cjs.map +1 -0
- package/dist/chunks/{async-node-BYHuGTni.cjs → async-node-C3DeIb0y.cjs} +5 -12
- package/dist/chunks/async-node-C3DeIb0y.cjs.map +1 -0
- package/dist/chunks/index-2vea86wD.esm.js +3011 -0
- package/dist/chunks/index-2vea86wD.esm.js.map +1 -0
- package/dist/chunks/index-CtA2AWl3.esm.js +4376 -0
- package/dist/chunks/index-CtA2AWl3.esm.js.map +1 -0
- package/dist/chunks/index-VTO-b2vR.cjs +4461 -0
- package/dist/chunks/index-VTO-b2vR.cjs.map +1 -0
- package/dist/{reactive → debug}/debug.d.ts +19 -8
- package/dist/debug/debug.d.ts.map +1 -0
- package/dist/debug/index.d.ts +4 -0
- package/dist/debug/index.d.ts.map +1 -0
- package/dist/debug/lineage-panel.d.ts +5 -0
- package/dist/debug/lineage-panel.d.ts.map +1 -0
- package/dist/debug/lineage.d.ts +79 -0
- package/dist/debug/lineage.d.ts.map +1 -0
- package/dist/debug.cjs +35 -0
- package/dist/debug.cjs.map +1 -0
- package/dist/debug.d.ts +209 -0
- package/dist/debug.esm.js +2 -0
- package/dist/debug.esm.js.map +1 -0
- package/dist/index.d.ts +1 -13
- package/dist/mutts.umd.js +1 -1
- package/dist/mutts.umd.js.map +1 -1
- package/dist/mutts.umd.min.js +1 -1
- package/dist/mutts.umd.min.js.map +1 -1
- package/dist/node.cjs +65 -63
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +2 -1
- package/dist/node.esm.js +5 -11
- package/dist/node.esm.js.map +1 -1
- package/dist/{async → src/async}/browser.d.ts.map +1 -1
- package/dist/{async → src/async}/index.d.ts +2 -1
- package/dist/src/async/index.d.ts.map +1 -0
- package/dist/{async → src/async}/node.d.ts.map +1 -1
- package/dist/src/decorator.d.ts.map +1 -0
- package/dist/src/destroyable.d.ts.map +1 -0
- package/dist/src/entry-browser.d.ts.map +1 -0
- package/dist/src/entry-node.d.ts.map +1 -0
- package/dist/src/eventful.d.ts +20 -0
- package/dist/src/eventful.d.ts.map +1 -0
- package/dist/src/flavored.d.ts +33 -0
- package/dist/src/flavored.d.ts.map +1 -0
- package/dist/src/index.d.ts +14 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/indexable.d.ts.map +1 -0
- package/dist/{introspection.d.ts → src/introspection.d.ts} +1 -1
- package/dist/src/introspection.d.ts.map +1 -0
- package/dist/src/iterableWeak.d.ts.map +1 -0
- package/dist/src/mixins.d.ts.map +1 -0
- package/dist/src/promiseChain.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/array.d.ts +9 -10
- package/dist/src/reactive/array.d.ts.map +1 -0
- package/dist/src/reactive/buffer.d.ts +120 -0
- package/dist/src/reactive/buffer.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/change.d.ts +2 -2
- package/dist/src/reactive/change.d.ts.map +1 -0
- package/dist/src/reactive/deep-touch.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/deep-watch-state.d.ts +3 -3
- package/dist/src/reactive/deep-watch-state.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/deep-watch.d.ts +2 -1
- package/dist/src/reactive/deep-watch.d.ts.map +1 -0
- package/dist/src/reactive/describe.d.ts +12 -0
- package/dist/src/reactive/describe.d.ts.map +1 -0
- package/dist/src/reactive/effect-context.d.ts +34 -0
- package/dist/src/reactive/effect-context.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/effects.d.ts +31 -18
- package/dist/src/reactive/effects.d.ts.map +1 -0
- package/dist/src/reactive/index.d.ts +19 -0
- package/dist/src/reactive/index.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/map.d.ts +0 -2
- package/dist/src/reactive/map.d.ts.map +1 -0
- package/dist/src/reactive/memoize.d.ts +28 -0
- package/dist/src/reactive/memoize.d.ts.map +1 -0
- package/dist/src/reactive/non-reactive-state.d.ts.map +1 -0
- package/dist/src/reactive/non-reactive.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/project.d.ts +1 -2
- package/dist/src/reactive/project.d.ts.map +1 -0
- package/dist/src/reactive/proxy-state.d.ts.map +1 -0
- package/dist/src/reactive/proxy.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/record.d.ts +2 -3
- package/dist/src/reactive/record.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/register.d.ts +61 -0
- package/dist/src/reactive/register.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/registry.d.ts +6 -5
- package/dist/src/reactive/registry.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/set.d.ts +0 -2
- package/dist/src/reactive/set.d.ts.map +1 -0
- package/dist/src/reactive/tracking.d.ts.map +1 -0
- package/dist/{reactive → src/reactive}/types.d.ts +69 -21
- package/dist/src/reactive/types.d.ts.map +1 -0
- package/dist/{reactive/interface.d.ts → src/reactive/watch.d.ts} +7 -23
- package/dist/src/reactive/watch.d.ts.map +1 -0
- package/dist/{std-decorators.d.ts → src/std-decorators.d.ts} +1 -6
- package/dist/src/std-decorators.d.ts.map +1 -0
- package/dist/src/utils.d.ts.map +1 -0
- package/dist/{zone.d.ts → src/zone.d.ts} +2 -2
- package/dist/src/zone.d.ts.map +1 -0
- package/dist/types-DaHFfhlN.d.ts +414 -0
- package/docs/ai/api-reference.md +1 -1
- package/docs/ai/manual.md +443 -17
- package/docs/events.md +57 -2
- package/docs/flavored.md +210 -0
- package/docs/reactive/advanced.md +2 -3
- package/docs/reactive/attend.md +143 -0
- package/docs/reactive/collections.md +55 -0
- package/docs/reactive/core.md +120 -4
- package/docs/reactive/debugging.md +8 -10
- package/docs/reactive/describe.md +85 -0
- package/docs/reactive/error-handling.md +121 -0
- package/docs/reactive/project.md +1 -1
- package/docs/reactive/scan.md +215 -0
- package/docs/reactive.md +2 -0
- package/docs/std-decorators.md +102 -51
- package/docs/zone.md +3 -7
- package/package.json +6 -1
- package/src/async/browser.ts +110 -106
- package/src/async/index.ts +15 -11
- package/src/async/node.ts +5 -17
- package/src/eventful.ts +82 -49
- package/src/flavored.ts +106 -0
- package/src/index.d.ts +12 -12
- package/src/index.ts +2 -2
- package/src/introspection.ts +1 -1
- package/src/reactive/array.ts +29 -36
- package/src/reactive/buffer.ts +187 -27
- package/src/reactive/change.ts +16 -23
- package/src/reactive/deep-touch.ts +19 -14
- package/src/reactive/deep-watch-state.ts +3 -3
- package/src/reactive/deep-watch.ts +7 -4
- package/src/reactive/describe.ts +39 -0
- package/src/reactive/effect-context.ts +69 -4
- package/src/reactive/effects.ts +445 -393
- package/src/reactive/index.ts +12 -15
- package/src/reactive/map.ts +9 -25
- package/src/reactive/memoize.ts +26 -3
- package/src/reactive/project.md +107 -0
- package/src/reactive/project.ts +48 -71
- package/src/reactive/proxy.ts +21 -3
- package/src/reactive/record.ts +30 -45
- package/src/reactive/register.ts +138 -19
- package/src/reactive/registry.ts +22 -9
- package/src/reactive/set.ts +8 -21
- package/src/reactive/tracking.ts +9 -12
- package/src/reactive/types.ts +104 -24
- package/src/reactive/{interface.ts → watch.ts} +29 -59
- package/src/std-decorators.ts +56 -17
- package/src/utils.ts +2 -3
- package/src/zone.ts +28 -24
- package/dist/async/index.d.ts.map +0 -1
- package/dist/chunks/async-browser-CA0jPWIi.cjs.map +0 -1
- package/dist/chunks/async-core-UqHzvJ-S.cjs.map +0 -1
- package/dist/chunks/async-node-BYHuGTni.cjs.map +0 -1
- package/dist/chunks/index-DhaOVusv.esm.js +0 -6411
- package/dist/chunks/index-DhaOVusv.esm.js.map +0 -1
- package/dist/decorator.d.ts.map +0 -1
- package/dist/destroyable.d.ts.map +0 -1
- package/dist/entry-browser.d.ts.map +0 -1
- package/dist/entry-node.d.ts.map +0 -1
- package/dist/eventful.d.ts +0 -18
- package/dist/eventful.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/indexable.d.ts.map +0 -1
- package/dist/introspection.d.ts.map +0 -1
- package/dist/iterableWeak.d.ts.map +0 -1
- package/dist/mixins.d.ts.map +0 -1
- package/dist/promiseChain.d.ts.map +0 -1
- package/dist/reactive/array.d.ts.map +0 -1
- package/dist/reactive/buffer.d.ts +0 -44
- package/dist/reactive/buffer.d.ts.map +0 -1
- package/dist/reactive/change.d.ts.map +0 -1
- package/dist/reactive/debug.d.ts.map +0 -1
- package/dist/reactive/deep-touch.d.ts.map +0 -1
- package/dist/reactive/deep-watch-state.d.ts.map +0 -1
- package/dist/reactive/deep-watch.d.ts.map +0 -1
- package/dist/reactive/effect-context.d.ts +0 -7
- package/dist/reactive/effect-context.d.ts.map +0 -1
- package/dist/reactive/effects.d.ts.map +0 -1
- package/dist/reactive/index.d.ts +0 -20
- package/dist/reactive/index.d.ts.map +0 -1
- package/dist/reactive/interface.d.ts.map +0 -1
- package/dist/reactive/map.d.ts.map +0 -1
- package/dist/reactive/memoize.d.ts +0 -5
- package/dist/reactive/memoize.d.ts.map +0 -1
- package/dist/reactive/non-reactive-state.d.ts.map +0 -1
- package/dist/reactive/non-reactive.d.ts.map +0 -1
- package/dist/reactive/project.d.ts.map +0 -1
- package/dist/reactive/proxy-state.d.ts.map +0 -1
- package/dist/reactive/proxy.d.ts.map +0 -1
- package/dist/reactive/record.d.ts.map +0 -1
- package/dist/reactive/register.d.ts.map +0 -1
- package/dist/reactive/registry.d.ts.map +0 -1
- package/dist/reactive/set.d.ts.map +0 -1
- package/dist/reactive/tracking.d.ts.map +0 -1
- package/dist/reactive/types.d.ts.map +0 -1
- package/dist/std-decorators.d.ts.map +0 -1
- package/dist/utils.d.ts.map +0 -1
- package/dist/zone.d.ts.map +0 -1
- package/src/reactive/debug.ts +0 -517
- /package/dist/{async → src/async}/browser.d.ts +0 -0
- /package/dist/{async → src/async}/node.d.ts +0 -0
- /package/dist/{decorator.d.ts → src/decorator.d.ts} +0 -0
- /package/dist/{destroyable.d.ts → src/destroyable.d.ts} +0 -0
- /package/dist/{entry-browser.d.ts → src/entry-browser.d.ts} +0 -0
- /package/dist/{entry-node.d.ts → src/entry-node.d.ts} +0 -0
- /package/dist/{indexable.d.ts → src/indexable.d.ts} +0 -0
- /package/dist/{iterableWeak.d.ts → src/iterableWeak.d.ts} +0 -0
- /package/dist/{mixins.d.ts → src/mixins.d.ts} +0 -0
- /package/dist/{promiseChain.d.ts → src/promiseChain.d.ts} +0 -0
- /package/dist/{reactive → src/reactive}/deep-touch.d.ts +0 -0
- /package/dist/{reactive → src/reactive}/non-reactive-state.d.ts +0 -0
- /package/dist/{reactive → src/reactive}/non-reactive.d.ts +0 -0
- /package/dist/{reactive → src/reactive}/proxy-state.d.ts +0 -0
- /package/dist/{reactive → src/reactive}/proxy.d.ts +0 -0
- /package/dist/{reactive → src/reactive}/tracking.d.ts +0 -0
- /package/dist/{utils.d.ts → src/utils.d.ts} +0 -0
|
@@ -4,7 +4,18 @@
|
|
|
4
4
|
* - Records cause → consequence edges with object/prop labels
|
|
5
5
|
* - Provides graph data for tooling (DevTools panel, etc.)
|
|
6
6
|
*/
|
|
7
|
-
import { type
|
|
7
|
+
import { type EffectCleanup, type EffectTrigger, type Evolution } from '../src/reactive/types';
|
|
8
|
+
/**
|
|
9
|
+
* Log an error with detailed context if error logging is enabled
|
|
10
|
+
*/
|
|
11
|
+
export declare function logError(error: Error, context: 'throw' | 'catch', effect?: any): void;
|
|
12
|
+
export declare const debugOptions: {
|
|
13
|
+
/**
|
|
14
|
+
* Whether DevTools are enabled
|
|
15
|
+
*/
|
|
16
|
+
readonly enabled: boolean;
|
|
17
|
+
logErrors: boolean;
|
|
18
|
+
};
|
|
8
19
|
export type NodeKind = 'effect' | 'external' | 'state';
|
|
9
20
|
export type EdgeKind = 'cause' | 'dependency' | 'trigger';
|
|
10
21
|
export interface EffectNode {
|
|
@@ -40,7 +51,7 @@ export interface ReactivityGraph {
|
|
|
40
51
|
/**
|
|
41
52
|
* Assign a debug-friendly name to an effect (shown in DevTools)
|
|
42
53
|
*/
|
|
43
|
-
export declare function setEffectName(effect:
|
|
54
|
+
export declare function setEffectName(effect: EffectTrigger | EffectCleanup, name: string): void;
|
|
44
55
|
/**
|
|
45
56
|
* Assign a debug-friendly name to a reactive object
|
|
46
57
|
*/
|
|
@@ -48,7 +59,7 @@ export declare function setObjectName(obj: object, name: string): void;
|
|
|
48
59
|
/**
|
|
49
60
|
* Register an effect so it appears in the DevTools graph
|
|
50
61
|
*/
|
|
51
|
-
export declare function registerEffectForDebug(effect:
|
|
62
|
+
export declare function registerEffectForDebug(effect: EffectTrigger): void;
|
|
52
63
|
/**
|
|
53
64
|
* Register a reactive object so it appears in the DevTools graph
|
|
54
65
|
*/
|
|
@@ -61,19 +72,19 @@ export declare function registerObjectForDebug(obj: object): void;
|
|
|
61
72
|
* @param prop - The property that changed
|
|
62
73
|
* @param evolution - The type of change (set/add/del/bunch)
|
|
63
74
|
*/
|
|
64
|
-
export declare function recordTriggerLink(source:
|
|
75
|
+
export declare function recordTriggerLink(source: EffectTrigger | undefined, target: EffectTrigger, obj: object, prop: any, evolution: Evolution): void;
|
|
65
76
|
/**
|
|
66
77
|
* Traces back the chain of triggers that led to a specific effect
|
|
67
78
|
* @param effect The effect to trace back
|
|
68
79
|
* @param limit Max depth
|
|
69
80
|
*/
|
|
70
|
-
export declare function getTriggerChain(effect:
|
|
81
|
+
export declare function getTriggerChain(effect: EffectTrigger, limit?: number): string[];
|
|
71
82
|
/**
|
|
72
83
|
* Builds a graph representing current reactive state (effects, objects, and trigger edges)
|
|
73
84
|
*/
|
|
74
85
|
export declare function buildReactivityGraph(): ReactivityGraph;
|
|
75
86
|
/**
|
|
76
|
-
* Enables the DevTools bridge and exposes the debug API on window.
|
|
87
|
+
* Enables the DevTools bridge and exposes the debug API on window/global.
|
|
77
88
|
* Call as early as possible in development builds.
|
|
78
89
|
*/
|
|
79
90
|
export declare function enableDevTools(): void;
|
|
@@ -90,11 +101,11 @@ export declare function getDependencyGraph(): {
|
|
|
90
101
|
/**
|
|
91
102
|
* Returns a list of effects that depend on the given object.
|
|
92
103
|
*/
|
|
93
|
-
export declare function getDependents(obj: object):
|
|
104
|
+
export declare function getDependents(obj: object): EffectTrigger[];
|
|
94
105
|
/**
|
|
95
106
|
* Returns a list of objects that the given effect depends on.
|
|
96
107
|
*/
|
|
97
|
-
export declare function getDependencies(effect:
|
|
108
|
+
export declare function getDependencies(effect: EffectTrigger): object[];
|
|
98
109
|
export interface MutationRecord {
|
|
99
110
|
id: number;
|
|
100
111
|
timestamp: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../debug/debug.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../debug/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,iBAAiB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage-panel.d.ts","sourceRoot":"","sources":["../../debug/lineage-panel.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,wBAAgB,gBAAgB,SA8J/B"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { type EffectTrigger } from '../src/reactive/types';
|
|
2
|
+
export declare const effectMarker: {
|
|
3
|
+
enter: string;
|
|
4
|
+
leave: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Structured stack frame
|
|
8
|
+
*/
|
|
9
|
+
export interface StackFrame {
|
|
10
|
+
functionName: string;
|
|
11
|
+
fileName: string;
|
|
12
|
+
lineNumber: number;
|
|
13
|
+
columnNumber: number;
|
|
14
|
+
raw: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Parses a single stack line into a structured frame.
|
|
18
|
+
* @param line - A line from Error.stack
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseStackLine(line: string): StackFrame | null;
|
|
21
|
+
/**
|
|
22
|
+
* Gets the current call stack
|
|
23
|
+
* @param skipFrames - Number of frames to skip
|
|
24
|
+
* @param error - Optional error to use as source of stack
|
|
25
|
+
*/
|
|
26
|
+
export declare function getStackFrame(error?: Error): StackFrame[];
|
|
27
|
+
/**
|
|
28
|
+
* Represents a segment in the effect lineage
|
|
29
|
+
*/
|
|
30
|
+
export interface LineageSegment {
|
|
31
|
+
effectName: string;
|
|
32
|
+
stack: StackFrame[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Traces the lineage of the current execution through nested effects
|
|
36
|
+
* @param effect - Starting effect (defaults to active effect)
|
|
37
|
+
*/
|
|
38
|
+
export declare function getLineage(effect?: EffectTrigger): LineageSegment[];
|
|
39
|
+
/**
|
|
40
|
+
* Formats lineage segments into a single stack-like string
|
|
41
|
+
* @param segments - Lineage segments
|
|
42
|
+
*/
|
|
43
|
+
export declare function formatLineage(segments: LineageSegment[]): string;
|
|
44
|
+
/**
|
|
45
|
+
* Logs lineage segments to console with grouping
|
|
46
|
+
* @param segments - Lineage segments
|
|
47
|
+
*/
|
|
48
|
+
export declare function nodeLineage(segments: LineageSegment[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* Legacy version of nodeLineage that returns a formatted string (useful for comparison or logs)
|
|
51
|
+
* @param segments - Lineage segments
|
|
52
|
+
* @deprecated TODO: remove me and all the code running around
|
|
53
|
+
*/
|
|
54
|
+
export declare function nodeLineageLegacy(segments: LineageSegment[]): string;
|
|
55
|
+
/**
|
|
56
|
+
* Captures and logs lineage to console
|
|
57
|
+
*/
|
|
58
|
+
export declare function captureNodeLineage(): void;
|
|
59
|
+
/**
|
|
60
|
+
* Custom formatter for Chrome DevTools to render lineage data nicely.
|
|
61
|
+
*/
|
|
62
|
+
export declare const lineageFormatter: {
|
|
63
|
+
header: (obj: any) => (string | {
|
|
64
|
+
style: string;
|
|
65
|
+
})[];
|
|
66
|
+
hasBody: (obj: any) => any;
|
|
67
|
+
body: (obj: any) => (string | {}[] | {
|
|
68
|
+
style: string;
|
|
69
|
+
})[];
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Wraps lineage data in a way that the Chrome Formatter can recognize.
|
|
73
|
+
*/
|
|
74
|
+
export declare function wrapLineageForDebug(segments: LineageSegment[]): {
|
|
75
|
+
__isLineage__: boolean;
|
|
76
|
+
segments: LineageSegment[];
|
|
77
|
+
toString: () => string;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=lineage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lineage.d.ts","sourceRoot":"","sources":["../../debug/lineage.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAE1D,eAAO,MAAM,YAAY;;;CAGxB,CAAA;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IACpB,GAAG,EAAE,MAAM,CAAA;CACX;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,IAAI,CAqB9D;AAID;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,QAAc,GAAG,UAAU,EAAE,CA8C/D;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,UAAU,EAAE,CAAA;CACnB;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,MAAM,CAAC,EAAE,aAAa,GAAG,cAAc,EAAE,CA8CnE;AAoCD;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CAYhE;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,IAAI,CAqC5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,MAAM,CA2CpE;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAEzC;AAED;;GAEG;AACH,eAAO,MAAM,gBAAgB;kBACd,GAAG;;;mBAeF,GAAG;gBACN,GAAG;;;CAsCf,CAAA;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,cAAc,EAAE;;;;EAM7D"}
|
package/dist/debug.cjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var debug = require('./chunks/index-VTO-b2vR.cjs');
|
|
4
|
+
require('./chunks/async-core-CRLKP3l-.cjs');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.buildReactivityGraph = debug.buildReactivityGraph;
|
|
9
|
+
exports.captureNodeLineage = debug.captureNodeLineage;
|
|
10
|
+
exports.debugOptions = debug.debugOptions;
|
|
11
|
+
exports.effectMarker = debug.effectMarker;
|
|
12
|
+
exports.enableDevTools = debug.enableDevTools;
|
|
13
|
+
exports.forceEnableGraphTracking = debug.forceEnableGraphTracking;
|
|
14
|
+
exports.formatLineage = debug.formatLineage;
|
|
15
|
+
exports.getDependencies = debug.getDependencies;
|
|
16
|
+
exports.getDependencyGraph = debug.getDependencyGraph;
|
|
17
|
+
exports.getDependents = debug.getDependents;
|
|
18
|
+
exports.getLineage = debug.getLineage;
|
|
19
|
+
exports.getMutationHistory = debug.getMutationHistory;
|
|
20
|
+
exports.getStackFrame = debug.getStackFrame;
|
|
21
|
+
exports.getTriggerChain = debug.getTriggerChain;
|
|
22
|
+
exports.isDevtoolsEnabled = debug.isDevtoolsEnabled;
|
|
23
|
+
exports.lineageFormatter = debug.lineageFormatter;
|
|
24
|
+
exports.logError = debug.logError;
|
|
25
|
+
exports.nodeLineage = debug.nodeLineage;
|
|
26
|
+
exports.nodeLineageLegacy = debug.nodeLineageLegacy;
|
|
27
|
+
exports.parseStackLine = debug.parseStackLine;
|
|
28
|
+
exports.recordTriggerLink = debug.recordTriggerLink;
|
|
29
|
+
exports.registerEffectForDebug = debug.registerEffectForDebug;
|
|
30
|
+
exports.registerObjectForDebug = debug.registerObjectForDebug;
|
|
31
|
+
exports.setEffectName = debug.setEffectName;
|
|
32
|
+
exports.setObjectName = debug.setObjectName;
|
|
33
|
+
exports.showLineagePanel = debug.showLineagePanel;
|
|
34
|
+
exports.wrapLineageForDebug = debug.wrapLineageForDebug;
|
|
35
|
+
//# sourceMappingURL=debug.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/debug.d.ts
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
import { E as EffectTrigger, a as Evolution, b as EffectCleanup } from './types-DaHFfhlN.js';
|
|
2
|
+
|
|
3
|
+
declare const effectMarker: {
|
|
4
|
+
enter: string;
|
|
5
|
+
leave: string;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Structured stack frame
|
|
9
|
+
*/
|
|
10
|
+
interface StackFrame {
|
|
11
|
+
functionName: string;
|
|
12
|
+
fileName: string;
|
|
13
|
+
lineNumber: number;
|
|
14
|
+
columnNumber: number;
|
|
15
|
+
raw: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parses a single stack line into a structured frame.
|
|
19
|
+
* @param line - A line from Error.stack
|
|
20
|
+
*/
|
|
21
|
+
declare function parseStackLine(line: string): StackFrame | null;
|
|
22
|
+
/**
|
|
23
|
+
* Gets the current call stack
|
|
24
|
+
* @param skipFrames - Number of frames to skip
|
|
25
|
+
* @param error - Optional error to use as source of stack
|
|
26
|
+
*/
|
|
27
|
+
declare function getStackFrame(error?: Error): StackFrame[];
|
|
28
|
+
/**
|
|
29
|
+
* Represents a segment in the effect lineage
|
|
30
|
+
*/
|
|
31
|
+
interface LineageSegment {
|
|
32
|
+
effectName: string;
|
|
33
|
+
stack: StackFrame[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Traces the lineage of the current execution through nested effects
|
|
37
|
+
* @param effect - Starting effect (defaults to active effect)
|
|
38
|
+
*/
|
|
39
|
+
declare function getLineage(effect?: EffectTrigger): LineageSegment[];
|
|
40
|
+
/**
|
|
41
|
+
* Formats lineage segments into a single stack-like string
|
|
42
|
+
* @param segments - Lineage segments
|
|
43
|
+
*/
|
|
44
|
+
declare function formatLineage(segments: LineageSegment[]): string;
|
|
45
|
+
/**
|
|
46
|
+
* Logs lineage segments to console with grouping
|
|
47
|
+
* @param segments - Lineage segments
|
|
48
|
+
*/
|
|
49
|
+
declare function nodeLineage(segments: LineageSegment[]): void;
|
|
50
|
+
/**
|
|
51
|
+
* Legacy version of nodeLineage that returns a formatted string (useful for comparison or logs)
|
|
52
|
+
* @param segments - Lineage segments
|
|
53
|
+
* @deprecated TODO: remove me and all the code running around
|
|
54
|
+
*/
|
|
55
|
+
declare function nodeLineageLegacy(segments: LineageSegment[]): string;
|
|
56
|
+
/**
|
|
57
|
+
* Captures and logs lineage to console
|
|
58
|
+
*/
|
|
59
|
+
declare function captureNodeLineage(): void;
|
|
60
|
+
/**
|
|
61
|
+
* Custom formatter for Chrome DevTools to render lineage data nicely.
|
|
62
|
+
*/
|
|
63
|
+
declare const lineageFormatter: {
|
|
64
|
+
header: (obj: any) => (string | {
|
|
65
|
+
style: string;
|
|
66
|
+
})[];
|
|
67
|
+
hasBody: (obj: any) => any;
|
|
68
|
+
body: (obj: any) => (string | {}[] | {
|
|
69
|
+
style: string;
|
|
70
|
+
})[];
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Wraps lineage data in a way that the Chrome Formatter can recognize.
|
|
74
|
+
*/
|
|
75
|
+
declare function wrapLineageForDebug(segments: LineageSegment[]): {
|
|
76
|
+
__isLineage__: boolean;
|
|
77
|
+
segments: LineageSegment[];
|
|
78
|
+
toString: () => string;
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Debug utilities for the reactivity system
|
|
83
|
+
* - Captures effect metadata (names, parent relationships)
|
|
84
|
+
* - Records cause → consequence edges with object/prop labels
|
|
85
|
+
* - Provides graph data for tooling (DevTools panel, etc.)
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Log an error with detailed context if error logging is enabled
|
|
90
|
+
*/
|
|
91
|
+
declare function logError(error: Error, context: 'throw' | 'catch', effect?: any): void;
|
|
92
|
+
declare const debugOptions: {
|
|
93
|
+
/**
|
|
94
|
+
* Whether DevTools are enabled
|
|
95
|
+
*/
|
|
96
|
+
readonly enabled: boolean;
|
|
97
|
+
logErrors: boolean;
|
|
98
|
+
};
|
|
99
|
+
type NodeKind = 'effect' | 'external' | 'state';
|
|
100
|
+
type EdgeKind = 'cause' | 'dependency' | 'trigger';
|
|
101
|
+
interface EffectNode {
|
|
102
|
+
id: string;
|
|
103
|
+
label: string;
|
|
104
|
+
type: NodeKind;
|
|
105
|
+
depth: number;
|
|
106
|
+
parentId?: string;
|
|
107
|
+
debugName?: string;
|
|
108
|
+
}
|
|
109
|
+
interface ObjectNode {
|
|
110
|
+
id: string;
|
|
111
|
+
label: string;
|
|
112
|
+
type: NodeKind;
|
|
113
|
+
debugName?: string;
|
|
114
|
+
}
|
|
115
|
+
interface GraphEdge {
|
|
116
|
+
id: string;
|
|
117
|
+
source: string;
|
|
118
|
+
target: string;
|
|
119
|
+
type: EdgeKind;
|
|
120
|
+
label: string;
|
|
121
|
+
count?: number;
|
|
122
|
+
}
|
|
123
|
+
interface ReactivityGraph {
|
|
124
|
+
nodes: Array<EffectNode | ObjectNode>;
|
|
125
|
+
edges: GraphEdge[];
|
|
126
|
+
meta: {
|
|
127
|
+
generatedAt: number;
|
|
128
|
+
devtoolsEnabled: boolean;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Assign a debug-friendly name to an effect (shown in DevTools)
|
|
133
|
+
*/
|
|
134
|
+
declare function setEffectName(effect: EffectTrigger | EffectCleanup, name: string): void;
|
|
135
|
+
/**
|
|
136
|
+
* Assign a debug-friendly name to a reactive object
|
|
137
|
+
*/
|
|
138
|
+
declare function setObjectName(obj: object, name: string): void;
|
|
139
|
+
/**
|
|
140
|
+
* Register an effect so it appears in the DevTools graph
|
|
141
|
+
*/
|
|
142
|
+
declare function registerEffectForDebug(effect: EffectTrigger): void;
|
|
143
|
+
/**
|
|
144
|
+
* Register a reactive object so it appears in the DevTools graph
|
|
145
|
+
*/
|
|
146
|
+
declare function registerObjectForDebug(obj: object): void;
|
|
147
|
+
/**
|
|
148
|
+
* Records a cause → consequence relationship between effects.
|
|
149
|
+
* @param source - The effect performing the write (undefined if external/user input)
|
|
150
|
+
* @param target - The effect that re-ran because of the write
|
|
151
|
+
* @param obj - The reactive object that changed
|
|
152
|
+
* @param prop - The property that changed
|
|
153
|
+
* @param evolution - The type of change (set/add/del/bunch)
|
|
154
|
+
*/
|
|
155
|
+
declare function recordTriggerLink(source: EffectTrigger | undefined, target: EffectTrigger, obj: object, prop: any, evolution: Evolution): void;
|
|
156
|
+
/**
|
|
157
|
+
* Traces back the chain of triggers that led to a specific effect
|
|
158
|
+
* @param effect The effect to trace back
|
|
159
|
+
* @param limit Max depth
|
|
160
|
+
*/
|
|
161
|
+
declare function getTriggerChain(effect: EffectTrigger, limit?: number): string[];
|
|
162
|
+
/**
|
|
163
|
+
* Builds a graph representing current reactive state (effects, objects, and trigger edges)
|
|
164
|
+
*/
|
|
165
|
+
declare function buildReactivityGraph(): ReactivityGraph;
|
|
166
|
+
/**
|
|
167
|
+
* Enables the DevTools bridge and exposes the debug API on window/global.
|
|
168
|
+
* Call as early as possible in development builds.
|
|
169
|
+
*/
|
|
170
|
+
declare function enableDevTools(): void;
|
|
171
|
+
declare function forceEnableGraphTracking(): void;
|
|
172
|
+
declare function isDevtoolsEnabled(): boolean;
|
|
173
|
+
/**
|
|
174
|
+
* Returns the raw dependency graph data structure.
|
|
175
|
+
* This is useful for programmatic analysis of the reactive system.
|
|
176
|
+
*/
|
|
177
|
+
declare function getDependencyGraph(): {
|
|
178
|
+
nodes: (EffectNode | ObjectNode)[];
|
|
179
|
+
edges: GraphEdge[];
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Returns a list of effects that depend on the given object.
|
|
183
|
+
*/
|
|
184
|
+
declare function getDependents(obj: object): EffectTrigger[];
|
|
185
|
+
/**
|
|
186
|
+
* Returns a list of objects that the given effect depends on.
|
|
187
|
+
*/
|
|
188
|
+
declare function getDependencies(effect: EffectTrigger): object[];
|
|
189
|
+
interface MutationRecord {
|
|
190
|
+
id: number;
|
|
191
|
+
timestamp: number;
|
|
192
|
+
source: string;
|
|
193
|
+
target: string;
|
|
194
|
+
objectName: string;
|
|
195
|
+
prop: string;
|
|
196
|
+
type: string;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Get the recent mutation history
|
|
200
|
+
*/
|
|
201
|
+
declare function getMutationHistory(): MutationRecord[];
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Displays a floating reactive panel in the browser showing the lineage of triggered effects.
|
|
205
|
+
*/
|
|
206
|
+
declare function showLineagePanel(): void;
|
|
207
|
+
|
|
208
|
+
export { buildReactivityGraph, captureNodeLineage, debugOptions, effectMarker, enableDevTools, forceEnableGraphTracking, formatLineage, getDependencies, getDependencyGraph, getDependents, getLineage, getMutationHistory, getStackFrame, getTriggerChain, isDevtoolsEnabled, lineageFormatter, logError, nodeLineage, nodeLineageLegacy, parseStackLine, recordTriggerLink, registerEffectForDebug, registerObjectForDebug, setEffectName, setObjectName, showLineagePanel, wrapLineageForDebug };
|
|
209
|
+
export type { EdgeKind, EffectNode, GraphEdge, LineageSegment, MutationRecord, NodeKind, ObjectNode, ReactivityGraph, StackFrame };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { au as buildReactivityGraph, av as captureNodeLineage, aw as debugOptions, ax as effectMarker, ay as enableDevTools, az as forceEnableGraphTracking, aA as formatLineage, aB as getDependencies, aC as getDependencyGraph, aD as getDependents, aE as getLineage, aF as getMutationHistory, aG as getStackFrame, aH as getTriggerChain, aI as isDevtoolsEnabled, aJ as lineageFormatter, aK as logError, aL as nodeLineage, aM as nodeLineageLegacy, aN as parseStackLine, aO as recordTriggerLink, aP as registerEffectForDebug, aQ as registerObjectForDebug, al as setEffectName, aR as setObjectName, aS as showLineagePanel, aT as wrapLineageForDebug } from './chunks/index-CtA2AWl3.esm.js';
|
|
2
|
+
//# sourceMappingURL=debug.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './destroyable';
|
|
3
|
-
export * from './eventful';
|
|
4
|
-
export * from './indexable';
|
|
5
|
-
export * from './iterableWeak';
|
|
6
|
-
export * from './mixins';
|
|
7
|
-
export * from './promiseChain';
|
|
8
|
-
export * from './reactive';
|
|
9
|
-
export * from './std-decorators';
|
|
10
|
-
export * from './utils';
|
|
11
|
-
export * from './zone';
|
|
12
|
-
export * from './async';
|
|
13
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export * from './src/index'
|