@fictjs/runtime 0.13.0 → 0.14.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.
Files changed (40) hide show
  1. package/README.md +25 -0
  2. package/dist/advanced.cjs +9 -9
  3. package/dist/advanced.js +4 -4
  4. package/dist/{chunk-2UR2UWE2.js → chunk-4GEXXASF.js} +3 -3
  5. package/dist/{chunk-DIK33H5U.js → chunk-A5K2MPZW.js} +2 -2
  6. package/dist/chunk-A5K2MPZW.js.map +1 -0
  7. package/dist/{chunk-44EQF3AR.cjs → chunk-BW4GNOOZ.cjs} +40 -40
  8. package/dist/{chunk-44EQF3AR.cjs.map → chunk-BW4GNOOZ.cjs.map} +1 -1
  9. package/dist/{chunk-WIHNVN6L.js → chunk-E6A6PCTW.js} +9 -11
  10. package/dist/chunk-E6A6PCTW.js.map +1 -0
  11. package/dist/{chunk-C5IE4WUG.cjs → chunk-FXDZVFEP.cjs} +8 -8
  12. package/dist/{chunk-C5IE4WUG.cjs.map → chunk-FXDZVFEP.cjs.map} +1 -1
  13. package/dist/{chunk-FHQZCAAK.cjs → chunk-HAFRB2OT.cjs} +17 -17
  14. package/dist/{chunk-FHQZCAAK.cjs.map → chunk-HAFRB2OT.cjs.map} +1 -1
  15. package/dist/{chunk-4QGEN5SJ.cjs → chunk-IEYESQRE.cjs} +180 -182
  16. package/dist/chunk-IEYESQRE.cjs.map +1 -0
  17. package/dist/{chunk-FESAXMHT.js → chunk-NPSPJGD4.js} +3 -3
  18. package/dist/{chunk-QNMYVXRL.cjs → chunk-R2WMNQGO.cjs} +2 -2
  19. package/dist/{chunk-QNMYVXRL.cjs.map → chunk-R2WMNQGO.cjs.map} +1 -1
  20. package/dist/{chunk-S63VBIWN.js → chunk-VEBU7SMW.js} +3 -3
  21. package/dist/index.cjs +42 -42
  22. package/dist/index.dev.js +2 -2
  23. package/dist/index.dev.js.map +1 -1
  24. package/dist/index.js +3 -3
  25. package/dist/internal-list.cjs +4 -4
  26. package/dist/internal-list.js +3 -3
  27. package/dist/internal.cjs +5 -5
  28. package/dist/internal.js +4 -4
  29. package/dist/loader.cjs +18 -18
  30. package/dist/loader.js +1 -1
  31. package/package.json +2 -2
  32. package/src/binding.ts +6 -8
  33. package/src/node-ops.ts +1 -1
  34. package/src/signal.ts +1 -1
  35. package/dist/chunk-4QGEN5SJ.cjs.map +0 -1
  36. package/dist/chunk-DIK33H5U.js.map +0 -1
  37. package/dist/chunk-WIHNVN6L.js.map +0 -1
  38. /package/dist/{chunk-2UR2UWE2.js.map → chunk-4GEXXASF.js.map} +0 -0
  39. /package/dist/{chunk-FESAXMHT.js.map → chunk-NPSPJGD4.js.map} +0 -0
  40. /package/dist/{chunk-S63VBIWN.js.map → chunk-VEBU7SMW.js.map} +0 -0
@@ -6,7 +6,7 @@ import {
6
6
  removeNodes,
7
7
  toNodeArray,
8
8
  withHydrationRange
9
- } from "./chunk-WIHNVN6L.js";
9
+ } from "./chunk-E6A6PCTW.js";
10
10
  import {
11
11
  __fictIsHydrating,
12
12
  __fictIsSSR,
@@ -21,7 +21,7 @@ import {
21
21
  pushRoot,
22
22
  setActiveSub,
23
23
  signal
24
- } from "./chunk-DIK33H5U.js";
24
+ } from "./chunk-A5K2MPZW.js";
25
25
 
26
26
  // src/reconcile.ts
