@fictjs/runtime 0.2.1 → 0.2.2

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/index.cjs CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkZ5WRKD7Ycjs = require('./chunk-Z5WRKD7Y.cjs');
5
+ var _chunkURDFDRHRcjs = require('./chunk-URDFDRHR.cjs');
6
6
 
7
7
 
8
8
 
@@ -34,7 +34,7 @@ var _chunkZ5WRKD7Ycjs = require('./chunk-Z5WRKD7Y.cjs');
34
34
 
35
35
 
36
36
 
37
- var _chunkMWI3USXBcjs = require('./chunk-MWI3USXB.cjs');
37
+ var _chunk3U7EBKEUcjs = require('./chunk-3U7EBKEU.cjs');
38
38
 
39
39
  // src/ref.ts
40
40
  function createRef() {
@@ -46,7 +46,7 @@ function ErrorBoundary(props) {
46
46
  const fragment = document.createDocumentFragment();
47
47
  const marker = document.createComment("fict:error-boundary");
48
48
  fragment.appendChild(marker);
49
- const hostRoot = _chunkMWI3USXBcjs.getCurrentRoot.call(void 0, );
49
+ const hostRoot = _chunk3U7EBKEUcjs.getCurrentRoot.call(void 0, );
50
50
  let cleanup;
51
51
  let activeNodes = [];
52
52
  let renderingFallback = false;
@@ -64,25 +64,25 @@ function ErrorBoundary(props) {
64
64
  cleanup = void 0;
65
65
  }
66
66
  if (activeNodes.length) {
67
- _chunkMWI3USXBcjs.removeNodes.call(void 0, activeNodes);
67
+ _chunk3U7EBKEUcjs.removeNodes.call(void 0, activeNodes);
68
68
  activeNodes = [];
69
69
  }
70
70
  if (value == null || value === false) {
71
71
  return;
72
72
  }
73
- const root = _chunkMWI3USXBcjs.createRootContext.call(void 0, hostRoot);
74
- const prev = _chunkMWI3USXBcjs.pushRoot.call(void 0, root);
73
+ const root = _chunk3U7EBKEUcjs.createRootContext.call(void 0, hostRoot);
74
+ const prev = _chunk3U7EBKEUcjs.pushRoot.call(void 0, root);
75
75
  let nodes = [];
76
76
  try {
77
- const output = _chunkMWI3USXBcjs.createElement.call(void 0, value);
78
- nodes = _chunkMWI3USXBcjs.toNodeArray.call(void 0, output);
77
+ const output = _chunk3U7EBKEUcjs.createElement.call(void 0, value);
78
+ nodes = _chunk3U7EBKEUcjs.toNodeArray.call(void 0, output);
79
79
  const parentNode = marker.parentNode;
80
80
  if (parentNode) {
81
- _chunkMWI3USXBcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
81
+ _chunk3U7EBKEUcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
82
82
  }
83
83
  } catch (err) {
84
- _chunkMWI3USXBcjs.popRoot.call(void 0, prev);
85
- _chunkMWI3USXBcjs.destroyRoot.call(void 0, root);
84
+ _chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
85
+ _chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
86
86
  if (renderingFallback) {
87
87
  throw err;
88
88
  }
@@ -97,11 +97,11 @@ function ErrorBoundary(props) {
97
97
  }
98
98
  return;
99
99
  }
100
- _chunkMWI3USXBcjs.popRoot.call(void 0, prev);
101
- _chunkMWI3USXBcjs.flushOnMount.call(void 0, root);
100
+ _chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
101
+ _chunk3U7EBKEUcjs.flushOnMount.call(void 0, root);
102
102
  cleanup = () => {
103
- _chunkMWI3USXBcjs.destroyRoot.call(void 0, root);
104
- _chunkMWI3USXBcjs.removeNodes.call(void 0, nodes);
103
+ _chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
104
+ _chunk3U7EBKEUcjs.removeNodes.call(void 0, nodes);
105
105
  };
106
106
  activeNodes = nodes;
107
107
  };
@@ -110,7 +110,7 @@ function ErrorBoundary(props) {
110
110
  renderValue(toView(null));
111
111
  };
112
112
  renderValue(_nullishCoalesce(props.children, () => ( null)));
113
- _chunkMWI3USXBcjs.registerErrorHandler.call(void 0, (err) => {
113
+ _chunk3U7EBKEUcjs.registerErrorHandler.call(void 0, (err) => {
114
114
  renderValue(toView(err));
115
115
  _optionalChain([props, 'access', _5 => _5.onError, 'optionalCall', _6 => _6(err)]);
116
116
  return true;
@@ -119,7 +119,7 @@ function ErrorBoundary(props) {
119
119
  const isGetter = typeof props.resetKeys === "function" && props.resetKeys.length === 0;
120
120
  const getter = isGetter ? props.resetKeys : void 0;
121
121
  let prev = isGetter ? getter() : props.resetKeys;
122
- _chunkMWI3USXBcjs.createEffect.call(void 0, () => {
122
+ _chunk3U7EBKEUcjs.createEffect.call(void 0, () => {
123
123
  const next = getter ? getter() : props.resetKeys;
124
124
  if (prev !== next) {
125
125
  prev = next;
@@ -148,10 +148,10 @@ function createSuspenseToken() {
148
148
  }
149
149
  var isThenable = (value) => typeof value === "object" && value !== null && typeof value.then === "function";
150
150
  function Suspense(props) {
151
- const pending = _chunkMWI3USXBcjs.signal.call(void 0, 0);
151
+ const pending = _chunk3U7EBKEUcjs.signal.call(void 0, 0);
152
152
  let resolvedOnce = false;
153
153
  let epoch = 0;
154
- const hostRoot = _chunkMWI3USXBcjs.getCurrentRoot.call(void 0, );
154
+ const hostRoot = _chunk3U7EBKEUcjs.getCurrentRoot.call(void 0, );
155
155
  const toFallback = (err) => typeof props.fallback === "function" ? props.fallback(err) : props.fallback;
156
156
  const renderView = (view) => {
157
157
  if (cleanup) {
@@ -159,41 +159,41 @@ function Suspense(props) {
159
159
  cleanup = void 0;
160
160
  }
161
161
  if (activeNodes.length) {
162
- _chunkMWI3USXBcjs.removeNodes.call(void 0, activeNodes);
162
+ _chunk3U7EBKEUcjs.removeNodes.call(void 0, activeNodes);
163
163
  activeNodes = [];
164
164
  }
165
165
  if (view == null || view === false) {
166
166
  return;
167
167
  }
168
- const root = _chunkMWI3USXBcjs.createRootContext.call(void 0, hostRoot);
169
- const prev = _chunkMWI3USXBcjs.pushRoot.call(void 0, root);
168
+ const root = _chunk3U7EBKEUcjs.createRootContext.call(void 0, hostRoot);
169
+ const prev = _chunk3U7EBKEUcjs.pushRoot.call(void 0, root);
170
170
  let nodes = [];
171
171
  try {
172
- const output = _chunkMWI3USXBcjs.createElement.call(void 0, view);
173
- nodes = _chunkMWI3USXBcjs.toNodeArray.call(void 0, output);
172
+ const output = _chunk3U7EBKEUcjs.createElement.call(void 0, view);
173
+ nodes = _chunk3U7EBKEUcjs.toNodeArray.call(void 0, output);
174
174
  const suspendedAttempt = root.suspended || nodes.length > 0 && nodes.every((node) => node instanceof Comment && node.data === "fict:suspend");
175
175
  if (suspendedAttempt) {
176
- _chunkMWI3USXBcjs.popRoot.call(void 0, prev);
177
- _chunkMWI3USXBcjs.destroyRoot.call(void 0, root);
176
+ _chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
177
+ _chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
178
178
  return;
179
179
  }
180
180
  const parentNode = marker.parentNode;
181
181
  if (parentNode) {
182
- _chunkMWI3USXBcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
182
+ _chunk3U7EBKEUcjs.insertNodesBefore.call(void 0, parentNode, nodes, marker);
183
183
  }
184
184
  } catch (err) {
185
- _chunkMWI3USXBcjs.popRoot.call(void 0, prev);
186
- _chunkMWI3USXBcjs.destroyRoot.call(void 0, root);
187
- if (!_chunkMWI3USXBcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
185
+ _chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
186
+ _chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
187
+ if (!_chunk3U7EBKEUcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
188
188
  throw err;
189
189
  }
190
190
  return;
191
191
  }
192
- _chunkMWI3USXBcjs.popRoot.call(void 0, prev);
193
- _chunkMWI3USXBcjs.flushOnMount.call(void 0, root);
192
+ _chunk3U7EBKEUcjs.popRoot.call(void 0, prev);
193
+ _chunk3U7EBKEUcjs.flushOnMount.call(void 0, root);
194
194
  cleanup = () => {
195
- _chunkMWI3USXBcjs.destroyRoot.call(void 0, root);
196
- _chunkMWI3USXBcjs.removeNodes.call(void 0, nodes);
195
+ _chunk3U7EBKEUcjs.destroyRoot.call(void 0, root);
196
+ _chunk3U7EBKEUcjs.removeNodes.call(void 0, nodes);
197
197
  };
198
198
  activeNodes = nodes;
199
199
  };
@@ -208,7 +208,7 @@ function Suspense(props) {
208
208
  _optionalChain([props, 'access', _7 => _7.onResolve, 'optionalCall', _8 => _8()]);
209
209
  }
210
210
  };
211
- _chunkMWI3USXBcjs.registerSuspenseHandler.call(void 0, (token) => {
211
+ _chunk3U7EBKEUcjs.registerSuspenseHandler.call(void 0, (token) => {
212
212
  const tokenEpoch = epoch;
213
213
  pending(pending() + 1);
214
214
  renderView(toFallback());
@@ -233,7 +233,7 @@ function Suspense(props) {
233
233
  const newPending = Math.max(0, pending() - 1);
234
234
  pending(newPending);
235
235
  _optionalChain([props, 'access', _9 => _9.onReject, 'optionalCall', _10 => _10(err)]);
236
- if (!_chunkMWI3USXBcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
236
+ if (!_chunk3U7EBKEUcjs.handleError.call(void 0, err, { source: "render" }, hostRoot)) {
237
237
  throw err;
238
238
  }
239
239
  }
@@ -247,7 +247,7 @@ function Suspense(props) {
247
247
  const isGetter = typeof props.resetKeys === "function" && props.resetKeys.length === 0;
248
248
  const getter = isGetter ? props.resetKeys : void 0;
249
249
  let prev = isGetter ? getter() : props.resetKeys;
250
- _chunkMWI3USXBcjs.createEffect.call(void 0, () => {
250
+ _chunk3U7EBKEUcjs.createEffect.call(void 0, () => {
251
251
  const next = getter ? getter() : props.resetKeys;
252
252
  if (prev !== next) {
253
253
  prev = next;
@@ -284,5 +284,5 @@ function Suspense(props) {
284
284
 
285
285
 
286
286
 
287
- exports.ErrorBoundary = ErrorBoundary; exports.Fragment = _chunkMWI3USXBcjs.Fragment; exports.Suspense = Suspense; exports.batch = _chunkMWI3USXBcjs.batch2; exports.createContext = _chunkZ5WRKD7Ycjs.createContext; exports.createEffect = _chunkMWI3USXBcjs.createEffect; exports.createElement = _chunkMWI3USXBcjs.createElement; exports.createMemo = _chunkMWI3USXBcjs.createMemo; exports.createPortal = _chunkMWI3USXBcjs.createPortal; exports.createRef = createRef; exports.createRoot = _chunkMWI3USXBcjs.createRoot; exports.createSuspenseToken = createSuspenseToken; exports.hasContext = _chunkZ5WRKD7Ycjs.hasContext; exports.mergeProps = _chunkMWI3USXBcjs.mergeProps; exports.onCleanup = _chunkMWI3USXBcjs.onCleanup; exports.onDestroy = _chunkMWI3USXBcjs.onDestroy; exports.onMount = _chunkMWI3USXBcjs.onMount; exports.prop = _chunkMWI3USXBcjs.prop; exports.render = _chunkMWI3USXBcjs.render; exports.startTransition = _chunkMWI3USXBcjs.startTransition; exports.untrack = _chunkMWI3USXBcjs.untrack2; exports.useContext = _chunkZ5WRKD7Ycjs.useContext; exports.useDeferredValue = _chunkMWI3USXBcjs.useDeferredValue; exports.useTransition = _chunkMWI3USXBcjs.useTransition;
287
+ exports.ErrorBoundary = ErrorBoundary; exports.Fragment = _chunk3U7EBKEUcjs.Fragment; exports.Suspense = Suspense; exports.batch = _chunk3U7EBKEUcjs.batch2; exports.createContext = _chunkURDFDRHRcjs.createContext; exports.createEffect = _chunk3U7EBKEUcjs.createEffect; exports.createElement = _chunk3U7EBKEUcjs.createElement; exports.createMemo = _chunk3U7EBKEUcjs.createMemo; exports.createPortal = _chunk3U7EBKEUcjs.createPortal; exports.createRef = createRef; exports.createRoot = _chunk3U7EBKEUcjs.createRoot; exports.createSuspenseToken = createSuspenseToken; exports.hasContext = _chunkURDFDRHRcjs.hasContext; exports.mergeProps = _chunk3U7EBKEUcjs.mergeProps; exports.onCleanup = _chunk3U7EBKEUcjs.onCleanup; exports.onDestroy = _chunk3U7EBKEUcjs.onDestroy; exports.onMount = _chunk3U7EBKEUcjs.onMount; exports.prop = _chunk3U7EBKEUcjs.prop; exports.render = _chunk3U7EBKEUcjs.render; exports.startTransition = _chunk3U7EBKEUcjs.startTransition; exports.untrack = _chunk3U7EBKEUcjs.untrack2; exports.useContext = _chunkURDFDRHRcjs.useContext; exports.useDeferredValue = _chunk3U7EBKEUcjs.useDeferredValue; exports.useTransition = _chunk3U7EBKEUcjs.useTransition;
288
288
  //# sourceMappingURL=index.cjs.map
package/dist/index.dev.js CHANGED
@@ -2601,8 +2601,10 @@ var setProperty = (el, key, value) => {
2601
2601
  el[key] = value;
2602
2602
  };
2603
2603
  var setInnerHTML = (el, _key, value) => {
2604
- ;
2605
- el.innerHTML = value == null ? "" : String(value);
2604
+ const next = value == null ? "" : String(value);
2605
+ const node = el;
2606
+ if (node.innerHTML === next) return;
2607
+ node.innerHTML = next;
2606
2608
  };
2607
2609
  var setBoolAttribute = (el, key, value) => {
2608
2610
  if (value) {