@vidact/runtime 0.2.0-beta.0 → 0.2.0-beta.5
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/CHANGELOG.md +52 -0
- package/README.md +1 -1
- package/dist/actions.d.ts +32 -30
- package/dist/actions.d.ts.map +1 -1
- package/dist/actions.js +251 -266
- package/dist/actions.js.map +1 -1
- package/dist/async.d.ts +20 -17
- package/dist/async.d.ts.map +1 -1
- package/dist/async.js +18 -17
- package/dist/async.js.map +1 -1
- package/dist/compiled/async-resource.d.ts +9 -6
- package/dist/compiled/async-resource.d.ts.map +1 -1
- package/dist/compiled/async-resource.js +69 -77
- package/dist/compiled/async-resource.js.map +1 -1
- package/dist/compiled/core.d.ts +136 -147
- package/dist/compiled/core.d.ts.map +1 -1
- package/dist/compiled/core.js +2672 -2985
- package/dist/compiled/core.js.map +1 -1
- package/dist/compiled/types.d.ts +44 -56
- package/dist/compiled/types.d.ts.map +1 -1
- package/dist/compiled/types.js +10 -6
- package/dist/compiled/types.js.map +1 -1
- package/dist/compiled/validation.d.ts +4 -1
- package/dist/compiled/validation.d.ts.map +1 -1
- package/dist/compiled/validation.js +17 -20
- package/dist/compiled/validation.js.map +1 -1
- package/dist/component-spread.d.ts +5 -3
- package/dist/component-spread.d.ts.map +1 -1
- package/dist/component-spread.js +49 -67
- package/dist/component-spread.js.map +1 -1
- package/dist/concurrent.d.ts +20 -18
- package/dist/concurrent.d.ts.map +1 -1
- package/dist/concurrent.js +191 -210
- package/dist/concurrent.js.map +1 -1
- package/dist/direct-dom.d.ts +17 -12
- package/dist/direct-dom.d.ts.map +1 -1
- package/dist/direct-dom.js +187 -221
- package/dist/direct-dom.js.map +1 -1
- package/dist/dom/attributes.d.ts +9 -6
- package/dist/dom/attributes.d.ts.map +1 -1
- package/dist/dom/attributes.js +65 -47
- package/dist/dom/attributes.js.map +1 -1
- package/dist/dom/events.d.ts +5 -2
- package/dist/dom/events.d.ts.map +1 -1
- package/dist/dom/events.js +53 -65
- package/dist/dom/events.js.map +1 -1
- package/dist/dom/forms.d.ts +9 -6
- package/dist/dom/forms.d.ts.map +1 -1
- package/dist/dom/forms.js +152 -198
- package/dist/dom/forms.js.map +1 -1
- package/dist/dom/intrinsic.d.ts +17 -15
- package/dist/dom/intrinsic.d.ts.map +1 -1
- package/dist/dom/intrinsic.js +48 -50
- package/dist/dom/intrinsic.js.map +1 -1
- package/dist/dom/namespace.d.ts +4 -1
- package/dist/dom/namespace.d.ts.map +1 -1
- package/dist/dom/namespace.js +25 -28
- package/dist/dom/namespace.js.map +1 -1
- package/dist/dom/namespaces.d.ts +11 -8
- package/dist/dom/namespaces.d.ts.map +1 -1
- package/dist/dom/namespaces.js +14 -12
- package/dist/dom/namespaces.js.map +1 -1
- package/dist/dom/properties.d.ts +18 -16
- package/dist/dom/properties.d.ts.map +1 -1
- package/dist/dom/properties.js +273 -296
- package/dist/dom/properties.js.map +1 -1
- package/dist/dom/style-properties.d.ts +4 -1
- package/dist/dom/style-properties.d.ts.map +1 -1
- package/dist/dom/style-properties.js +49 -45
- package/dist/dom/style-properties.js.map +1 -1
- package/dist/dom/styles.d.ts +5 -2
- package/dist/dom/styles.d.ts.map +1 -1
- package/dist/dom/styles.js +47 -67
- package/dist/dom/styles.js.map +1 -1
- package/dist/dom-forms.d.ts +4 -1
- package/dist/dom-forms.d.ts.map +1 -1
- package/dist/dom-forms.js +16 -13
- package/dist/dom-forms.js.map +1 -1
- package/dist/dom-styles.d.ts +4 -1
- package/dist/dom-styles.d.ts.map +1 -1
- package/dist/dom-styles.js +10 -7
- package/dist/dom-styles.js.map +1 -1
- package/dist/framework-hydrate.d.ts +20 -17
- package/dist/framework-hydrate.d.ts.map +1 -1
- package/dist/framework-hydrate.js +128 -146
- package/dist/framework-hydrate.js.map +1 -1
- package/dist/framework-protocol.d.ts +27 -25
- package/dist/framework-protocol.d.ts.map +1 -1
- package/dist/framework-protocol.js +173 -211
- package/dist/framework-protocol.js.map +1 -1
- package/dist/framework.d.ts +34 -32
- package/dist/framework.d.ts.map +1 -1
- package/dist/framework.js +74 -93
- package/dist/framework.js.map +1 -1
- package/dist/hydrate.d.ts +11 -8
- package/dist/hydrate.d.ts.map +1 -1
- package/dist/hydrate.js +13 -9
- package/dist/hydrate.js.map +1 -1
- package/dist/hydration-bridge.d.ts +70 -58
- package/dist/hydration-bridge.d.ts.map +1 -1
- package/dist/hydration-bridge.js +77 -66
- package/dist/hydration-bridge.js.map +1 -1
- package/dist/hydration.d.ts +54 -28
- package/dist/hydration.d.ts.map +1 -1
- package/dist/hydration.js +450 -463
- package/dist/hydration.js.map +1 -1
- package/dist/index.d.ts +13 -13
- package/dist/index.js +11 -13
- package/dist/indexed-list.d.ts +8 -5
- package/dist/indexed-list.d.ts.map +1 -1
- package/dist/indexed-list.js +14 -7
- package/dist/indexed-list.js.map +1 -1
- package/dist/jsx-runtime.d.ts +10 -8
- package/dist/jsx-runtime.d.ts.map +1 -1
- package/dist/jsx-runtime.js +28 -23
- package/dist/jsx-runtime.js.map +1 -1
- package/dist/keyed-list.d.ts +13 -14
- package/dist/keyed-list.d.ts.map +1 -1
- package/dist/keyed-list.js +132 -160
- package/dist/keyed-list.js.map +1 -1
- package/dist/metadata.d.ts +6 -3
- package/dist/metadata.d.ts.map +1 -1
- package/dist/metadata.js +131 -164
- package/dist/metadata.js.map +1 -1
- package/dist/nested-prop.d.ts +4 -2
- package/dist/nested-prop.d.ts.map +1 -1
- package/dist/nested-prop.js +17 -16
- package/dist/nested-prop.js.map +1 -1
- package/dist/profiling.d.ts +11 -8
- package/dist/profiling.d.ts.map +1 -1
- package/dist/profiling.js +17 -17
- package/dist/profiling.js.map +1 -1
- package/dist/protocol.d.ts +5 -2
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +8 -5
- package/dist/protocol.js.map +1 -1
- package/dist/raw-html.d.ts +5 -2
- package/dist/raw-html.d.ts.map +1 -1
- package/dist/raw-html.js +86 -146
- package/dist/raw-html.js.map +1 -1
- package/dist/ref.d.ts +8 -3
- package/dist/ref.d.ts.map +1 -1
- package/dist/ref.js +10 -2
- package/dist/ref.js.map +1 -1
- package/dist/renderable-protocol.d.ts +26 -8
- package/dist/renderable-protocol.d.ts.map +1 -1
- package/dist/renderable-protocol.js +30 -9
- package/dist/renderable-protocol.js.map +1 -1
- package/dist/renderable.d.ts +27 -22
- package/dist/renderable.d.ts.map +1 -1
- package/dist/renderable.js +141 -133
- package/dist/renderable.js.map +1 -1
- package/dist/retained-ui.d.ts +9 -6
- package/dist/retained-ui.d.ts.map +1 -1
- package/dist/retained-ui.js +12 -10
- package/dist/retained-ui.js.map +1 -1
- package/dist/root.d.ts +18 -15
- package/dist/root.d.ts.map +1 -1
- package/dist/root.js +73 -85
- package/dist/root.js.map +1 -1
- package/dist/scheduler.d.ts +10 -8
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +97 -105
- package/dist/scheduler.js.map +1 -1
- package/dist/server-framework.d.ts +45 -42
- package/dist/server-framework.d.ts.map +1 -1
- package/dist/server-framework.js +209 -217
- package/dist/server-framework.js.map +1 -1
- package/dist/server.d.ts +130 -128
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +603 -710
- package/dist/server.js.map +1 -1
- package/dist/shared/promise.d.ts +6 -3
- package/dist/shared/promise.d.ts.map +1 -1
- package/dist/shared/promise.js +21 -19
- package/dist/shared/promise.js.map +1 -1
- package/dist/source-mask.d.ts +9 -6
- package/dist/source-mask.d.ts.map +1 -1
- package/dist/source-mask.js +45 -63
- package/dist/source-mask.js.map +1 -1
- package/dist/spread.d.ts +5 -2
- package/dist/spread.d.ts.map +1 -1
- package/dist/spread.js +79 -99
- package/dist/spread.js.map +1 -1
- package/dist/state-slot.d.ts +18 -15
- package/dist/state-slot.d.ts.map +1 -1
- package/dist/state-slot.js +43 -42
- package/dist/state-slot.js.map +1 -1
- package/dist/testing.d.ts +9 -6
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +16 -12
- package/dist/testing.js.map +1 -1
- package/package.json +8 -7
- package/src/actions.ts +415 -0
- package/src/async.ts +78 -0
- package/src/compiled/async-resource.ts +113 -0
- package/src/compiled/core.ts +4041 -0
- package/src/compiled/types.ts +96 -0
- package/src/compiled/validation.ts +23 -0
- package/src/component-spread.ts +86 -0
- package/src/concurrent.ts +310 -0
- package/src/direct-dom.ts +365 -0
- package/src/dom/attributes.ts +55 -0
- package/src/dom/events.ts +93 -0
- package/src/dom/forms.ts +220 -0
- package/src/dom/intrinsic.ts +94 -0
- package/src/dom/namespace.ts +30 -0
- package/src/dom/namespaces.ts +14 -0
- package/src/dom/properties.ts +355 -0
- package/src/dom/style-properties.ts +46 -0
- package/src/dom/styles.ts +86 -0
- package/src/dom-forms.ts +23 -0
- package/src/dom-styles.ts +11 -0
- package/src/env.d.ts +6 -0
- package/src/framework-hydrate.ts +224 -0
- package/src/framework-protocol.ts +335 -0
- package/src/framework.ts +161 -0
- package/src/hydrate.ts +38 -0
- package/src/hydration-bridge.ts +196 -0
- package/src/hydration.ts +642 -0
- package/src/index.ts +92 -0
- package/src/indexed-list.ts +20 -0
- package/src/jsx-runtime.ts +55 -0
- package/src/keyed-list.ts +233 -0
- package/src/metadata.ts +212 -0
- package/src/nested-prop.ts +27 -0
- package/src/profiling.ts +43 -0
- package/src/protocol.ts +8 -0
- package/src/raw-html.ts +206 -0
- package/src/ref.ts +13 -0
- package/src/renderable-protocol.ts +63 -0
- package/src/renderable.ts +283 -0
- package/src/retained-ui.ts +19 -0
- package/src/root.ts +122 -0
- package/src/scheduler.ts +136 -0
- package/src/server-framework.ts +397 -0
- package/src/server.ts +1160 -0
- package/src/shared/promise.ts +28 -0
- package/src/source-mask.ts +83 -0
- package/src/spread.ts +131 -0
- package/src/state-slot.ts +76 -0
- package/src/testing.ts +27 -0
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/hydration-bridge.js
CHANGED
|
@@ -1,95 +1,106 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
//#region src/hydration-bridge.ts
|
|
2
|
+
/**
|
|
3
|
+
* Marker comment prefix of the server ↔ hydrate protocol (`<!--v2:b-->` … `<!--/v2:b-->`).
|
|
4
|
+
* Bumped whenever the set of markers or their meaning changes, so a stale server render
|
|
5
|
+
* fails hydration loudly instead of being claimed wrongly. `v2` dropped the per-element
|
|
6
|
+
* and per-text markers of `vidact:v1`; the hydrator infers those from the DOM.
|
|
7
|
+
*/
|
|
8
|
+
const HYDRATION_PREFIX = "v2";
|
|
9
|
+
var HydrationMismatch = class extends Error {
|
|
10
|
+
constructor(message) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.name = "HydrationMismatch";
|
|
13
|
+
}
|
|
14
|
+
};
|
|
7
15
|
let hydration;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
16
|
+
function beginHydration(host) {
|
|
17
|
+
if (hydration === void 0) throw new Error("hydrate runtime entry is not installed");
|
|
18
|
+
return hydration.begin(host);
|
|
19
|
+
}
|
|
20
|
+
function finishHydration() {
|
|
21
|
+
hydration?.finish();
|
|
12
22
|
}
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
function hydrationRootMarkers() {
|
|
24
|
+
if (hydration === void 0) throw new Error("hydrate runtime entry is not installed");
|
|
25
|
+
return hydration.rootMarkers();
|
|
15
26
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
throw new Error('hydrate runtime entry is not installed');
|
|
19
|
-
return hydration.rootMarkers();
|
|
27
|
+
function isHydrating() {
|
|
28
|
+
return hydration?.active() ?? false;
|
|
20
29
|
}
|
|
21
|
-
|
|
22
|
-
|
|
30
|
+
function createHydrationFragment(children) {
|
|
31
|
+
if (hydration === void 0) throw new Error("hydrate runtime entry is not installed");
|
|
32
|
+
return hydration.createFragment(children);
|
|
23
33
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
throw new Error('hydrate runtime entry is not installed');
|
|
27
|
-
return hydration.createFragment(children);
|
|
34
|
+
function hydrationFragmentChildren(fragment) {
|
|
35
|
+
return hydration?.fragmentChildren(fragment);
|
|
28
36
|
}
|
|
29
|
-
|
|
30
|
-
|
|
37
|
+
function claimHydrationElement(localName, namespace, matches) {
|
|
38
|
+
return hydration?.claimElement(localName, namespace, matches);
|
|
31
39
|
}
|
|
32
|
-
|
|
33
|
-
|
|
40
|
+
function noteHydrationStructuralParent() {
|
|
41
|
+
hydration?.noteStructuralParent();
|
|
34
42
|
}
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
function claimHydrationComponentRange() {
|
|
44
|
+
return hydration?.claimComponentRange();
|
|
37
45
|
}
|
|
38
|
-
|
|
39
|
-
|
|
46
|
+
function withHydrationComponentRange(range, operation) {
|
|
47
|
+
return hydration === void 0 ? operation() : hydration.withComponentRange(range, operation);
|
|
40
48
|
}
|
|
41
|
-
|
|
42
|
-
|
|
49
|
+
function withHydrationCursor(parent, value, operation) {
|
|
50
|
+
return hydration === void 0 ? operation() : hydration.withCursor(parent, value, operation);
|
|
43
51
|
}
|
|
44
|
-
|
|
45
|
-
|
|
52
|
+
function claimHydrationNode(parent, node) {
|
|
53
|
+
return hydration?.claimNode(parent, node) ?? false;
|
|
46
54
|
}
|
|
47
|
-
|
|
48
|
-
|
|
55
|
+
function claimHydrationComponentMount(parent, start, end) {
|
|
56
|
+
return hydration?.claimComponentMount(parent, start, end) ?? false;
|
|
49
57
|
}
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
function claimHydrationText(parent, expected) {
|
|
59
|
+
return hydration?.claimText(parent, expected);
|
|
52
60
|
}
|
|
53
|
-
|
|
54
|
-
|
|
61
|
+
function claimHydrationTextRange(parent, expected) {
|
|
62
|
+
return hydration?.claimTextRange(parent, expected);
|
|
55
63
|
}
|
|
56
|
-
|
|
57
|
-
|
|
64
|
+
function claimHydrationArrayRange(parent) {
|
|
65
|
+
return hydration?.claimArrayRange(parent);
|
|
58
66
|
}
|
|
59
|
-
|
|
60
|
-
|
|
67
|
+
function finishHydrationArrayRange(parent, end) {
|
|
68
|
+
hydration?.finishArrayRange(parent, end);
|
|
61
69
|
}
|
|
62
|
-
|
|
63
|
-
|
|
70
|
+
function claimHydrationSlotRange(parent) {
|
|
71
|
+
return hydration?.claimSlotRange(parent);
|
|
64
72
|
}
|
|
65
|
-
|
|
66
|
-
|
|
73
|
+
function borrowHydrationSlotRange(parent, current) {
|
|
74
|
+
return hydration?.borrowSlotRange(parent, current);
|
|
67
75
|
}
|
|
68
|
-
|
|
69
|
-
|
|
76
|
+
function claimHydrationSuspenseFallback(parent) {
|
|
77
|
+
return hydration?.claimSuspenseFallback(parent);
|
|
70
78
|
}
|
|
71
|
-
|
|
72
|
-
|
|
79
|
+
function skipHydrationRange(start, end) {
|
|
80
|
+
hydration?.skipRange(start, end);
|
|
73
81
|
}
|
|
74
|
-
|
|
75
|
-
|
|
82
|
+
function withoutHydration(operation) {
|
|
83
|
+
return hydration === void 0 ? operation() : hydration.withoutHydration(operation);
|
|
76
84
|
}
|
|
77
|
-
|
|
78
|
-
|
|
85
|
+
function withHydrationInsertion(parent, before, operation) {
|
|
86
|
+
return hydration === void 0 ? operation() : hydration.withInsertion(parent, before, operation);
|
|
79
87
|
}
|
|
80
|
-
|
|
81
|
-
|
|
88
|
+
function hydrationInsertionPoint() {
|
|
89
|
+
return hydration?.insertionPoint();
|
|
82
90
|
}
|
|
83
|
-
|
|
84
|
-
|
|
91
|
+
function hydrationCursor(parent) {
|
|
92
|
+
return hydration?.cursor(parent);
|
|
85
93
|
}
|
|
86
|
-
|
|
87
|
-
|
|
94
|
+
function hydrationRangeParent(start, end) {
|
|
95
|
+
return hydration?.rangeParent(start, end);
|
|
88
96
|
}
|
|
89
|
-
|
|
90
|
-
|
|
97
|
+
function isHydrationMismatch(error) {
|
|
98
|
+
return error instanceof HydrationMismatch;
|
|
91
99
|
}
|
|
92
|
-
|
|
93
|
-
|
|
100
|
+
function installHydrationOperations(operations) {
|
|
101
|
+
hydration = operations;
|
|
94
102
|
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { HYDRATION_PREFIX, HydrationMismatch, beginHydration, borrowHydrationSlotRange, claimHydrationArrayRange, claimHydrationComponentMount, claimHydrationComponentRange, claimHydrationElement, claimHydrationNode, claimHydrationSlotRange, claimHydrationSuspenseFallback, claimHydrationText, claimHydrationTextRange, createHydrationFragment, finishHydration, finishHydrationArrayRange, hydrationCursor, hydrationFragmentChildren, hydrationInsertionPoint, hydrationRangeParent, hydrationRootMarkers, installHydrationOperations, isHydrating, isHydrationMismatch, noteHydrationStructuralParent, skipHydrationRange, withHydrationComponentRange, withHydrationCursor, withHydrationInsertion, withoutHydration };
|
|
105
|
+
|
|
95
106
|
//# sourceMappingURL=hydration-bridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration-bridge.js","
|
|
1
|
+
{"version":3,"file":"hydration-bridge.js","names":[],"sources":["../src/hydration-bridge.ts"],"mappings":"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"}
|
package/dist/hydration.d.ts
CHANGED
|
@@ -1,29 +1,55 @@
|
|
|
1
|
-
import { HydrationMismatch,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
1
|
+
import { HydrationMismatch, HydrationRange } from "./hydration-bridge.js";
|
|
2
|
+
//#region src/hydration.d.ts
|
|
3
|
+
declare function beginHydration(host: ParentNode): () => void;
|
|
4
|
+
declare function finishHydration(): void;
|
|
5
|
+
declare function hydrationRootMarkers(): HydrationRange;
|
|
6
|
+
declare function isHydrating(): boolean;
|
|
7
|
+
declare function createHydrationFragment(children: readonly unknown[]): DocumentFragment;
|
|
8
|
+
declare function hydrationFragmentChildren(fragment: DocumentFragment): readonly unknown[] | undefined;
|
|
9
|
+
declare function isHydrationMismatch(error: unknown): error is HydrationMismatch;
|
|
10
|
+
declare function claimHydrationElement(localName: string, namespace: string | null, matchesExpected?: (element: Element) => boolean): Element | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Called by a compiled list right before its container element is claimed. Lists are the
|
|
13
|
+
* only structural bindings whose server markup carries an `a` marker, so they are the
|
|
14
|
+
* only ones that may prefer a candidate containing one — for a conditional, Suspense or
|
|
15
|
+
* any other structural child that bias would pick an unrelated element that happens to
|
|
16
|
+
* hold a list (see `claimHydrationElement`).
|
|
17
|
+
*/
|
|
18
|
+
declare function noteHydrationStructuralParent(): void;
|
|
19
|
+
declare function claimHydrationComponentRange(): HydrationRange | undefined;
|
|
20
|
+
declare function withHydrationComponentRange<Result>(range: HydrationRange, operation: () => Result): Result;
|
|
21
|
+
declare function withHydrationCursor<Result>(parent: Node, value: Node | null, operation: () => Result): Result;
|
|
22
|
+
declare function claimHydrationNode(parent: Node, node: Node): boolean;
|
|
23
|
+
declare function claimHydrationComponentMount(parent: Node, start: Comment, end: Comment): boolean;
|
|
24
|
+
declare function claimHydrationText(parent: Node, expected: string): Text | null | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Claims the text for a scalar binding together with a range it can later swap an
|
|
27
|
+
* element or collection into. The server emits no markers around text, so the binding
|
|
28
|
+
* borrows the enclosing child-slot markers when the slot holds exactly this text — the
|
|
29
|
+
* common case, and no DOM is touched. A text node shared with adjacent scalars (one
|
|
30
|
+
* parsed node for several array items) gets fresh anchor comments instead.
|
|
31
|
+
*/
|
|
32
|
+
declare function claimHydrationTextRange(parent: Node, expected: string): readonly [start: Comment, end: Comment, text: Text | null] | undefined;
|
|
33
|
+
declare function claimHydrationArrayRange(parent: Node): HydrationRange | undefined;
|
|
34
|
+
declare function finishHydrationArrayRange(parent: Node, end: Comment): void;
|
|
35
|
+
declare function claimHydrationSlotRange(parent: Node): HydrationRange | undefined;
|
|
36
|
+
declare function borrowHydrationSlotRange(parent: Node, current: boolean): HydrationRange | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Claims everything between two markers as-is, without hydrating into it. A Suspense
|
|
39
|
+
* boundary uses this when the server rendered its content but the client cannot
|
|
40
|
+
* produce it yet (a lazy chunk still loading): the server DOM stays on screen as a
|
|
41
|
+
* dehydrated boundary and the client render replaces it once the resource resolves.
|
|
42
|
+
* The elements and component ranges inside are marked claimed so `finishHydration`'s
|
|
43
|
+
* accounting still balances.
|
|
44
|
+
*/
|
|
45
|
+
declare function skipHydrationRange(start: Comment, end: Comment): void;
|
|
46
|
+
declare function claimHydrationSuspenseFallback(parent: Node): Comment | undefined;
|
|
47
|
+
declare function withoutHydration<Result>(operation: () => Result): Result;
|
|
48
|
+
declare function withHydrationInsertion<Result>(parent: Node, before: Node, operation: () => Result): Result;
|
|
49
|
+
declare function hydrationInsertionPoint(): readonly [parent: Node, before: Node] | undefined;
|
|
50
|
+
declare function hydrationCursor(parent: Node): Node | null | undefined;
|
|
51
|
+
declare function hydrationRangeParent(start: Comment, end: Comment): Node | undefined;
|
|
52
|
+
declare function installHydration(): void;
|
|
53
|
+
//#endregion
|
|
54
|
+
export { beginHydration, borrowHydrationSlotRange, claimHydrationArrayRange, claimHydrationComponentMount, claimHydrationComponentRange, claimHydrationElement, claimHydrationNode, claimHydrationSlotRange, claimHydrationSuspenseFallback, claimHydrationText, claimHydrationTextRange, createHydrationFragment, finishHydration, finishHydrationArrayRange, hydrationCursor, hydrationFragmentChildren, hydrationInsertionPoint, hydrationRangeParent, hydrationRootMarkers, installHydration, isHydrating, isHydrationMismatch, noteHydrationStructuralParent, skipHydrationRange, withHydrationComponentRange, withHydrationCursor, withHydrationInsertion, withoutHydration };
|
|
29
55
|
//# sourceMappingURL=hydration.d.ts.map
|
package/dist/hydration.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hydration.d.ts","
|
|
1
|
+
{"version":3,"file":"hydration.d.ts","names":[],"sources":["../src/hydration.ts"],"mappings":";;iBA0BgB,eAAe,MAAM;iBA4BrB;iBAoBA,wBAAwB;iBAIxB;iBAIA,wBAAwB,+BAA+B;iBAMvD,0BACd,UAAU;iBAKI,oBAAoB,iBAAiB,SAAS;iBAI9C,sBACd,mBACA,0BACA,mBAAmB,SAAS,sBAC3B;;;;;;;;iBAuCa;iBAIA,gCAAgC;iBAahC,4BAA4B,QAC1C,OAAO,gBACP,iBAAiB,SAChB;iBAYa,oBAAoB,QAClC,QAAQ,MACR,OAAO,aACP,iBAAiB,SAChB;iBAca,mBAAmB,QAAQ,MAAM,MAAM;iBAYvC,6BAA6B,QAAQ,MAAM,OAAO,SAAS,KAAK;iBAgBhE,mBAAmB,QAAQ,MAAM,mBAAmB;;;;;;;;iBAcpD,wBACd,QAAQ,MACR,6BACW,OAAO,SAAS,KAAK,SAAS,MAAM;iBAsDjC,yBAAyB,QAAQ,OAAO;iBAexC,0BAA0B,QAAQ,MAAM,KAAK;iBAQ7C,wBAAwB,QAAQ,OAAO;iBAiBvC,yBACd,QAAQ,MACR,mBACC;;;;;;;;;iBAyBa,mBAAmB,OAAO,SAAS,KAAK;iBAuBxC,+BAA+B,QAAQ,OAAO;iBAS9C,iBAAiB,QAAQ,iBAAiB,SAAS;iBAUnD,uBAAuB,QACrC,QAAQ,MACR,QAAQ,MACR,iBAAiB,SAChB;iBAWa,qCAAqC,QAAQ,MAAM,QAAQ;iBAI3D,gBAAgB,QAAQ,OAAO;iBAK/B,qBAAqB,OAAO,SAAS,KAAK,UAAU;iBA4LpD"}
|