@assistant-ui/tap 0.5.11 → 0.5.13
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 +21 -364
- package/dist/core/ResourceFiber.d.ts +9 -5
- package/dist/core/ResourceFiber.d.ts.map +1 -1
- package/dist/core/ResourceFiber.js +47 -45
- package/dist/core/ResourceFiber.js.map +1 -1
- package/dist/core/context.d.ts +7 -5
- package/dist/core/context.d.ts.map +1 -1
- package/dist/core/context.js +16 -15
- package/dist/core/context.js.map +1 -1
- package/dist/core/createResourceRoot.d.ts +8 -4
- package/dist/core/createResourceRoot.d.ts.map +1 -1
- package/dist/core/createResourceRoot.js +25 -26
- package/dist/core/createResourceRoot.js.map +1 -1
- package/dist/core/helpers/callResourceFn.d.ts +1 -2
- package/dist/core/helpers/callResourceFn.js +15 -13
- package/dist/core/helpers/callResourceFn.js.map +1 -1
- package/dist/core/helpers/commit.d.ts +7 -3
- package/dist/core/helpers/commit.d.ts.map +1 -1
- package/dist/core/helpers/commit.js +33 -50
- package/dist/core/helpers/commit.js.map +1 -1
- package/dist/core/helpers/env.d.ts +4 -1
- package/dist/core/helpers/env.d.ts.map +1 -1
- package/dist/core/helpers/env.js +5 -2
- package/dist/core/helpers/env.js.map +1 -1
- package/dist/core/helpers/execution-context.d.ts +8 -4
- package/dist/core/helpers/execution-context.d.ts.map +1 -1
- package/dist/core/helpers/execution-context.js +22 -27
- package/dist/core/helpers/execution-context.js.map +1 -1
- package/dist/core/helpers/root.d.ts +10 -6
- package/dist/core/helpers/root.d.ts.map +1 -1
- package/dist/core/helpers/root.js +45 -48
- package/dist/core/helpers/root.js.map +1 -1
- package/dist/core/resource.d.ts +8 -4
- package/dist/core/resource.d.ts.map +1 -1
- package/dist/core/resource.js +13 -9
- package/dist/core/resource.js.map +1 -1
- package/dist/core/scheduler.d.ts +11 -9
- package/dist/core/scheduler.d.ts.map +1 -1
- package/dist/core/scheduler.js +70 -83
- package/dist/core/scheduler.js.map +1 -1
- package/dist/core/types.d.ts +56 -55
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +0 -2
- package/dist/core/withKey.d.ts +6 -2
- package/dist/core/withKey.d.ts.map +1 -1
- package/dist/core/withKey.js +9 -2
- package/dist/core/withKey.js.map +1 -1
- package/dist/hooks/tap-callback.d.ts +4 -1
- package/dist/hooks/tap-callback.d.ts.map +1 -1
- package/dist/hooks/tap-callback.js +6 -3
- package/dist/hooks/tap-callback.js.map +1 -1
- package/dist/hooks/tap-const.d.ts +4 -1
- package/dist/hooks/tap-const.d.ts.map +1 -1
- package/dist/hooks/tap-const.js +7 -3
- package/dist/hooks/tap-const.js.map +1 -1
- package/dist/hooks/tap-effect-event.d.ts +4 -1
- package/dist/hooks/tap-effect-event.d.ts.map +1 -1
- package/dist/hooks/tap-effect-event.js +31 -29
- package/dist/hooks/tap-effect-event.js.map +1 -1
- package/dist/hooks/tap-effect.d.ts +8 -5
- package/dist/hooks/tap-effect.d.ts.map +1 -1
- package/dist/hooks/tap-effect.js +35 -45
- package/dist/hooks/tap-effect.js.map +1 -1
- package/dist/hooks/tap-memo.d.ts +4 -1
- package/dist/hooks/tap-memo.d.ts.map +1 -1
- package/dist/hooks/tap-memo.js +17 -13
- package/dist/hooks/tap-memo.js.map +1 -1
- package/dist/hooks/tap-reducer.d.ts +7 -5
- package/dist/hooks/tap-reducer.d.ts.map +1 -1
- package/dist/hooks/tap-reducer.js +70 -76
- package/dist/hooks/tap-reducer.js.map +1 -1
- package/dist/hooks/tap-ref.d.ts +9 -6
- package/dist/hooks/tap-ref.d.ts.map +1 -1
- package/dist/hooks/tap-ref.js +7 -5
- package/dist/hooks/tap-ref.js.map +1 -1
- package/dist/hooks/tap-resource.d.ts +7 -3
- package/dist/hooks/tap-resource.d.ts.map +1 -1
- package/dist/hooks/tap-resource.js +31 -22
- package/dist/hooks/tap-resource.js.map +1 -1
- package/dist/hooks/tap-resources.d.ts +6 -2
- package/dist/hooks/tap-resources.d.ts.map +1 -1
- package/dist/hooks/tap-resources.js +74 -96
- package/dist/hooks/tap-resources.js.map +1 -1
- package/dist/hooks/tap-state.d.ts +7 -7
- package/dist/hooks/tap-state.d.ts.map +1 -1
- package/dist/hooks/tap-state.js +7 -5
- package/dist/hooks/tap-state.js.map +1 -1
- package/dist/hooks/utils/depsShallowEqual.d.ts +4 -1
- package/dist/hooks/utils/depsShallowEqual.d.ts.map +1 -1
- package/dist/hooks/utils/depsShallowEqual.js +8 -8
- package/dist/hooks/utils/depsShallowEqual.js.map +1 -1
- package/dist/hooks/utils/tapHook.d.ts +8 -4
- package/dist/hooks/utils/tapHook.d.ts.map +1 -1
- package/dist/hooks/utils/tapHook.js +17 -20
- package/dist/hooks/utils/tapHook.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +17 -23
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.js +2 -2
- package/dist/react/use-resource.d.ts +6 -2
- package/dist/react/use-resource.d.ts.map +1 -1
- package/dist/react/use-resource.js +41 -36
- package/dist/react/use-resource.js.map +1 -1
- package/dist/tapResourceRoot.d.ts +18 -14
- package/dist/tapResourceRoot.d.ts.map +1 -1
- package/dist/tapResourceRoot.js +68 -77
- package/dist/tapResourceRoot.js.map +1 -1
- package/package.json +8 -8
- package/src/__tests__/basic/tapEffect.basic.test.ts +4 -1
- package/src/__tests__/errors/errors.effect-errors.test.ts +3 -4
- package/src/__tests__/lifecycle/lifecycle.dependencies.test.ts +1 -1
- package/src/__tests__/strictmode/react-strictmode-behavior.test.tsx +1 -0
- package/src/__tests__/strictmode/react-strictmode-rerender-sources.test.tsx +17 -5
- package/src/__tests__/strictmode/tap-strictmode-rerender-sources.test.ts +1 -0
- package/src/core/types.ts +1 -2
- package/src/hooks/tap-callback.ts +1 -1
- package/src/hooks/tap-resource.ts +2 -2
- package/src/hooks/tap-resources.ts +1 -1
- package/src/react/use-resource.ts +2 -2
- package/dist/core/helpers/callResourceFn.d.ts.map +0 -1
- package/dist/core/types.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/index.js.map +0 -1
|
@@ -1,101 +1,79 @@
|
|
|
1
|
+
import { getCurrentResourceFiber } from "../core/helpers/execution-context.js";
|
|
1
2
|
import { tapEffect } from "./tap-effect.js";
|
|
3
|
+
import { tapRef } from "./tap-ref.js";
|
|
4
|
+
import { tapConst } from "./tap-const.js";
|
|
2
5
|
import { tapMemo } from "./tap-memo.js";
|
|
3
6
|
import { tapCallback } from "./tap-callback.js";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
tapEffect(() => {
|
|
73
|
-
return () => {
|
|
74
|
-
for (const key of fibers.keys()) {
|
|
75
|
-
const fiber = fibers.get(key).fiber;
|
|
76
|
-
unmountResourceFiber(fiber);
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}, []);
|
|
80
|
-
tapEffect(() => {
|
|
81
|
-
res; // as a performance optimization, we only run if the results have changed
|
|
82
|
-
for (const [key, state] of fibers.entries()) {
|
|
83
|
-
if (state.next === "delete") {
|
|
84
|
-
if (state.fiber.isMounted) {
|
|
85
|
-
unmountResourceFiber(state.fiber);
|
|
86
|
-
}
|
|
87
|
-
fibers.delete(key);
|
|
88
|
-
}
|
|
89
|
-
else if (Array.isArray(state.next)) {
|
|
90
|
-
unmountResourceFiber(state.fiber);
|
|
91
|
-
state.fiber = state.next[0];
|
|
92
|
-
commitResourceFiber(state.fiber, state.next[1]);
|
|
93
|
-
}
|
|
94
|
-
else {
|
|
95
|
-
commitResourceFiber(state.fiber, state.next);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}, [res]);
|
|
99
|
-
return res;
|
|
7
|
+
import { commitResourceFiber, createResourceFiber, renderResourceFiber, unmountResourceFiber } from "../core/ResourceFiber.js";
|
|
8
|
+
//#region src/hooks/tap-resources.ts
|
|
9
|
+
function tapResources(getElements, getElementsDeps) {
|
|
10
|
+
const versionRef = tapRef(0);
|
|
11
|
+
const version = versionRef.current;
|
|
12
|
+
const parentFiber = tapConst(getCurrentResourceFiber, []);
|
|
13
|
+
const markDirty = tapConst(() => () => {
|
|
14
|
+
versionRef.current++;
|
|
15
|
+
parentFiber.markDirty?.();
|
|
16
|
+
}, []);
|
|
17
|
+
const fibers = tapConst(() => /* @__PURE__ */ new Map(), []);
|
|
18
|
+
const getElementsMemo = getElementsDeps ? tapCallback(getElements, getElementsDeps) : getElements;
|
|
19
|
+
const res = tapMemo(() => {
|
|
20
|
+
const elementsArray = getElementsMemo();
|
|
21
|
+
const seenKeys = /* @__PURE__ */ new Set();
|
|
22
|
+
const results = [];
|
|
23
|
+
let newCount = 0;
|
|
24
|
+
for (let i = 0; i < elementsArray.length; i++) {
|
|
25
|
+
const element = elementsArray[i];
|
|
26
|
+
const elementKey = element.key;
|
|
27
|
+
if (elementKey === void 0) throw new Error(`tapResources did not provide a key for array at index ${i}`);
|
|
28
|
+
if (seenKeys.has(elementKey)) throw new Error(`Duplicate key ${elementKey} in tapResources`);
|
|
29
|
+
seenKeys.add(elementKey);
|
|
30
|
+
let state = fibers.get(elementKey);
|
|
31
|
+
if (!state) {
|
|
32
|
+
const fiber = createResourceFiber(element.type, parentFiber.root, markDirty);
|
|
33
|
+
const result = renderResourceFiber(fiber, element.props);
|
|
34
|
+
state = {
|
|
35
|
+
fiber,
|
|
36
|
+
next: result
|
|
37
|
+
};
|
|
38
|
+
newCount++;
|
|
39
|
+
fibers.set(elementKey, state);
|
|
40
|
+
results.push(result.output);
|
|
41
|
+
} else if (state.fiber.type !== element.type) {
|
|
42
|
+
const fiber = createResourceFiber(element.type, parentFiber.root, markDirty);
|
|
43
|
+
const result = renderResourceFiber(fiber, element.props);
|
|
44
|
+
state.next = [fiber, result];
|
|
45
|
+
results.push(result.output);
|
|
46
|
+
} else {
|
|
47
|
+
state.next = renderResourceFiber(state.fiber, element.props);
|
|
48
|
+
results.push(state.next.output);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
if (fibers.size > results.length - newCount) {
|
|
52
|
+
for (const key of fibers.keys()) if (!seenKeys.has(key)) fibers.get(key).next = "delete";
|
|
53
|
+
}
|
|
54
|
+
return results;
|
|
55
|
+
}, [getElementsMemo, version]);
|
|
56
|
+
tapEffect(() => {
|
|
57
|
+
return () => {
|
|
58
|
+
for (const key of fibers.keys()) {
|
|
59
|
+
const fiber = fibers.get(key).fiber;
|
|
60
|
+
unmountResourceFiber(fiber);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
}, []);
|
|
64
|
+
tapEffect(() => {
|
|
65
|
+
for (const [key, state] of fibers.entries()) if (state.next === "delete") {
|
|
66
|
+
if (state.fiber.isMounted) unmountResourceFiber(state.fiber);
|
|
67
|
+
fibers.delete(key);
|
|
68
|
+
} else if (Array.isArray(state.next)) {
|
|
69
|
+
unmountResourceFiber(state.fiber);
|
|
70
|
+
state.fiber = state.next[0];
|
|
71
|
+
commitResourceFiber(state.fiber, state.next[1]);
|
|
72
|
+
} else commitResourceFiber(state.fiber, state.next);
|
|
73
|
+
}, [res]);
|
|
74
|
+
return res;
|
|
100
75
|
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { tapResources };
|
|
78
|
+
|
|
101
79
|
//# sourceMappingURL=tap-resources.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tap-resources.js","
|
|
1
|
+
{"version":3,"file":"tap-resources.js","names":[],"sources":["../../src/hooks/tap-resources.ts"],"sourcesContent":["import type {\n ExtractResourceReturnType,\n RenderResult,\n ResourceElement,\n ResourceFiber,\n} from \"../core/types\";\nimport { tapEffect } from \"./tap-effect\";\nimport { tapMemo } from \"./tap-memo\";\nimport { tapCallback } from \"./tap-callback\";\nimport {\n createResourceFiber,\n unmountResourceFiber,\n renderResourceFiber,\n commitResourceFiber,\n} from \"../core/ResourceFiber\";\nimport { tapConst } from \"./tap-const\";\nimport { tapRef } from \"./tap-ref\";\nimport { getCurrentResourceFiber } from \"../core/helpers/execution-context\";\n\ntype FiberState = {\n fiber: ResourceFiber<unknown, unknown>;\n next:\n | RenderResult\n | [ResourceFiber<unknown, unknown>, RenderResult]\n | \"delete\";\n};\n\nexport function tapResources<E extends ResourceElement<any, any>>(\n getElements: () => readonly E[],\n getElementsDeps?: readonly unknown[],\n): ExtractResourceReturnType<E>[] {\n const versionRef = tapRef(0);\n const version = versionRef.current;\n\n const parentFiber = tapConst(getCurrentResourceFiber, []);\n const markDirty = tapConst(\n () => () => {\n versionRef.current++;\n parentFiber.markDirty?.();\n },\n [],\n );\n const fibers = tapConst(() => new Map<string | number, FiberState>(), []);\n\n const getElementsMemo = getElementsDeps\n ? // oxlint-disable-next-line tap-hooks/exhaustive-deps -- deps forwarded by caller\n tapCallback(getElements, getElementsDeps)\n : getElements;\n\n // Process each element\n\n const res = tapMemo(() => {\n void version;\n\n const elementsArray = getElementsMemo();\n const seenKeys = new Set<string | number>();\n const results: any[] = [];\n let newCount = 0;\n\n // Create/update fibers and render\n for (let i = 0; i < elementsArray.length; i++) {\n const element = elementsArray[i]!;\n\n const elementKey = element.key;\n if (elementKey === undefined) {\n throw new Error(\n `tapResources did not provide a key for array at index ${i}`,\n );\n }\n\n if (seenKeys.has(elementKey))\n throw new Error(`Duplicate key ${elementKey} in tapResources`);\n seenKeys.add(elementKey);\n\n let state = fibers.get(elementKey);\n if (!state) {\n const fiber = createResourceFiber(\n element.type,\n parentFiber.root,\n markDirty,\n );\n const result = renderResourceFiber(fiber, element.props);\n state = {\n fiber,\n next: result,\n };\n newCount++;\n fibers.set(elementKey, state);\n results.push(result.output);\n } else if (state.fiber.type !== element.type) {\n const fiber = createResourceFiber(\n element.type,\n parentFiber.root,\n markDirty,\n );\n const result = renderResourceFiber(fiber, element.props);\n state.next = [fiber, result];\n results.push(result.output);\n } else {\n state.next = renderResourceFiber(state.fiber, element.props);\n results.push(state.next.output);\n }\n }\n\n // Clean up removed fibers (only if there might be stale ones)\n if (fibers.size > results.length - newCount) {\n for (const key of fibers.keys()) {\n if (!seenKeys.has(key)) {\n fibers.get(key)!.next = \"delete\";\n }\n }\n }\n\n return results;\n }, [getElementsMemo, version]);\n\n // Cleanup on unmount\n tapEffect(() => {\n return () => {\n for (const key of fibers.keys()) {\n const fiber = fibers.get(key)!.fiber;\n unmountResourceFiber(fiber);\n }\n };\n }, []);\n\n tapEffect(() => {\n res; // as a performance optimization, we only run if the results have changed\n\n for (const [key, state] of fibers.entries()) {\n if (state.next === \"delete\") {\n if (state.fiber.isMounted) {\n unmountResourceFiber(state.fiber);\n }\n\n fibers.delete(key);\n } else if (Array.isArray(state.next)) {\n unmountResourceFiber(state.fiber);\n state.fiber = state.next[0];\n commitResourceFiber(state.fiber, state.next[1]);\n } else {\n commitResourceFiber(state.fiber, state.next);\n }\n }\n }, [res]);\n\n return res;\n}\n"],"mappings":";;;;;;;;AA2BA,SAAgB,aACd,aACA,iBACgC;CAChC,MAAM,aAAa,OAAO,CAAC;CAC3B,MAAM,UAAU,WAAW;CAE3B,MAAM,cAAc,SAAS,yBAAyB,CAAC,CAAC;CACxD,MAAM,YAAY,qBACJ;EACV,WAAW;EACX,YAAY,YAAY;CAC1B,GACA,CAAC,CACH;CACA,MAAM,SAAS,+BAAe,IAAI,IAAiC,GAAG,CAAC,CAAC;CAExE,MAAM,kBAAkB,kBAEpB,YAAY,aAAa,eAAe,IACxC;CAIJ,MAAM,MAAM,cAAc;EAGxB,MAAM,gBAAgB,gBAAgB;EACtC,MAAM,2BAAW,IAAI,IAAqB;EAC1C,MAAM,UAAiB,CAAC;EACxB,IAAI,WAAW;EAGf,KAAK,IAAI,IAAI,GAAG,IAAI,cAAc,QAAQ,KAAK;GAC7C,MAAM,UAAU,cAAc;GAE9B,MAAM,aAAa,QAAQ;GAC3B,IAAI,eAAe,KAAA,GACjB,MAAM,IAAI,MACR,yDAAyD,GAC3D;GAGF,IAAI,SAAS,IAAI,UAAU,GACzB,MAAM,IAAI,MAAM,iBAAiB,WAAW,iBAAiB;GAC/D,SAAS,IAAI,UAAU;GAEvB,IAAI,QAAQ,OAAO,IAAI,UAAU;GACjC,IAAI,CAAC,OAAO;IACV,MAAM,QAAQ,oBACZ,QAAQ,MACR,YAAY,MACZ,SACF;IACA,MAAM,SAAS,oBAAoB,OAAO,QAAQ,KAAK;IACvD,QAAQ;KACN;KACA,MAAM;IACR;IACA;IACA,OAAO,IAAI,YAAY,KAAK;IAC5B,QAAQ,KAAK,OAAO,MAAM;GAC5B,OAAO,IAAI,MAAM,MAAM,SAAS,QAAQ,MAAM;IAC5C,MAAM,QAAQ,oBACZ,QAAQ,MACR,YAAY,MACZ,SACF;IACA,MAAM,SAAS,oBAAoB,OAAO,QAAQ,KAAK;IACvD,MAAM,OAAO,CAAC,OAAO,MAAM;IAC3B,QAAQ,KAAK,OAAO,MAAM;GAC5B,OAAO;IACL,MAAM,OAAO,oBAAoB,MAAM,OAAO,QAAQ,KAAK;IAC3D,QAAQ,KAAK,MAAM,KAAK,MAAM;GAChC;EACF;EAGA,IAAI,OAAO,OAAO,QAAQ,SAAS;QAC5B,MAAM,OAAO,OAAO,KAAK,GAC5B,IAAI,CAAC,SAAS,IAAI,GAAG,GACnB,OAAO,IAAI,GAAG,EAAG,OAAO;EAAA;EAK9B,OAAO;CACT,GAAG,CAAC,iBAAiB,OAAO,CAAC;CAG7B,gBAAgB;EACd,aAAa;GACX,KAAK,MAAM,OAAO,OAAO,KAAK,GAAG;IAC/B,MAAM,QAAQ,OAAO,IAAI,GAAG,EAAG;IAC/B,qBAAqB,KAAK;GAC5B;EACF;CACF,GAAG,CAAC,CAAC;CAEL,gBAAgB;EAGd,KAAK,MAAM,CAAC,KAAK,UAAU,OAAO,QAAQ,GACxC,IAAI,MAAM,SAAS,UAAU;GAC3B,IAAI,MAAM,MAAM,WACd,qBAAqB,MAAM,KAAK;GAGlC,OAAO,OAAO,GAAG;EACnB,OAAO,IAAI,MAAM,QAAQ,MAAM,IAAI,GAAG;GACpC,qBAAqB,MAAM,KAAK;GAChC,MAAM,QAAQ,MAAM,KAAK;GACzB,oBAAoB,MAAM,OAAO,MAAM,KAAK,EAAE;EAChD,OACE,oBAAoB,MAAM,OAAO,MAAM,IAAI;CAGjD,GAAG,CAAC,GAAG,CAAC;CAER,OAAO;AACT"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
//#region src/hooks/tap-state.d.ts
|
|
2
|
+
declare namespace tapState {
|
|
3
|
+
type StateUpdater<S> = S | ((prev: S) => S);
|
|
3
4
|
}
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
export declare function tapState<S>(initial: S | (() => S)): [S, (updater: tapState.StateUpdater<S>) => void];
|
|
5
|
+
declare function tapState<S = undefined>(): [S | undefined, (updater: tapState.StateUpdater<S>) => void];
|
|
6
|
+
declare function tapState<S>(initial: S | (() => S)): [S, (updater: tapState.StateUpdater<S>) => void];
|
|
7
|
+
//#endregion
|
|
8
|
+
export { tapState };
|
|
9
9
|
//# sourceMappingURL=tap-state.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tap-state.d.ts","
|
|
1
|
+
{"version":3,"file":"tap-state.d.ts","names":[],"sources":["../../src/hooks/tap-state.ts"],"mappings":";kBAEiB,QAAA;EAAA,KACH,YAAA,MAAkB,CAAA,KAAM,IAAA,EAAM,CAAA,KAAM,CAAA;AAAA;AAAA,iBAclC,QAAA,eAAA,CAAA,IACd,CAAA,eACC,OAAA,EAAS,QAAA,CAAS,YAAA,CAAa,CAAA;AAAA,iBAElB,QAAA,GAAA,CACd,OAAA,EAAS,CAAA,UAAW,CAAA,KAClB,CAAA,GAAI,OAAA,EAAS,QAAA,CAAS,YAAA,CAAa,CAAA"}
|
package/dist/hooks/tap-state.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { tapReducer } from "./tap-reducer.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
: action;
|
|
2
|
+
//#region src/hooks/tap-state.ts
|
|
3
|
+
const stateReducer = (state, action) => typeof action === "function" ? action(state) : action;
|
|
5
4
|
const stateInit = (initial) => typeof initial === "function" ? initial() : initial;
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
function tapState(initial) {
|
|
6
|
+
return tapReducer(stateReducer, initial, stateInit);
|
|
8
7
|
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { tapState };
|
|
10
|
+
|
|
9
11
|
//# sourceMappingURL=tap-state.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tap-state.js","
|
|
1
|
+
{"version":3,"file":"tap-state.js","names":[],"sources":["../../src/hooks/tap-state.ts"],"sourcesContent":["import { tapReducer } from \"./tap-reducer\";\n\nexport namespace tapState {\n export type StateUpdater<S> = S | ((prev: S) => S);\n}\n\nconst stateReducer = <S>(\n state: S | undefined,\n action: tapState.StateUpdater<S>,\n): S =>\n typeof action === \"function\"\n ? (action as (prev: S | undefined) => S)(state)\n : action;\n\nconst stateInit = <S>(initial: S | (() => S)): S =>\n typeof initial === \"function\" ? (initial as () => S)() : initial;\n\nexport function tapState<S = undefined>(): [\n S | undefined,\n (updater: tapState.StateUpdater<S>) => void,\n];\nexport function tapState<S>(\n initial: S | (() => S),\n): [S, (updater: tapState.StateUpdater<S>) => void];\nexport function tapState<S>(\n initial?: S | (() => S),\n): [S | undefined, (updater: tapState.StateUpdater<S>) => void] {\n return tapReducer(stateReducer, initial, stateInit);\n}\n"],"mappings":";;AAMA,MAAM,gBACJ,OACA,WAEA,OAAO,WAAW,aACb,OAAsC,KAAK,IAC5C;AAEN,MAAM,aAAgB,YACpB,OAAO,YAAY,aAAc,QAAoB,IAAI;AAS3D,SAAgB,SACd,SAC8D;CAC9D,OAAO,WAAW,cAAc,SAAS,SAAS;AACpD"}
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/hooks/utils/depsShallowEqual.d.ts
|
|
2
|
+
declare const depsShallowEqual: (a: readonly unknown[], b: readonly unknown[]) => boolean;
|
|
3
|
+
//#endregion
|
|
4
|
+
export { depsShallowEqual };
|
|
2
5
|
//# sourceMappingURL=depsShallowEqual.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depsShallowEqual.d.ts","
|
|
1
|
+
{"version":3,"file":"depsShallowEqual.d.ts","names":[],"sources":["../../../src/hooks/utils/depsShallowEqual.ts"],"mappings":";cAAa,gBAAA,GACX,CAAA,sBACA,CAAqB"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return false;
|
|
7
|
-
}
|
|
8
|
-
return true;
|
|
1
|
+
//#region src/hooks/utils/depsShallowEqual.ts
|
|
2
|
+
const depsShallowEqual = (a, b) => {
|
|
3
|
+
if (a.length !== b.length) return false;
|
|
4
|
+
for (let i = 0; i < a.length; i++) if (!Object.is(a[i], b[i])) return false;
|
|
5
|
+
return true;
|
|
9
6
|
};
|
|
7
|
+
//#endregion
|
|
8
|
+
export { depsShallowEqual };
|
|
9
|
+
|
|
10
10
|
//# sourceMappingURL=depsShallowEqual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depsShallowEqual.js","
|
|
1
|
+
{"version":3,"file":"depsShallowEqual.js","names":[],"sources":["../../../src/hooks/utils/depsShallowEqual.ts"],"sourcesContent":["export const depsShallowEqual = (\n a: readonly unknown[],\n b: readonly unknown[],\n) => {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n if (!Object.is(a[i], b[i])) return false;\n }\n return true;\n};\n"],"mappings":";AAAA,MAAa,oBACX,GACA,MACG;CACH,IAAI,EAAE,WAAW,EAAE,QAAQ,OAAO;CAClC,KAAK,IAAI,IAAI,GAAG,IAAI,EAAE,QAAQ,KAC5B,IAAI,CAAC,OAAO,GAAG,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO;CAErC,OAAO;AACT"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Cell } from "../../core/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/hooks/utils/tapHook.d.ts
|
|
4
|
+
declare const tapHook: <T extends Cell["type"]>(type: T, init: () => Cell) => Cell & {
|
|
5
|
+
type: T;
|
|
4
6
|
};
|
|
5
|
-
|
|
7
|
+
declare const registerRenderMountTask: (task: () => void) => void;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { registerRenderMountTask, tapHook };
|
|
6
10
|
//# sourceMappingURL=tapHook.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tapHook.d.ts","
|
|
1
|
+
{"version":3,"file":"tapHook.d.ts","names":[],"sources":["../../../src/hooks/utils/tapHook.ts"],"mappings":";;;cAGa,OAAA,aAAqB,IAAA,UAChC,IAAA,EAAM,CAAA,EACN,IAAA,QAAY,IAAA,KACX,IAAA;EAAS,IAAA,EAAM,CAAA;AAAA;AAAA,cAyBL,uBAAA,GAA2B,IAAgB"}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
1
|
import { getCurrentResourceFiber } from "../../core/helpers/execution-context.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
if (cell.type !== type) {
|
|
16
|
-
throw new Error("Hook order changed between renders");
|
|
17
|
-
}
|
|
18
|
-
return cell;
|
|
2
|
+
//#region src/hooks/utils/tapHook.ts
|
|
3
|
+
const tapHook = (type, init) => {
|
|
4
|
+
const fiber = getCurrentResourceFiber();
|
|
5
|
+
const index = fiber.currentIndex++;
|
|
6
|
+
if (!fiber.isFirstRender && index >= fiber.cells.length) throw new Error("Rendered more hooks than during the previous render. Hooks must be called in the exact same order in every render.");
|
|
7
|
+
let cell = fiber.cells[index];
|
|
8
|
+
if (!cell) {
|
|
9
|
+
cell = init();
|
|
10
|
+
fiber.cells[index] = cell;
|
|
11
|
+
}
|
|
12
|
+
if (cell.type !== type) throw new Error("Hook order changed between renders");
|
|
13
|
+
return cell;
|
|
19
14
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
fiber.renderContext.effectTasks.push(task);
|
|
15
|
+
const registerRenderMountTask = (task) => {
|
|
16
|
+
getCurrentResourceFiber().renderContext.effectTasks.push(task);
|
|
23
17
|
};
|
|
18
|
+
//#endregion
|
|
19
|
+
export { registerRenderMountTask, tapHook };
|
|
20
|
+
|
|
24
21
|
//# sourceMappingURL=tapHook.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tapHook.js","
|
|
1
|
+
{"version":3,"file":"tapHook.js","names":[],"sources":["../../../src/hooks/utils/tapHook.ts"],"sourcesContent":["import { getCurrentResourceFiber } from \"../../core/helpers/execution-context\";\nimport type { Cell } from \"../../core/types\";\n\nexport const tapHook = <T extends Cell[\"type\"]>(\n type: T,\n init: () => Cell,\n): Cell & { type: T } => {\n const fiber = getCurrentResourceFiber();\n const index = fiber.currentIndex++;\n\n if (!fiber.isFirstRender && index >= fiber.cells.length) {\n // Check if we're trying to use more hooks than in previous renders\n throw new Error(\n \"Rendered more hooks than during the previous render. \" +\n \"Hooks must be called in the exact same order in every render.\",\n );\n }\n\n let cell = fiber.cells[index];\n if (!cell) {\n cell = init();\n fiber.cells[index] = cell;\n }\n\n if (cell.type !== type) {\n throw new Error(\"Hook order changed between renders\");\n }\n\n return cell as Cell & { type: T };\n};\n\nexport const registerRenderMountTask = (task: () => void) => {\n const fiber = getCurrentResourceFiber();\n fiber.renderContext!.effectTasks.push(task);\n};\n"],"mappings":";;AAGA,MAAa,WACX,MACA,SACuB;CACvB,MAAM,QAAQ,wBAAwB;CACtC,MAAM,QAAQ,MAAM;CAEpB,IAAI,CAAC,MAAM,iBAAiB,SAAS,MAAM,MAAM,QAE/C,MAAM,IAAI,MACR,oHAEF;CAGF,IAAI,OAAO,MAAM,MAAM;CACvB,IAAI,CAAC,MAAM;EACT,OAAO,KAAK;EACZ,MAAM,MAAM,SAAS;CACvB;CAEA,IAAI,KAAK,SAAS,MAChB,MAAM,IAAI,MAAM,oCAAoC;CAGtD,OAAO;AACT;AAEA,MAAa,2BAA2B,SAAqB;CAE3D,wBAAI,EAAE,cAAe,YAAY,KAAK,IAAI;AAC5C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { tapEffect } from "./hooks/tap-effect.js";
|
|
2
|
+
import { ContravariantResource, Resource, ResourceElement } from "./core/types.js";
|
|
3
|
+
import { createResourceContext, tap, withContextProvider } from "./core/context.js";
|
|
4
|
+
import { createResourceRoot } from "./core/createResourceRoot.js";
|
|
5
|
+
import { resource } from "./core/resource.js";
|
|
6
|
+
import { flushResourcesSync } from "./core/scheduler.js";
|
|
7
|
+
import { withKey } from "./core/withKey.js";
|
|
8
|
+
import { tapCallback } from "./hooks/tap-callback.js";
|
|
9
|
+
import { tapConst } from "./hooks/tap-const.js";
|
|
10
|
+
import { tapEffectEvent } from "./hooks/tap-effect-event.js";
|
|
11
|
+
import { tapMemo } from "./hooks/tap-memo.js";
|
|
12
|
+
import { tapReducer, tapReducerWithDerivedState } from "./hooks/tap-reducer.js";
|
|
13
|
+
import { tapRef } from "./hooks/tap-ref.js";
|
|
14
|
+
import { tapResource } from "./hooks/tap-resource.js";
|
|
15
|
+
import { tapResources } from "./hooks/tap-resources.js";
|
|
16
|
+
import { tapState } from "./hooks/tap-state.js";
|
|
17
|
+
import { tapResourceRoot } from "./tapResourceRoot.js";
|
|
18
|
+
export { type ContravariantResource, type Resource, type ResourceElement, createResourceContext, createResourceRoot, flushResourcesSync, resource, tap, tapCallback, tapConst, tapEffect, tapEffectEvent, tapMemo, tapReducer, tapReducerWithDerivedState, tapRef, tapResource, tapResourceRoot, tapResources, tapState, withContextProvider, withKey };
|
package/dist/index.js
CHANGED
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
export { tapResourceRoot
|
|
18
|
-
// imperative
|
|
19
|
-
export { createResourceRoot } from "./core/createResourceRoot.js";
|
|
20
|
-
export { flushResourcesSync } from "./core/scheduler.js";
|
|
21
|
-
// context
|
|
22
|
-
export { createResourceContext, tap, withContextProvider, } from "./core/context.js";
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { resource } from "./core/resource.js";
|
|
2
|
+
import { withKey } from "./core/withKey.js";
|
|
3
|
+
import { tapReducer, tapReducerWithDerivedState } from "./hooks/tap-reducer.js";
|
|
4
|
+
import { tapState } from "./hooks/tap-state.js";
|
|
5
|
+
import { tapEffect } from "./hooks/tap-effect.js";
|
|
6
|
+
import { tapRef } from "./hooks/tap-ref.js";
|
|
7
|
+
import { tapConst } from "./hooks/tap-const.js";
|
|
8
|
+
import { tapMemo } from "./hooks/tap-memo.js";
|
|
9
|
+
import { tapCallback } from "./hooks/tap-callback.js";
|
|
10
|
+
import { tapEffectEvent } from "./hooks/tap-effect-event.js";
|
|
11
|
+
import { tapResource } from "./hooks/tap-resource.js";
|
|
12
|
+
import { tapResources } from "./hooks/tap-resources.js";
|
|
13
|
+
import { flushResourcesSync } from "./core/scheduler.js";
|
|
14
|
+
import { tapResourceRoot } from "./tapResourceRoot.js";
|
|
15
|
+
import { createResourceRoot } from "./core/createResourceRoot.js";
|
|
16
|
+
import { createResourceContext, tap, withContextProvider } from "./core/context.js";
|
|
17
|
+
export { createResourceContext, createResourceRoot, flushResourcesSync, resource, tap, tapCallback, tapConst, tapEffect, tapEffectEvent, tapMemo, tapReducer, tapReducerWithDerivedState, tapRef, tapResource, tapResourceRoot, tapResources, tapState, withContextProvider, withKey };
|
package/dist/react/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { useResource } from "./use-resource.js";
|
|
2
|
+
export { useResource };
|
package/dist/react/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { useResource } from "./use-resource.js";
|
|
2
|
+
export { useResource };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { ExtractResourceReturnType, ResourceElement } from "../core/types.js";
|
|
2
|
+
|
|
3
|
+
//#region src/react/use-resource.d.ts
|
|
4
|
+
declare function useResource<E extends ResourceElement<any, any>>(element: E): ExtractResourceReturnType<E>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { useResource };
|
|
3
7
|
//# sourceMappingURL=use-resource.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resource.d.ts","
|
|
1
|
+
{"version":3,"file":"use-resource.d.ts","names":[],"sources":["../../src/react/use-resource.ts"],"mappings":";;;iBA+BgB,WAAA,WAAsB,eAAA,WAAA,CACpC,OAAA,EAAS,CAAA,GACR,yBAAA,CAA0B,CAAA"}
|
|
@@ -1,41 +1,46 @@
|
|
|
1
|
-
import { useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
2
|
-
import { createResourceFiber, unmountResourceFiber, renderResourceFiber, commitResourceFiber, } from "../core/ResourceFiber.js";
|
|
3
1
|
import { isDevelopment } from "../core/helpers/env.js";
|
|
4
|
-
import { commitRoot, createResourceFiberRoot, setRootVersion
|
|
2
|
+
import { commitRoot, createResourceFiberRoot, setRootVersion } from "../core/helpers/root.js";
|
|
3
|
+
import { commitResourceFiber, createResourceFiber, renderResourceFiber, unmountResourceFiber } from "../core/ResourceFiber.js";
|
|
4
|
+
import { useLayoutEffect, useMemo, useReducer, useRef, useState } from "react";
|
|
5
|
+
//#region src/react/use-resource.ts
|
|
5
6
|
const useDevStrictMode = () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
useState(() => count.current++);
|
|
13
|
-
if (count.current !== 2)
|
|
14
|
-
return null;
|
|
15
|
-
return isFirstRender ? "child" : "root";
|
|
7
|
+
if (!isDevelopment) return null;
|
|
8
|
+
const count = useRef(0);
|
|
9
|
+
const isFirstRender = count.current === 0;
|
|
10
|
+
useState(() => count.current++);
|
|
11
|
+
if (count.current !== 2) return null;
|
|
12
|
+
return isFirstRender ? "child" : "root";
|
|
16
13
|
};
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
14
|
+
function useResource(element) {
|
|
15
|
+
const root = useMemo(() => {
|
|
16
|
+
return createResourceFiberRoot((cb) => dispatch(cb));
|
|
17
|
+
}, []);
|
|
18
|
+
const [version, dispatch] = useReducer((v, cb) => {
|
|
19
|
+
setRootVersion(root, v);
|
|
20
|
+
return v + (cb() ? 1 : 0);
|
|
21
|
+
}, 0);
|
|
22
|
+
setRootVersion(root, version);
|
|
23
|
+
const devStrictMode = useDevStrictMode();
|
|
24
|
+
const fiber = useMemo(() => {
|
|
25
|
+
element.key;
|
|
26
|
+
return createResourceFiber(element.type, root, void 0, devStrictMode);
|
|
27
|
+
}, [
|
|
28
|
+
element.type,
|
|
29
|
+
element.key,
|
|
30
|
+
root,
|
|
31
|
+
devStrictMode
|
|
32
|
+
]);
|
|
33
|
+
const result = renderResourceFiber(fiber, element.props);
|
|
34
|
+
useLayoutEffect(() => {
|
|
35
|
+
return () => unmountResourceFiber(fiber);
|
|
36
|
+
}, [fiber]);
|
|
37
|
+
useLayoutEffect(() => {
|
|
38
|
+
commitRoot(root);
|
|
39
|
+
commitResourceFiber(fiber, result);
|
|
40
|
+
});
|
|
41
|
+
return result.output;
|
|
40
42
|
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { useResource };
|
|
45
|
+
|
|
41
46
|
//# sourceMappingURL=use-resource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-resource.js","
|
|
1
|
+
{"version":3,"file":"use-resource.js","names":[],"sources":["../../src/react/use-resource.ts"],"sourcesContent":["import { useLayoutEffect, useMemo, useReducer, useRef, useState } from \"react\";\nimport type {\n ResourceFiberRoot,\n ExtractResourceReturnType,\n ResourceElement,\n} from \"../core/types\";\nimport {\n createResourceFiber,\n unmountResourceFiber,\n renderResourceFiber,\n commitResourceFiber,\n} from \"../core/ResourceFiber\";\nimport { isDevelopment } from \"../core/helpers/env\";\nimport {\n commitRoot,\n createResourceFiberRoot,\n setRootVersion,\n} from \"../core/helpers/root\";\n\nconst useDevStrictMode = () => {\n if (!isDevelopment) return null;\n\n // oxlint-disable-next-line react-hooks/rules-of-hooks -- isDevelopment is a build-time constant, so this branch is stable per build\n const count = useRef(0);\n const isFirstRender = count.current === 0;\n // oxlint-disable-next-line react-hooks/rules-of-hooks -- isDevelopment is a build-time constant, so this branch is stable per build\n useState(() => count.current++);\n if (count.current !== 2) return null;\n return isFirstRender ? (\"child\" as const) : (\"root\" as const);\n};\n\nexport function useResource<E extends ResourceElement<any, any>>(\n element: E,\n): ExtractResourceReturnType<E> {\n const root = useMemo<ResourceFiberRoot>(() => {\n return createResourceFiberRoot((cb) => dispatch(cb));\n }, []);\n\n const [version, dispatch] = useReducer((v: number, cb: () => boolean) => {\n setRootVersion(root, v);\n return v + (cb() ? 1 : 0);\n }, 0);\n setRootVersion(root, version);\n\n const devStrictMode = useDevStrictMode();\n const fiber = useMemo(() => {\n void element.key;\n return createResourceFiber(element.type, root, undefined, devStrictMode);\n }, [element.type, element.key, root, devStrictMode]);\n\n const result = renderResourceFiber(fiber, element.props);\n useLayoutEffect(() => {\n return () => unmountResourceFiber(fiber);\n }, [fiber]);\n useLayoutEffect(() => {\n commitRoot(root);\n commitResourceFiber(fiber, result);\n });\n\n return result.output;\n}\n"],"mappings":";;;;;AAmBA,MAAM,yBAAyB;CAC7B,IAAI,CAAC,eAAe,OAAO;CAG3B,MAAM,QAAQ,OAAO,CAAC;CACtB,MAAM,gBAAgB,MAAM,YAAY;CAExC,eAAe,MAAM,SAAS;CAC9B,IAAI,MAAM,YAAY,GAAG,OAAO;CAChC,OAAO,gBAAiB,UAAqB;AAC/C;AAEA,SAAgB,YACd,SAC8B;CAC9B,MAAM,OAAO,cAAiC;EAC5C,OAAO,yBAAyB,OAAO,SAAS,EAAE,CAAC;CACrD,GAAG,CAAC,CAAC;CAEL,MAAM,CAAC,SAAS,YAAY,YAAY,GAAW,OAAsB;EACvE,eAAe,MAAM,CAAC;EACtB,OAAO,KAAK,GAAG,IAAI,IAAI;CACzB,GAAG,CAAC;CACJ,eAAe,MAAM,OAAO;CAE5B,MAAM,gBAAgB,iBAAiB;CACvC,MAAM,QAAQ,cAAc;EAC1B,QAAa;EACb,OAAO,oBAAoB,QAAQ,MAAM,MAAM,KAAA,GAAW,aAAa;CACzE,GAAG;EAAC,QAAQ;EAAM,QAAQ;EAAK;EAAM;CAAa,CAAC;CAEnD,MAAM,SAAS,oBAAoB,OAAO,QAAQ,KAAK;CACvD,sBAAsB;EACpB,aAAa,qBAAqB,KAAK;CACzC,GAAG,CAAC,KAAK,CAAC;CACV,sBAAsB;EACpB,WAAW,IAAI;EACf,oBAAoB,OAAO,MAAM;CACnC,CAAC;CAED,OAAO,OAAO;AAChB"}
|