27
27
  function reconcileArrays(parentNode, a, b) {
@@ -776,4 +776,4 @@ export {
776
776
  isNodeBetweenMarkers,
777
777
  createKeyedList
778
778
  };
779
- //# sourceMappingURL=chunk-S63VBIWN.js.map
779
+ //# sourceMappingURL=chunk-VEBU7SMW.js.map
package/dist/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkFHQZCAAKcjs = require('./chunk-FHQZCAAK.cjs');
5
+ var _chunkHAFRB2OTcjs = require('./chunk-HAFRB2OT.cjs');
6
6
 
7
7
 
8
8
 
@@ -19,7 +19,7 @@ var _chunkFHQZCAAKcjs = require('./chunk-FHQZCAAK.cjs');
19
19
 
20
20
 
21
21
 
22
- var _chunk4QGEN5SJcjs = require('./chunk-4QGEN5SJ.cjs');
22
+ var _chunkIEYESQREcjs = require('./chunk-IEYESQRE.cjs');
23
23
 
24
24
 
25
25
 
@@ -40,7 +40,7 @@ var _chunk4QGEN5SJcjs = require('./chunk-4QGEN5SJ.cjs');
40
40
 
41
41
 
42
42
 
43
- var _chunkQNMYVXRLcjs = require('./chunk-QNMYVXRL.cjs');
43
+ var _chunkR2WMNQGOcjs = require('./chunk-R2WMNQGO.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 = _chunkQNMYVXRLcjs.getCurrentRoot.call(void 0, );
52
+ const hostRoot = _chunkR2WMNQGOcjs.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
- _chunk4QGEN5SJcjs.removeNodes.call(void 0, activeNodes);
74
+ _chunkIEYESQREcjs.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 = _chunkQNMYVXRLcjs.createRootContext.call(void 0, hostRoot);
81
- const prev = _chunkQNMYVXRLcjs.pushRoot.call(void 0, root);
80
+ const root = _chunkR2WMNQGOcjs.createRootContext.call(void 0, hostRoot);
81
+ const prev = _chunkR2WMNQGOcjs.pushRoot.call(void 0, root);
82
82
  let nodes = [];
83
83
  try {
84
- const output = _chunk4QGEN5SJcjs.createElement.call(void 0, value);
85
- nodes = _chunk4QGEN5SJcjs.toNodeArray.call(void 0, output, markerOwnerDocument);
84
+ const output = _chunkIEYESQREcjs.createElement.call(void 0, value);
85
+ nodes = _chunkIEYESQREcjs.toNodeArray.call(void 0, output, markerOwnerDocument);
86
86
  const parentNode = marker.parentNode;
87
87
  if (parentNode) {
88
- _chunk4QGEN5SJcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
88
+ _chunkIEYESQREcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
89
89
  }
90
90
  } catch (err) {
91
- _chunkQNMYVXRLcjs.popRoot.call(void 0, prev);
92
- _chunkQNMYVXRLcjs.destroyRoot.call(void 0, root);
91
+ _chunkR2WMNQGOcjs.popRoot.call(void 0, prev);
92
+ _chunkR2WMNQGOcjs.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
- _chunkQNMYVXRLcjs.popRoot.call(void 0, prev);
108
- _chunkQNMYVXRLcjs.flushOnMount.call(void 0, root);
107
+ _chunkR2WMNQGOcjs.popRoot.call(void 0, prev);
108
+ _chunkR2WMNQGOcjs.flushOnMount.call(void 0, root);
109
109
  cleanup = () => {
110
- _chunkQNMYVXRLcjs.destroyRoot.call(void 0, root);
111
- _chunk4QGEN5SJcjs.removeNodes.call(void 0, nodes);
110
+ _chunkR2WMNQGOcjs.destroyRoot.call(void 0, root);
111
+ _chunkIEYESQREcjs.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
- _chunkQNMYVXRLcjs.registerErrorHandler.call(void 0, (err) => {
120
+ _chunkR2WMNQGOcjs.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
- _chunkQNMYVXRLcjs.createEffect.call(void 0, () => {
129
+ _chunkR2WMNQGOcjs.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 = _chunkQNMYVXRLcjs.__fictGetSSRStreamHooks.call(void 0, );
159
- const pending = _chunkQNMYVXRLcjs.signal.call(void 0, 0);
158
+ const streamHooks = _chunkR2WMNQGOcjs.__fictGetSSRStreamHooks.call(void 0, );
159
+ const pending = _chunkR2WMNQGOcjs.signal.call(void 0, 0);
160
160
  let resolvedOnce = false;
161
161
  let epoch = 0;
162
- const hostRoot = _chunkQNMYVXRLcjs.getCurrentRoot.call(void 0, );
162
+ const hostRoot = _chunkR2WMNQGOcjs.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
- _chunk4QGEN5SJcjs.removeNodes.call(void 0, activeNodes);
171
+ _chunkIEYESQREcjs.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 = _chunkQNMYVXRLcjs.createRootContext.call(void 0, hostRoot);
178
- const prev = _chunkQNMYVXRLcjs.pushRoot.call(void 0, root);
177
+ const root = _chunkR2WMNQGOcjs.createRootContext.call(void 0, hostRoot);
178
+ const prev = _chunkR2WMNQGOcjs.pushRoot.call(void 0, root);
179
179
  let nodes = [];
180
180
  let boundaryPushed = false;
181
181
  try {
182
182
  if (streamBoundaryId) {
183
- _chunkQNMYVXRLcjs.__fictPushSSRBoundary.call(void 0, streamBoundaryId);
183
+ _chunkR2WMNQGOcjs.__fictPushSSRBoundary.call(void 0, streamBoundaryId);
184
184
  boundaryPushed = true;
185
185
  }
186
- const output = _chunk4QGEN5SJcjs.createElement.call(void 0, view);
187
- nodes = _chunk4QGEN5SJcjs.toNodeArray.call(void 0, output, markerOwnerDocument);
186
+ const output = _chunkIEYESQREcjs.createElement.call(void 0, view);
187
+ nodes = _chunkIEYESQREcjs.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
- _chunkQNMYVXRLcjs.popRoot.call(void 0, prev);
191
- _chunkQNMYVXRLcjs.destroyRoot.call(void 0, root);
190
+ _chunkR2WMNQGOcjs.popRoot.call(void 0, prev);
191
+ _chunkR2WMNQGOcjs.destroyRoot.call(void 0, root);
192
192
  return;
193
193
  }
194
194
  const parentNode = endMarker.parentNode;
195
195
  if (parentNode) {
196
- _chunk4QGEN5SJcjs.insertNodesBefore.call(void 0, parentNode, nodes, endMarker);
196
+ _chunkIEYESQREcjs.insertNodesBefore.call(void 0, parentNode, nodes, endMarker);
197
197
  }
198
198
  } catch (err) {
199
- _chunkQNMYVXRLcjs.popRoot.call(void 0, prev);
200
- _chunkQNMYVXRLcjs.destroyRoot.call(void 0, root);
201
- if (!_chunkQNMYVXRLcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
199
+ _chunkR2WMNQGOcjs.popRoot.call(void 0, prev);
200
+ _chunkR2WMNQGOcjs.destroyRoot.call(void 0, root);
201
+ if (!_chunkR2WMNQGOcjs.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
- _chunkQNMYVXRLcjs.__fictPopSSRBoundary.call(void 0, _nullishCoalesce(streamBoundaryId, () => ( void 0)));
207
+ _chunkR2WMNQGOcjs.__fictPopSSRBoundary.call(void 0, _nullishCoalesce(streamBoundaryId, () => ( void 0)));
208
208
  }
209
209
  }
210
- _chunkQNMYVXRLcjs.popRoot.call(void 0, prev);
211
- _chunkQNMYVXRLcjs.flushOnMount.call(void 0, root);
210
+ _chunkR2WMNQGOcjs.popRoot.call(void 0, prev);
211
+ _chunkR2WMNQGOcjs.flushOnMount.call(void 0, root);
212
212
  cleanup = () => {
213
- _chunkQNMYVXRLcjs.destroyRoot.call(void 0, root);
214
- _chunk4QGEN5SJcjs.removeNodes.call(void 0, nodes);
213
+ _chunkR2WMNQGOcjs.destroyRoot.call(void 0, root);
214
+ _chunkIEYESQREcjs.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
- _chunkQNMYVXRLcjs.registerSuspenseHandler.call(void 0, (token) => {
240
+ _chunkR2WMNQGOcjs.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 = _chunkQNMYVXRLcjs.handleError.call(void 0, rejectionError, { source: "render" }, hostRoot);
278
+ const handled = _chunkR2WMNQGOcjs.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
- _chunkQNMYVXRLcjs.createEffect.call(void 0, () => {
301
+ _chunkR2WMNQGOcjs.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 = _chunk4QGEN5SJcjs.Fragment; exports.Suspense = Suspense; exports.batch = _chunk4QGEN5SJcjs.batch; exports.createContext = _chunkFHQZCAAKcjs.createContext; exports.createEffect = _chunkQNMYVXRLcjs.createEffect; exports.createElement = _chunk4QGEN5SJcjs.createElement; exports.createMemo = _chunkQNMYVXRLcjs.createMemo; exports.createPortal = _chunk4QGEN5SJcjs.createPortal; exports.createRef = createRef; exports.createRoot = _chunkQNMYVXRLcjs.createRoot; exports.createSuspenseToken = createSuspenseToken; exports.hasContext = _chunkFHQZCAAKcjs.hasContext; exports.keyed = _chunk4QGEN5SJcjs.keyed; exports.mergeProps = _chunk4QGEN5SJcjs.mergeProps; exports.onCleanup = _chunkQNMYVXRLcjs.onCleanup; exports.onDestroy = _chunkQNMYVXRLcjs.onDestroy; exports.onMount = _chunkQNMYVXRLcjs.onMount; exports.prop = _chunk4QGEN5SJcjs.prop; exports.render = _chunk4QGEN5SJcjs.render; exports.startTransition = _chunk4QGEN5SJcjs.startTransition; exports.untrack = _chunk4QGEN5SJcjs.untrack; exports.useContext = _chunkFHQZCAAKcjs.useContext; exports.useDeferredValue = _chunk4QGEN5SJcjs.useDeferredValue; exports.useTransition = _chunk4QGEN5SJcjs.useTransition;
343
+ exports.ErrorBoundary = ErrorBoundary; exports.Fragment = _chunkIEYESQREcjs.Fragment; exports.Suspense = Suspense; exports.batch = _chunkIEYESQREcjs.batch; exports.createContext = _chunkHAFRB2OTcjs.createContext; exports.createEffect = _chunkR2WMNQGOcjs.createEffect; exports.createElement = _chunkIEYESQREcjs.createElement; exports.createMemo = _chunkR2WMNQGOcjs.createMemo; exports.createPortal = _chunkIEYESQREcjs.createPortal; exports.createRef = createRef; exports.createRoot = _chunkR2WMNQGOcjs.createRoot; exports.createSuspenseToken = createSuspenseToken; exports.hasContext = _chunkHAFRB2OTcjs.hasContext; exports.keyed = _chunkIEYESQREcjs.keyed; exports.mergeProps = _chunkIEYESQREcjs.mergeProps; exports.onCleanup = _chunkR2WMNQGOcjs.onCleanup; exports.onDestroy = _chunkR2WMNQGOcjs.onDestroy; exports.onMount = _chunkR2WMNQGOcjs.onMount; exports.prop = _chunkIEYESQREcjs.prop; exports.render = _chunkIEYESQREcjs.render; exports.startTransition = _chunkIEYESQREcjs.startTransition; exports.untrack = _chunkIEYESQREcjs.untrack; exports.useContext = _chunkHAFRB2OTcjs.useContext; exports.useDeferredValue = _chunkIEYESQREcjs.useDeferredValue; exports.useTransition = _chunkIEYESQREcjs.useTransition;
344
344
  //# sourceMappingURL=index.cjs.map
package/dist/index.dev.js CHANGED
@@ -890,7 +890,7 @@ function runEffect(e) {
890
890
  throw err;
891
891
  }
892
892
  } else if (flags & Pending && e.deps) {
893
- let isDirty = false;
893
+ let isDirty;
894
894
  try {
895
895
  isDirty = checkDirty(e.deps, e);
896
896
  } catch (err) {
@@ -1963,7 +1963,7 @@ function toNodeArray(node, ownerDocument = document) {
1963
1963
  } catch {
1964
1964
  return [];
1965
1965
  }
1966
- let isNode = false;
1966
+ let isNode;
1967
1967
  try {
1968
1968
  isNode = node instanceof Node;
1969
1969
  } catch {