@fictjs/runtime 0.14.0 → 0.15.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/dist/advanced.cjs +9 -9
- package/dist/advanced.d.cts +3 -3
- package/dist/advanced.d.ts +3 -3
- package/dist/advanced.js +4 -4
- package/dist/{binding-FRyTeLDn.d.cts → binding-BlABuUiG.d.cts} +2 -2
- package/dist/{binding-DcnhUSQK.d.ts → binding-CQUGLLBI.d.ts} +2 -2
- package/dist/{chunk-4GEXXASF.js → chunk-4P4DYWLQ.js} +3 -3
- package/dist/{chunk-IEYESQRE.cjs → chunk-AR2T7JEX.cjs} +269 -211
- package/dist/chunk-AR2T7JEX.cjs.map +1 -0
- package/dist/{chunk-HAFRB2OT.cjs → chunk-BADX4WTQ.cjs} +17 -17
- package/dist/{chunk-HAFRB2OT.cjs.map → chunk-BADX4WTQ.cjs.map} +1 -1
- package/dist/{chunk-BW4GNOOZ.cjs → chunk-CBRGOLTR.cjs} +40 -40
- package/dist/{chunk-BW4GNOOZ.cjs.map → chunk-CBRGOLTR.cjs.map} +1 -1
- package/dist/{chunk-FXDZVFEP.cjs → chunk-ECNK25S4.cjs} +8 -8
- package/dist/{chunk-FXDZVFEP.cjs.map → chunk-ECNK25S4.cjs.map} +1 -1
- package/dist/{chunk-A5K2MPZW.js → chunk-MAHWGB55.js} +11 -4
- package/dist/{chunk-A5K2MPZW.js.map → chunk-MAHWGB55.js.map} +1 -1
- package/dist/{chunk-VEBU7SMW.js → chunk-RK2WSQYL.js} +3 -3
- package/dist/{chunk-R2WMNQGO.cjs → chunk-WJMZ7X46.cjs} +11 -4
- package/dist/chunk-WJMZ7X46.cjs.map +1 -0
- package/dist/{chunk-E6A6PCTW.js → chunk-ZJZ6LMDN.js} +78 -20
- package/dist/chunk-ZJZ6LMDN.js.map +1 -0
- package/dist/{chunk-NPSPJGD4.js → chunk-ZWQLXWSV.js} +3 -3
- package/dist/{devtools-D2z4llpA.d.ts → devtools-DNnnDGu1.d.ts} +1 -1
- package/dist/{devtools-BtIkN77t.d.cts → devtools-DWIZRe7L.d.cts} +1 -1
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.dev.js +1 -0
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/internal-list.cjs +4 -4
- package/dist/internal-list.js +3 -3
- package/dist/internal.cjs +5 -5
- package/dist/internal.d.cts +3 -3
- package/dist/internal.d.ts +3 -3
- package/dist/internal.js +4 -4
- package/dist/loader.cjs +18 -18
- package/dist/loader.js +1 -1
- package/dist/{props-D1nj2p_3.d.ts → props-DabFQwLR.d.ts} +1 -1
- package/dist/{props-9chMyBGb.d.cts → props-tImUZAty.d.cts} +1 -1
- package/dist/{scope-Bn3sxem5.d.cts → scope-GwC4DJ50.d.cts} +1 -1
- package/dist/{scope-BSkhJr0a.d.ts → scope-gpOMWTlf.d.ts} +1 -1
- package/package.json +1 -1
- package/src/binding.ts +92 -19
- package/src/resume.ts +7 -3
- package/src/store.ts +4 -1
- package/dist/chunk-E6A6PCTW.js.map +0 -1
- package/dist/chunk-IEYESQRE.cjs.map +0 -1
- package/dist/chunk-R2WMNQGO.cjs.map +0 -1
- /package/dist/{chunk-4GEXXASF.js.map → chunk-4P4DYWLQ.js.map} +0 -0
- /package/dist/{chunk-VEBU7SMW.js.map → chunk-RK2WSQYL.js.map} +0 -0
- /package/dist/{chunk-NPSPJGD4.js.map → chunk-ZWQLXWSV.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkBADX4WTQcjs = require('./chunk-BADX4WTQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
@@ -19,7 +19,7 @@ var _chunkHAFRB2OTcjs = require('./chunk-HAFRB2OT.cjs');
|
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _chunkAR2T7JEXcjs = require('./chunk-AR2T7JEX.cjs');
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
@@ -40,7 +40,7 @@ var _chunkIEYESQREcjs = require('./chunk-IEYESQRE.cjs');
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
|
|
43
|
-
var
|
|
43
|
+
var _chunkWJMZ7X46cjs = require('./chunk-WJMZ7X46.cjs');
|
|
44
44
|
|
|
45
45
|
// src/ref.ts
|
|
46
46
|
function createRef() {
|
|
@@ -49,7 +49,7 @@ function createRef() {
|
|
|
49
49
|
|
|
50
50
|
// src/error-boundary.ts
|
|
51
51
|
function ErrorBoundary(props) {
|
|
52
|
-
const hostRoot =
|
|
52
|
+
const hostRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
|
|
53
53
|
const markerOwnerDocument = _nullishCoalesce(_optionalChain([hostRoot, 'optionalAccess', _ => _.ownerDocument]), () => ( document));
|
|
54
54
|
const fragment = markerOwnerDocument.createDocumentFragment();
|
|
55
55
|
const marker = markerOwnerDocument.createComment("fict:error-boundary");
|
|
@@ -71,25 +71,25 @@ function ErrorBoundary(props) {
|
|
|
71
71
|
cleanup = void 0;
|
|
72
72
|
}
|
|
73
73
|
if (activeNodes.length) {
|
|
74
|
-
|
|
74
|
+
_chunkAR2T7JEXcjs.removeNodes.call(void 0, activeNodes);
|
|
75
75
|
activeNodes = [];
|
|
76
76
|
}
|
|
77
77
|
if (value == null || value === false) {
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
|
-
const root =
|
|
81
|
-
const prev =
|
|
80
|
+
const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
|
|
81
|
+
const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
|
|
82
82
|
let nodes = [];
|
|
83
83
|
try {
|
|
84
|
-
const output =
|
|
85
|
-
nodes =
|
|
84
|
+
const output = _chunkAR2T7JEXcjs.createElement.call(void 0, value);
|
|
85
|
+
nodes = _chunkAR2T7JEXcjs.toNodeArray.call(void 0, output, markerOwnerDocument);
|
|
86
86
|
const parentNode = marker.parentNode;
|
|
87
87
|
if (parentNode) {
|
|
88
|
-
|
|
88
|
+
_chunkAR2T7JEXcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
|
|
89
89
|
}
|
|
90
90
|
} catch (err) {
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
_chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
|
|
92
|
+
_chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
|
|
93
93
|
if (renderingFallback) {
|
|
94
94
|
throw err;
|
|
95
95
|
}
|
|
@@ -104,11 +104,11 @@ function ErrorBoundary(props) {
|
|
|
104
104
|
}
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
_chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
|
|
108
|
+
_chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
|
|
109
109
|
cleanup = () => {
|
|
110
|
-
|
|
111
|
-
|
|
110
|
+
_chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
|
|
111
|
+
_chunkAR2T7JEXcjs.removeNodes.call(void 0, nodes);
|
|
112
112
|
};
|
|
113
113
|
activeNodes = nodes;
|
|
114
114
|
};
|
|
@@ -117,7 +117,7 @@ function ErrorBoundary(props) {
|
|
|
117
117
|
renderValue(toView(null));
|
|
118
118
|
};
|
|
119
119
|
renderValue(_nullishCoalesce(props.children, () => ( null)));
|
|
120
|
-
|
|
120
|
+
_chunkWJMZ7X46cjs.registerErrorHandler.call(void 0, (err) => {
|
|
121
121
|
renderValue(toView(err));
|
|
122
122
|
_optionalChain([props, 'access', _6 => _6.onError, 'optionalCall', _7 => _7(err)]);
|
|
123
123
|
return true;
|
|
@@ -126,7 +126,7 @@ function ErrorBoundary(props) {
|
|
|
126
126
|
const isGetter = typeof props.resetKeys === "function" && props.resetKeys.length === 0;
|
|
127
127
|
const getter = isGetter ? props.resetKeys : void 0;
|
|
128
128
|
let prev = isGetter ? getter() : props.resetKeys;
|
|
129
|
-
|
|
129
|
+
_chunkWJMZ7X46cjs.createEffect.call(void 0, () => {
|
|
130
130
|
const next = getter ? getter() : props.resetKeys;
|
|
131
131
|
if (prev !== next) {
|
|
132
132
|
prev = next;
|
|
@@ -155,11 +155,11 @@ function createSuspenseToken() {
|
|
|
155
155
|
}
|
|
156
156
|
var isThenable = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
|
|
157
157
|
function Suspense(props) {
|
|
158
|
-
const streamHooks =
|
|
159
|
-
const pending =
|
|
158
|
+
const streamHooks = _chunkWJMZ7X46cjs.__fictGetSSRStreamHooks.call(void 0, );
|
|
159
|
+
const pending = _chunkWJMZ7X46cjs.signal.call(void 0, 0);
|
|
160
160
|
let resolvedOnce = false;
|
|
161
161
|
let epoch = 0;
|
|
162
|
-
const hostRoot =
|
|
162
|
+
const hostRoot = _chunkWJMZ7X46cjs.getCurrentRoot.call(void 0, );
|
|
163
163
|
const markerOwnerDocument = _nullishCoalesce(_optionalChain([hostRoot, 'optionalAccess', _8 => _8.ownerDocument]), () => ( document));
|
|
164
164
|
const toFallback = (err) => typeof props.fallback === "function" ? props.fallback(err) : props.fallback;
|
|
165
165
|
const renderView = (view) => {
|
|
@@ -168,50 +168,50 @@ function Suspense(props) {
|
|
|
168
168
|
cleanup = void 0;
|
|
169
169
|
}
|
|
170
170
|
if (activeNodes.length) {
|
|
171
|
-
|
|
171
|
+
_chunkAR2T7JEXcjs.removeNodes.call(void 0, activeNodes);
|
|
172
172
|
activeNodes = [];
|
|
173
173
|
}
|
|
174
174
|
if (view == null || view === false) {
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
const root =
|
|
178
|
-
const prev =
|
|
177
|
+
const root = _chunkWJMZ7X46cjs.createRootContext.call(void 0, hostRoot);
|
|
178
|
+
const prev = _chunkWJMZ7X46cjs.pushRoot.call(void 0, root);
|
|
179
179
|
let nodes = [];
|
|
180
180
|
let boundaryPushed = false;
|
|
181
181
|
try {
|
|
182
182
|
if (streamBoundaryId) {
|
|
183
|
-
|
|
183
|
+
_chunkWJMZ7X46cjs.__fictPushSSRBoundary.call(void 0, streamBoundaryId);
|
|
184
184
|
boundaryPushed = true;
|
|
185
185
|
}
|
|
186
|
-
const output =
|
|
187
|
-
nodes =
|
|
186
|
+
const output = _chunkAR2T7JEXcjs.createElement.call(void 0, view);
|
|
187
|
+
nodes = _chunkAR2T7JEXcjs.toNodeArray.call(void 0, output, markerOwnerDocument);
|
|
188
188
|
const suspendedAttempt = root.suspended || nodes.length > 0 && nodes.every((node) => node instanceof Comment && node.data === "fict:suspend");
|
|
189
189
|
if (suspendedAttempt) {
|
|
190
|
-
|
|
191
|
-
|
|
190
|
+
_chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
|
|
191
|
+
_chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
|
|
192
192
|
return;
|
|
193
193
|
}
|
|
194
194
|
const parentNode = endMarker.parentNode;
|
|
195
195
|
if (parentNode) {
|
|
196
|
-
|
|
196
|
+
_chunkAR2T7JEXcjs.insertNodesBefore.call(void 0, parentNode, nodes, endMarker);
|
|
197
197
|
}
|
|
198
198
|
} catch (err) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
if (!
|
|
199
|
+
_chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
|
|
200
|
+
_chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
|
|
201
|
+
if (!_chunkWJMZ7X46cjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
|
|
202
202
|
throw err;
|
|
203
203
|
}
|
|
204
204
|
return;
|
|
205
205
|
} finally {
|
|
206
206
|
if (boundaryPushed) {
|
|
207
|
-
|
|
207
|
+
_chunkWJMZ7X46cjs.__fictPopSSRBoundary.call(void 0, _nullishCoalesce(streamBoundaryId, () => ( void 0)));
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
|
|
211
|
-
|
|
210
|
+
_chunkWJMZ7X46cjs.popRoot.call(void 0, prev);
|
|
211
|
+
_chunkWJMZ7X46cjs.flushOnMount.call(void 0, root);
|
|
212
212
|
cleanup = () => {
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
_chunkWJMZ7X46cjs.destroyRoot.call(void 0, root);
|
|
214
|
+
_chunkAR2T7JEXcjs.removeNodes.call(void 0, nodes);
|
|
215
215
|
};
|
|
216
216
|
activeNodes = nodes;
|
|
217
217
|
};
|
|
@@ -237,7 +237,7 @@ function Suspense(props) {
|
|
|
237
237
|
_optionalChain([props, 'access', _10 => _10.onResolve, 'optionalCall', _11 => _11()]);
|
|
238
238
|
}
|
|
239
239
|
};
|
|
240
|
-
|
|
240
|
+
_chunkWJMZ7X46cjs.registerSuspenseHandler.call(void 0, (token) => {
|
|
241
241
|
const tokenEpoch = epoch;
|
|
242
242
|
if (!streamPending && streamBoundaryId && _optionalChain([streamHooks, 'optionalAccess', _12 => _12.boundaryPending])) {
|
|
243
243
|
streamPending = true;
|
|
@@ -275,7 +275,7 @@ function Suspense(props) {
|
|
|
275
275
|
} catch (callbackError) {
|
|
276
276
|
rejectionError = callbackError;
|
|
277
277
|
}
|
|
278
|
-
const handled =
|
|
278
|
+
const handled = _chunkWJMZ7X46cjs.handleError.call(void 0, rejectionError, { source: "render" }, hostRoot);
|
|
279
279
|
if (!handled) {
|
|
280
280
|
if (_optionalChain([streamHooks, 'optionalAccess', _16 => _16.onError])) {
|
|
281
281
|
streamHooks.onError(rejectionError, _nullishCoalesce(streamBoundaryId, () => ( void 0)));
|
|
@@ -298,7 +298,7 @@ function Suspense(props) {
|
|
|
298
298
|
const isGetter = typeof props.resetKeys === "function" && props.resetKeys.length === 0;
|
|
299
299
|
const getter = isGetter ? props.resetKeys : void 0;
|
|
300
300
|
let prev = isGetter ? getter() : props.resetKeys;
|
|
301
|
-
|
|
301
|
+
_chunkWJMZ7X46cjs.createEffect.call(void 0, () => {
|
|
302
302
|
const next = getter ? getter() : props.resetKeys;
|
|
303
303
|
if (prev !== next) {
|
|
304
304
|
prev = next;
|
|
@@ -340,5 +340,5 @@ function Suspense(props) {
|
|
|
340
340
|
|
|
341
341
|
|
|
342
342
|
|
|
343
|
-
exports.ErrorBoundary = ErrorBoundary; exports.Fragment =
|
|
343
|
+
exports.ErrorBoundary = ErrorBoundary; exports.Fragment = _chunkAR2T7JEXcjs.Fragment; exports.Suspense = Suspense; exports.batch = _chunkAR2T7JEXcjs.batch; exports.createContext = _chunkBADX4WTQcjs.createContext; exports.createEffect = _chunkWJMZ7X46cjs.createEffect; exports.createElement = _chunkAR2T7JEXcjs.createElement; exports.createMemo = _chunkWJMZ7X46cjs.createMemo; exports.createPortal = _chunkAR2T7JEXcjs.createPortal; exports.createRef = createRef; exports.createRoot = _chunkWJMZ7X46cjs.createRoot; exports.createSuspenseToken = createSuspenseToken; exports.hasContext = _chunkBADX4WTQcjs.hasContext; exports.keyed = _chunkAR2T7JEXcjs.keyed; exports.mergeProps = _chunkAR2T7JEXcjs.mergeProps; exports.onCleanup = _chunkWJMZ7X46cjs.onCleanup; exports.onDestroy = _chunkWJMZ7X46cjs.onDestroy; exports.onMount = _chunkWJMZ7X46cjs.onMount; exports.prop = _chunkAR2T7JEXcjs.prop; exports.render = _chunkAR2T7JEXcjs.render; exports.startTransition = _chunkAR2T7JEXcjs.startTransition; exports.untrack = _chunkAR2T7JEXcjs.untrack; exports.useContext = _chunkBADX4WTQcjs.useContext; exports.useDeferredValue = _chunkAR2T7JEXcjs.useDeferredValue; exports.useTransition = _chunkAR2T7JEXcjs.useTransition;
|
|
344
344
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { F as Fragment, J as JSX, M as Memo, d as createElement, c as createMemo, k as keyed, m as mergeProps, p as prop, r as render } from './props-
|
|
2
|
-
import { S as RefObject, B as BaseProps, F as FictNode, T as SuspenseToken } from './binding-
|
|
3
|
-
export { a3 as ClassProp, Z as Cleanup, _ as Component, R as DOMElement, U as Effect, a5 as ErrorInfo, a4 as EventHandler, Y as FictVNode, $ as PropsWithChildren, a0 as Ref, a1 as RefCallback, a2 as StyleProp, j as createEffect, E as createPortal, X as createRoot, W as onCleanup, N as onDestroy, V as onMount } from './binding-
|
|
4
|
-
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './devtools-
|
|
1
|
+
export { F as Fragment, J as JSX, M as Memo, d as createElement, c as createMemo, k as keyed, m as mergeProps, p as prop, r as render } from './props-tImUZAty.cjs';
|
|
2
|
+
import { S as RefObject, B as BaseProps, F as FictNode, T as SuspenseToken } from './binding-BlABuUiG.cjs';
|
|
3
|
+
export { a3 as ClassProp, Z as Cleanup, _ as Component, R as DOMElement, U as Effect, a5 as ErrorInfo, a4 as EventHandler, Y as FictVNode, $ as PropsWithChildren, a0 as Ref, a1 as RefCallback, a2 as StyleProp, j as createEffect, E as createPortal, X as createRoot, W as onCleanup, N as onDestroy, V as onMount } from './binding-BlABuUiG.cjs';
|
|
4
|
+
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './devtools-DWIZRe7L.cjs';
|
|
5
5
|
import './signal-Z4KkDk9h.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { F as Fragment, J as JSX, M as Memo, d as createElement, c as createMemo, k as keyed, m as mergeProps, p as prop, r as render } from './props-
|
|
2
|
-
import { S as RefObject, B as BaseProps, F as FictNode, T as SuspenseToken } from './binding-
|
|
3
|
-
export { a3 as ClassProp, Z as Cleanup, _ as Component, R as DOMElement, U as Effect, a5 as ErrorInfo, a4 as EventHandler, Y as FictVNode, $ as PropsWithChildren, a0 as Ref, a1 as RefCallback, a2 as StyleProp, j as createEffect, E as createPortal, X as createRoot, W as onCleanup, N as onDestroy, V as onMount } from './binding-
|
|
4
|
-
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './devtools-
|
|
1
|
+
export { F as Fragment, J as JSX, M as Memo, d as createElement, c as createMemo, k as keyed, m as mergeProps, p as prop, r as render } from './props-DabFQwLR.js';
|
|
2
|
+
import { S as RefObject, B as BaseProps, F as FictNode, T as SuspenseToken } from './binding-CQUGLLBI.js';
|
|
3
|
+
export { a3 as ClassProp, Z as Cleanup, _ as Component, R as DOMElement, U as Effect, a5 as ErrorInfo, a4 as EventHandler, Y as FictVNode, $ as PropsWithChildren, a0 as Ref, a1 as RefCallback, a2 as StyleProp, j as createEffect, E as createPortal, X as createRoot, W as onCleanup, N as onDestroy, V as onMount } from './binding-CQUGLLBI.js';
|
|
4
|
+
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, h as hasContext, u as useContext } from './devtools-DNnnDGu1.js';
|
|
5
5
|
import './signal-Z4KkDk9h.js';
|
|
6
6
|
|
|
7
7
|
/**
|
package/dist/index.dev.js
CHANGED
|
@@ -2149,6 +2149,7 @@ var PROP_CACHE = Symbol("fict:prop");
|
|
|
2149
2149
|
var STYLE_CACHE = Symbol("fict:style");
|
|
2150
2150
|
var CLASS_STATE_CACHE = Symbol("fict:class-state");
|
|
2151
2151
|
var CLASS_VALUE_CACHE = Symbol("fict:class-value");
|
|
2152
|
+
var EVENT_TUPLE_LISTENER_CACHE = Symbol("fict:event-tuple-listener-cache");
|
|
2152
2153
|
var NON_REACTIVE_FN_MARKER = Symbol.for("fict:non-reactive-fn");
|
|
2153
2154
|
var REACTIVE_FN_MARKER = Symbol.for("fict:reactive-fn");
|
|
2154
2155
|
var NON_REACTIVE_FN_REGISTRY_KEY = Symbol.for("fict:non-reactive-fn-registry");
|