@getforma/core 1.0.10 → 1.1.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/{chunk-6FW5E54W.cjs → chunk-2Y5US35K.cjs} +127 -103
- package/dist/chunk-2Y5US35K.cjs.map +1 -0
- package/dist/{chunk-3G7ET4O5.js → chunk-INNOI6TG.js} +121 -94
- package/dist/chunk-INNOI6TG.js.map +1 -0
- package/dist/{chunk-T33QUD2Y.cjs → chunk-JRQNDXX7.cjs} +43 -43
- package/dist/{chunk-T33QUD2Y.cjs.map → chunk-JRQNDXX7.cjs.map} +1 -1
- package/dist/{chunk-AFRFF7XL.js → chunk-MIOMT2CB.js} +4 -4
- package/dist/{chunk-AFRFF7XL.js.map → chunk-MIOMT2CB.js.map} +1 -1
- package/dist/chunk-W7OUWVRA.cjs +106 -0
- package/dist/chunk-W7OUWVRA.cjs.map +1 -0
- package/dist/chunk-XLVBYXOU.js +100 -0
- package/dist/chunk-XLVBYXOU.js.map +1 -0
- package/dist/forma-runtime-csp.js +52 -4
- package/dist/forma-runtime.js +98 -10
- package/dist/formajs-runtime-hardened.global.js +52 -4
- package/dist/formajs-runtime-hardened.global.js.map +1 -1
- package/dist/formajs-runtime.global.js +98 -10
- package/dist/formajs-runtime.global.js.map +1 -1
- package/dist/formajs.global.js +192 -95
- package/dist/formajs.global.js.map +1 -1
- package/dist/http.cjs +11 -11
- package/dist/http.js +2 -2
- package/dist/index.cjs +66 -66
- package/dist/index.d.cts +11 -25
- package/dist/index.d.ts +11 -25
- package/dist/index.js +6 -6
- package/dist/{resource-DeEzxUz6.d.cts → resource-D6HfVgiA.d.cts} +7 -2
- package/dist/{resource-BHsgURy0.d.ts → resource-ljs2X5NM.d.ts} +7 -2
- package/dist/runtime-hardened.cjs +53 -3
- package/dist/runtime-hardened.cjs.map +1 -1
- package/dist/runtime-hardened.js +53 -3
- package/dist/runtime-hardened.js.map +1 -1
- package/dist/runtime.cjs +29 -29
- package/dist/runtime.js +3 -3
- package/dist/server.cjs +7 -7
- package/dist/server.d.cts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +2 -2
- package/dist/{signal-C9v4akyJ.d.cts → signal-CRBJYQ6B.d.cts} +0 -8
- package/dist/{signal-C9v4akyJ.d.ts → signal-CRBJYQ6B.d.ts} +0 -8
- package/dist/tc39-compat.cjs +3 -6
- package/dist/tc39-compat.cjs.map +1 -1
- package/dist/tc39-compat.d.cts +1 -1
- package/dist/tc39-compat.d.ts +1 -1
- package/dist/tc39-compat.js +1 -4
- package/dist/tc39-compat.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3G7ET4O5.js.map +0 -1
- package/dist/chunk-6FW5E54W.cjs.map +0 -1
- package/dist/chunk-HLM5BZZQ.js +0 -35
- package/dist/chunk-HLM5BZZQ.js.map +0 -1
- package/dist/chunk-QLPCVK7C.cjs +0 -38
- package/dist/chunk-QLPCVK7C.cjs.map +0 -1
package/dist/http.cjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk2Y5US35K_cjs = require('./chunk-2Y5US35K.cjs');
|
|
4
|
+
var chunkW7OUWVRA_cjs = require('./chunk-W7OUWVRA.cjs');
|
|
5
5
|
|
|
6
6
|
// src/http/fetch.ts
|
|
7
7
|
function createFetch(url, options) {
|
|
8
|
-
const [data, setData] =
|
|
9
|
-
const [error, setError] =
|
|
10
|
-
const [loading, setLoading] =
|
|
8
|
+
const [data, setData] = chunkW7OUWVRA_cjs.createSignal(null);
|
|
9
|
+
const [error, setError] = chunkW7OUWVRA_cjs.createSignal(null);
|
|
10
|
+
const [loading, setLoading] = chunkW7OUWVRA_cjs.createSignal(false);
|
|
11
11
|
let currentController = null;
|
|
12
12
|
function resolveURL() {
|
|
13
13
|
const raw = typeof url === "function" ? url() : url;
|
|
@@ -57,7 +57,7 @@ function createFetch(url, options) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
if (typeof url === "function") {
|
|
60
|
-
|
|
60
|
+
chunk2Y5US35K_cjs.internalEffect(() => {
|
|
61
61
|
url();
|
|
62
62
|
void execute();
|
|
63
63
|
});
|
|
@@ -86,9 +86,9 @@ async function fetchJSON(url, options) {
|
|
|
86
86
|
|
|
87
87
|
// src/http/sse.ts
|
|
88
88
|
function createSSE(url, options) {
|
|
89
|
-
const [data, setData] =
|
|
90
|
-
const [error, setError] =
|
|
91
|
-
const [connected, setConnected] =
|
|
89
|
+
const [data, setData] = chunkW7OUWVRA_cjs.createSignal(null);
|
|
90
|
+
const [error, setError] = chunkW7OUWVRA_cjs.createSignal(null);
|
|
91
|
+
const [connected, setConnected] = chunkW7OUWVRA_cjs.createSignal(false);
|
|
92
92
|
const source = new EventSource(url, {
|
|
93
93
|
withCredentials: options?.withCredentials ?? false
|
|
94
94
|
});
|
|
@@ -142,8 +142,8 @@ function createWebSocket(url, options) {
|
|
|
142
142
|
const shouldReconnect = options?.reconnect ?? true;
|
|
143
143
|
const baseInterval = options?.reconnectInterval ?? 1e3;
|
|
144
144
|
const maxReconnects = options?.maxReconnects ?? 5;
|
|
145
|
-
const [data, setData] =
|
|
146
|
-
const [status, setStatus] =
|
|
145
|
+
const [data, setData] = chunkW7OUWVRA_cjs.createSignal(null);
|
|
146
|
+
const [status, setStatus] = chunkW7OUWVRA_cjs.createSignal("connecting");
|
|
147
147
|
const handlers = /* @__PURE__ */ new Set();
|
|
148
148
|
let socket = null;
|
|
149
149
|
let reconnectCount = 0;
|
package/dist/http.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { internalEffect } from './chunk-
|
|
2
|
-
import { createSignal } from './chunk-
|
|
1
|
+
import { internalEffect } from './chunk-INNOI6TG.js';
|
|
2
|
+
import { createSignal } from './chunk-XLVBYXOU.js';
|
|
3
3
|
|
|
4
4
|
// src/http/fetch.ts
|
|
5
5
|
function createFetch(url, options) {
|
package/dist/index.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkJRQNDXX7_cjs = require('./chunk-JRQNDXX7.cjs');
|
|
4
|
+
var chunk2Y5US35K_cjs = require('./chunk-2Y5US35K.cjs');
|
|
5
|
+
var chunkW7OUWVRA_cjs = require('./chunk-W7OUWVRA.cjs');
|
|
6
6
|
|
|
7
7
|
// src/dom/text.ts
|
|
8
8
|
function createText(value) {
|
|
9
9
|
if (typeof value === "function") {
|
|
10
10
|
const node = new Text("");
|
|
11
|
-
|
|
11
|
+
chunk2Y5US35K_cjs.internalEffect(() => {
|
|
12
12
|
node.data = value();
|
|
13
13
|
});
|
|
14
14
|
return node;
|
|
@@ -24,12 +24,12 @@ function mount(component, container) {
|
|
|
24
24
|
}
|
|
25
25
|
let disposeRoot;
|
|
26
26
|
if (target.hasAttribute("data-forma-ssr")) {
|
|
27
|
-
|
|
27
|
+
chunk2Y5US35K_cjs.createUnownedRoot((dispose) => {
|
|
28
28
|
disposeRoot = dispose;
|
|
29
|
-
|
|
29
|
+
chunkJRQNDXX7_cjs.hydrateIsland(component, target);
|
|
30
30
|
});
|
|
31
31
|
} else {
|
|
32
|
-
const dom =
|
|
32
|
+
const dom = chunk2Y5US35K_cjs.createUnownedRoot((dispose) => {
|
|
33
33
|
disposeRoot = dispose;
|
|
34
34
|
return component();
|
|
35
35
|
});
|
|
@@ -55,7 +55,7 @@ function createSwitch(value, cases, fallback) {
|
|
|
55
55
|
const cache2 = /* @__PURE__ */ new Map();
|
|
56
56
|
let currentNode = null;
|
|
57
57
|
let currentMatch = UNSET;
|
|
58
|
-
const switchDispose =
|
|
58
|
+
const switchDispose = chunk2Y5US35K_cjs.internalEffect(() => {
|
|
59
59
|
const val = value();
|
|
60
60
|
if (val === currentMatch) return;
|
|
61
61
|
const DEBUG = typeof globalThis.__FORMA_DEBUG__ !== "undefined";
|
|
@@ -90,9 +90,9 @@ function createSwitch(value, cases, fallback) {
|
|
|
90
90
|
let entry = cache2.get(val);
|
|
91
91
|
if (!entry) {
|
|
92
92
|
let branchDispose;
|
|
93
|
-
const node =
|
|
93
|
+
const node = chunk2Y5US35K_cjs.createRoot((dispose) => {
|
|
94
94
|
branchDispose = dispose;
|
|
95
|
-
return
|
|
95
|
+
return chunk2Y5US35K_cjs.untrack(() => matchedCase.render());
|
|
96
96
|
});
|
|
97
97
|
entry = { node, dispose: branchDispose };
|
|
98
98
|
cache2.set(val, entry);
|
|
@@ -110,7 +110,7 @@ function createSwitch(value, cases, fallback) {
|
|
|
110
110
|
if (DEBUG) console.log("[forma:switch] inserted", currentNode.nodeName, "before end marker");
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
|
-
|
|
113
|
+
chunk2Y5US35K_cjs.registerDisposer(() => {
|
|
114
114
|
for (const entry of cache2.values()) {
|
|
115
115
|
entry.dispose();
|
|
116
116
|
}
|
|
@@ -142,7 +142,7 @@ function createPortal(children2, target) {
|
|
|
142
142
|
}
|
|
143
143
|
mountedNode = null;
|
|
144
144
|
};
|
|
145
|
-
|
|
145
|
+
chunk2Y5US35K_cjs.createEffect(() => {
|
|
146
146
|
const node = children2();
|
|
147
147
|
removeMountedNode();
|
|
148
148
|
mountedNode = node;
|
|
@@ -161,9 +161,9 @@ function createErrorBoundary(tryFn, catchFn) {
|
|
|
161
161
|
const fragment2 = document.createDocumentFragment();
|
|
162
162
|
fragment2.appendChild(startMarker);
|
|
163
163
|
fragment2.appendChild(endMarker);
|
|
164
|
-
const [retryCount, setRetryCount] =
|
|
164
|
+
const [retryCount, setRetryCount] = chunkW7OUWVRA_cjs.createSignal(0);
|
|
165
165
|
let currentNode = null;
|
|
166
|
-
|
|
166
|
+
chunk2Y5US35K_cjs.internalEffect(() => {
|
|
167
167
|
retryCount();
|
|
168
168
|
const parent2 = startMarker.parentNode;
|
|
169
169
|
if (!parent2) return;
|
|
@@ -191,7 +191,7 @@ function createSuspense(fallback, children2) {
|
|
|
191
191
|
const fragment2 = document.createDocumentFragment();
|
|
192
192
|
fragment2.appendChild(startMarker);
|
|
193
193
|
fragment2.appendChild(endMarker);
|
|
194
|
-
const [pending, setPending] =
|
|
194
|
+
const [pending, setPending] = chunkW7OUWVRA_cjs.createSignal(0);
|
|
195
195
|
let currentNode = null;
|
|
196
196
|
let resolvedNode = null;
|
|
197
197
|
let fallbackNode = null;
|
|
@@ -203,13 +203,13 @@ function createSuspense(fallback, children2) {
|
|
|
203
203
|
setPending((p) => Math.max(0, p - 1));
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
|
-
|
|
206
|
+
chunk2Y5US35K_cjs.pushSuspenseContext(ctx);
|
|
207
207
|
try {
|
|
208
208
|
resolvedNode = children2();
|
|
209
209
|
} finally {
|
|
210
|
-
|
|
210
|
+
chunk2Y5US35K_cjs.popSuspenseContext();
|
|
211
211
|
}
|
|
212
|
-
|
|
212
|
+
chunk2Y5US35K_cjs.internalEffect(() => {
|
|
213
213
|
const parent2 = startMarker.parentNode;
|
|
214
214
|
if (!parent2) return;
|
|
215
215
|
const isPending = pending() > 0;
|
|
@@ -276,7 +276,7 @@ function activateIslands(registry) {
|
|
|
276
276
|
const componentName = root.getAttribute("data-forma-component");
|
|
277
277
|
const hydrateFn = registry[componentName];
|
|
278
278
|
if (!hydrateFn) {
|
|
279
|
-
if (
|
|
279
|
+
if (chunkW7OUWVRA_cjs.__DEV__) console.warn(`[forma] No hydrate function for island "${componentName}" (id=${id})`);
|
|
280
280
|
root.setAttribute("data-forma-status", "error");
|
|
281
281
|
continue;
|
|
282
282
|
}
|
|
@@ -332,13 +332,13 @@ function hydrateIslandRoot(root, id, componentName, hydrateFn, sharedProps) {
|
|
|
332
332
|
const props = loadIslandProps(root, id, sharedProps);
|
|
333
333
|
root.setAttribute("data-forma-status", "hydrating");
|
|
334
334
|
let activeRoot = root;
|
|
335
|
-
|
|
336
|
-
activeRoot =
|
|
335
|
+
chunk2Y5US35K_cjs.createUnownedRoot((dispose) => {
|
|
336
|
+
activeRoot = chunkJRQNDXX7_cjs.hydrateIsland(() => hydrateFn(root, props), root);
|
|
337
337
|
activeRoot.__formaDispose = dispose;
|
|
338
338
|
});
|
|
339
339
|
activeRoot.setAttribute("data-forma-status", "active");
|
|
340
340
|
} catch (err) {
|
|
341
|
-
if (
|
|
341
|
+
if (chunkW7OUWVRA_cjs.__DEV__) console.error(`[forma] Island "${componentName}" (id=${id}) failed:`, err);
|
|
342
342
|
root.setAttribute("data-forma-status", "error");
|
|
343
343
|
}
|
|
344
344
|
}
|
|
@@ -387,14 +387,14 @@ function defineComponent(setupOrDef) {
|
|
|
387
387
|
try {
|
|
388
388
|
cb();
|
|
389
389
|
} catch (e) {
|
|
390
|
-
|
|
390
|
+
chunkW7OUWVRA_cjs.reportError(e, "onUnmount");
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
for (const d of ctx.disposers) {
|
|
394
394
|
try {
|
|
395
395
|
d();
|
|
396
396
|
} catch (e) {
|
|
397
|
-
|
|
397
|
+
chunkW7OUWVRA_cjs.reportError(e, "component disposer");
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
ctx.disposers.length = 0;
|
|
@@ -409,7 +409,7 @@ function defineComponent(setupOrDef) {
|
|
|
409
409
|
ctx.unmountCallbacks.push(cleanup2);
|
|
410
410
|
}
|
|
411
411
|
} catch (e) {
|
|
412
|
-
|
|
412
|
+
chunkW7OUWVRA_cjs.reportError(e, "onMount");
|
|
413
413
|
}
|
|
414
414
|
}
|
|
415
415
|
return dom;
|
|
@@ -512,7 +512,7 @@ function createStore(initial) {
|
|
|
512
512
|
function getSignal(path, initialValue) {
|
|
513
513
|
let pair = signals.get(path);
|
|
514
514
|
if (!pair) {
|
|
515
|
-
pair =
|
|
515
|
+
pair = chunkW7OUWVRA_cjs.createSignal(initialValue);
|
|
516
516
|
signals.set(path, pair);
|
|
517
517
|
registerChild(path);
|
|
518
518
|
}
|
|
@@ -552,7 +552,7 @@ function createStore(initial) {
|
|
|
552
552
|
if (isArr && ARRAY_MUTATORS.has(key)) {
|
|
553
553
|
return (...args) => {
|
|
554
554
|
let result;
|
|
555
|
-
|
|
555
|
+
chunk2Y5US35K_cjs.batch(() => {
|
|
556
556
|
const rawArgs = args.map(
|
|
557
557
|
(a) => a != null && typeof a === "object" && a[RAW] ? a[RAW] : a
|
|
558
558
|
);
|
|
@@ -666,11 +666,11 @@ function createStore(initial) {
|
|
|
666
666
|
}
|
|
667
667
|
const rootProxy = wrap(initial, "");
|
|
668
668
|
function getCurrentSnapshot() {
|
|
669
|
-
return
|
|
669
|
+
return chunk2Y5US35K_cjs.untrack(() => deepClone(initial));
|
|
670
670
|
}
|
|
671
671
|
const setter = (partial) => {
|
|
672
672
|
const updates = typeof partial === "function" ? partial(getCurrentSnapshot()) : partial;
|
|
673
|
-
|
|
673
|
+
chunk2Y5US35K_cjs.batch(() => {
|
|
674
674
|
for (const key of Object.keys(updates)) {
|
|
675
675
|
rootProxy[key] = updates[key];
|
|
676
676
|
}
|
|
@@ -685,11 +685,11 @@ function createHistory(source, options) {
|
|
|
685
685
|
const maxLength = options?.maxLength ?? 100;
|
|
686
686
|
let _stack = [sourceGet()];
|
|
687
687
|
let _cursor = 0;
|
|
688
|
-
const [stackSignal, setStackSignal] =
|
|
689
|
-
const [cursorSignal, setCursorSignal] =
|
|
690
|
-
const [stackLenSignal, setStackLenSignal] =
|
|
688
|
+
const [stackSignal, setStackSignal] = chunkW7OUWVRA_cjs.createSignal([..._stack]);
|
|
689
|
+
const [cursorSignal, setCursorSignal] = chunkW7OUWVRA_cjs.createSignal(_cursor);
|
|
690
|
+
const [stackLenSignal, setStackLenSignal] = chunkW7OUWVRA_cjs.createSignal(_stack.length);
|
|
691
691
|
function syncSignals() {
|
|
692
|
-
|
|
692
|
+
chunk2Y5US35K_cjs.batch(() => {
|
|
693
693
|
setStackSignal([..._stack]);
|
|
694
694
|
setCursorSignal(_cursor);
|
|
695
695
|
setStackLenSignal(_stack.length);
|
|
@@ -697,7 +697,7 @@ function createHistory(source, options) {
|
|
|
697
697
|
}
|
|
698
698
|
let ignoreNext = false;
|
|
699
699
|
let isFirstRun = true;
|
|
700
|
-
|
|
700
|
+
chunk2Y5US35K_cjs.internalEffect(() => {
|
|
701
701
|
const value = sourceGet();
|
|
702
702
|
if (isFirstRun) {
|
|
703
703
|
isFirstRun = false;
|
|
@@ -765,7 +765,7 @@ function persist(source, key, options) {
|
|
|
765
765
|
}
|
|
766
766
|
} catch {
|
|
767
767
|
}
|
|
768
|
-
|
|
768
|
+
chunk2Y5US35K_cjs.internalEffect(() => {
|
|
769
769
|
const value = sourceGet();
|
|
770
770
|
try {
|
|
771
771
|
const serialized = serialize(value);
|
|
@@ -1023,115 +1023,115 @@ function onMutation(el, handler, options) {
|
|
|
1023
1023
|
|
|
1024
1024
|
Object.defineProperty(exports, "Fragment", {
|
|
1025
1025
|
enumerable: true,
|
|
1026
|
-
get: function () { return
|
|
1026
|
+
get: function () { return chunkJRQNDXX7_cjs.Fragment; }
|
|
1027
1027
|
});
|
|
1028
1028
|
Object.defineProperty(exports, "cleanup", {
|
|
1029
1029
|
enumerable: true,
|
|
1030
|
-
get: function () { return
|
|
1030
|
+
get: function () { return chunkJRQNDXX7_cjs.cleanup; }
|
|
1031
1031
|
});
|
|
1032
1032
|
Object.defineProperty(exports, "createList", {
|
|
1033
1033
|
enumerable: true,
|
|
1034
|
-
get: function () { return
|
|
1034
|
+
get: function () { return chunkJRQNDXX7_cjs.createList; }
|
|
1035
1035
|
});
|
|
1036
1036
|
Object.defineProperty(exports, "createShow", {
|
|
1037
1037
|
enumerable: true,
|
|
1038
|
-
get: function () { return
|
|
1038
|
+
get: function () { return chunkJRQNDXX7_cjs.createShow; }
|
|
1039
1039
|
});
|
|
1040
1040
|
Object.defineProperty(exports, "fragment", {
|
|
1041
1041
|
enumerable: true,
|
|
1042
|
-
get: function () { return
|
|
1042
|
+
get: function () { return chunkJRQNDXX7_cjs.fragment; }
|
|
1043
1043
|
});
|
|
1044
1044
|
Object.defineProperty(exports, "h", {
|
|
1045
1045
|
enumerable: true,
|
|
1046
|
-
get: function () { return
|
|
1046
|
+
get: function () { return chunkJRQNDXX7_cjs.h; }
|
|
1047
1047
|
});
|
|
1048
1048
|
Object.defineProperty(exports, "hydrateIsland", {
|
|
1049
1049
|
enumerable: true,
|
|
1050
|
-
get: function () { return
|
|
1050
|
+
get: function () { return chunkJRQNDXX7_cjs.hydrateIsland; }
|
|
1051
1051
|
});
|
|
1052
1052
|
Object.defineProperty(exports, "reconcileList", {
|
|
1053
1053
|
enumerable: true,
|
|
1054
|
-
get: function () { return
|
|
1054
|
+
get: function () { return chunkJRQNDXX7_cjs.reconcileList; }
|
|
1055
1055
|
});
|
|
1056
1056
|
Object.defineProperty(exports, "batch", {
|
|
1057
1057
|
enumerable: true,
|
|
1058
|
-
get: function () { return
|
|
1058
|
+
get: function () { return chunk2Y5US35K_cjs.batch; }
|
|
1059
1059
|
});
|
|
1060
1060
|
Object.defineProperty(exports, "createEffect", {
|
|
1061
1061
|
enumerable: true,
|
|
1062
|
-
get: function () { return
|
|
1062
|
+
get: function () { return chunk2Y5US35K_cjs.createEffect; }
|
|
1063
1063
|
});
|
|
1064
1064
|
Object.defineProperty(exports, "createMemo", {
|
|
1065
1065
|
enumerable: true,
|
|
1066
|
-
get: function () { return
|
|
1066
|
+
get: function () { return chunk2Y5US35K_cjs.createMemo; }
|
|
1067
1067
|
});
|
|
1068
1068
|
Object.defineProperty(exports, "createReducer", {
|
|
1069
1069
|
enumerable: true,
|
|
1070
|
-
get: function () { return
|
|
1070
|
+
get: function () { return chunk2Y5US35K_cjs.createReducer; }
|
|
1071
1071
|
});
|
|
1072
1072
|
Object.defineProperty(exports, "createRef", {
|
|
1073
1073
|
enumerable: true,
|
|
1074
|
-
get: function () { return
|
|
1074
|
+
get: function () { return chunk2Y5US35K_cjs.createRef; }
|
|
1075
1075
|
});
|
|
1076
1076
|
Object.defineProperty(exports, "createResource", {
|
|
1077
1077
|
enumerable: true,
|
|
1078
|
-
get: function () { return
|
|
1078
|
+
get: function () { return chunk2Y5US35K_cjs.createResource; }
|
|
1079
1079
|
});
|
|
1080
1080
|
Object.defineProperty(exports, "createRoot", {
|
|
1081
1081
|
enumerable: true,
|
|
1082
|
-
get: function () { return
|
|
1082
|
+
get: function () { return chunk2Y5US35K_cjs.createRoot; }
|
|
1083
1083
|
});
|
|
1084
1084
|
Object.defineProperty(exports, "createUnownedRoot", {
|
|
1085
1085
|
enumerable: true,
|
|
1086
|
-
get: function () { return
|
|
1086
|
+
get: function () { return chunk2Y5US35K_cjs.createUnownedRoot; }
|
|
1087
1087
|
});
|
|
1088
1088
|
Object.defineProperty(exports, "getBatchDepth", {
|
|
1089
1089
|
enumerable: true,
|
|
1090
|
-
get: function () { return
|
|
1090
|
+
get: function () { return chunk2Y5US35K_cjs.getBatchDepth; }
|
|
1091
1091
|
});
|
|
1092
1092
|
Object.defineProperty(exports, "isComputed", {
|
|
1093
1093
|
enumerable: true,
|
|
1094
|
-
get: function () { return
|
|
1094
|
+
get: function () { return chunk2Y5US35K_cjs.isComputed; }
|
|
1095
1095
|
});
|
|
1096
1096
|
Object.defineProperty(exports, "isEffect", {
|
|
1097
1097
|
enumerable: true,
|
|
1098
|
-
get: function () { return
|
|
1098
|
+
get: function () { return chunk2Y5US35K_cjs.isEffect; }
|
|
1099
1099
|
});
|
|
1100
1100
|
Object.defineProperty(exports, "isEffectScope", {
|
|
1101
1101
|
enumerable: true,
|
|
1102
|
-
get: function () { return
|
|
1102
|
+
get: function () { return chunk2Y5US35K_cjs.isEffectScope; }
|
|
1103
1103
|
});
|
|
1104
1104
|
Object.defineProperty(exports, "isSignal", {
|
|
1105
1105
|
enumerable: true,
|
|
1106
|
-
get: function () { return
|
|
1106
|
+
get: function () { return chunk2Y5US35K_cjs.isSignal; }
|
|
1107
1107
|
});
|
|
1108
1108
|
Object.defineProperty(exports, "on", {
|
|
1109
1109
|
enumerable: true,
|
|
1110
|
-
get: function () { return
|
|
1110
|
+
get: function () { return chunk2Y5US35K_cjs.on; }
|
|
1111
1111
|
});
|
|
1112
1112
|
Object.defineProperty(exports, "onCleanup", {
|
|
1113
1113
|
enumerable: true,
|
|
1114
|
-
get: function () { return
|
|
1115
|
-
});
|
|
1116
|
-
Object.defineProperty(exports, "onError", {
|
|
1117
|
-
enumerable: true,
|
|
1118
|
-
get: function () { return chunk6FW5E54W_cjs.onError; }
|
|
1114
|
+
get: function () { return chunk2Y5US35K_cjs.onCleanup; }
|
|
1119
1115
|
});
|
|
1120
1116
|
Object.defineProperty(exports, "trigger", {
|
|
1121
1117
|
enumerable: true,
|
|
1122
|
-
get: function () { return
|
|
1118
|
+
get: function () { return chunk2Y5US35K_cjs.trigger; }
|
|
1123
1119
|
});
|
|
1124
1120
|
Object.defineProperty(exports, "untrack", {
|
|
1125
1121
|
enumerable: true,
|
|
1126
|
-
get: function () { return
|
|
1122
|
+
get: function () { return chunk2Y5US35K_cjs.untrack; }
|
|
1127
1123
|
});
|
|
1128
1124
|
Object.defineProperty(exports, "createComputed", {
|
|
1129
1125
|
enumerable: true,
|
|
1130
|
-
get: function () { return
|
|
1126
|
+
get: function () { return chunkW7OUWVRA_cjs.createComputed; }
|
|
1131
1127
|
});
|
|
1132
1128
|
Object.defineProperty(exports, "createSignal", {
|
|
1133
1129
|
enumerable: true,
|
|
1134
|
-
get: function () { return
|
|
1130
|
+
get: function () { return chunkW7OUWVRA_cjs.createSignal; }
|
|
1131
|
+
});
|
|
1132
|
+
Object.defineProperty(exports, "onError", {
|
|
1133
|
+
enumerable: true,
|
|
1134
|
+
get: function () { return chunkW7OUWVRA_cjs.onError; }
|
|
1135
1135
|
});
|
|
1136
1136
|
exports.$ = $;
|
|
1137
1137
|
exports.$$ = $$;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="./jsx.d.ts" />
|
|
2
|
-
import { S as SignalGetter } from './signal-
|
|
3
|
-
export { a as SignalOptions, b as SignalSetter, c as createSignal } from './signal-
|
|
4
|
-
export { R as Resource, a as ResourceOptions, c as createResource } from './resource-
|
|
2
|
+
import { S as SignalGetter } from './signal-CRBJYQ6B.cjs';
|
|
3
|
+
export { a as SignalOptions, b as SignalSetter, c as createSignal } from './signal-CRBJYQ6B.cjs';
|
|
4
|
+
export { R as Resource, a as ResourceOptions, c as createResource } from './resource-D6HfVgiA.cjs';
|
|
5
5
|
export { getBatchDepth, isComputed, isEffect, isEffectScope, isSignal, trigger } from 'alien-signals';
|
|
6
6
|
|
|
7
7
|
declare function createEffect(fn: () => void | (() => void)): () => void;
|
|
@@ -125,21 +125,6 @@ declare function batch(fn: () => void): void;
|
|
|
125
125
|
*/
|
|
126
126
|
declare function untrack<T>(fn: () => T): T;
|
|
127
127
|
|
|
128
|
-
/**
|
|
129
|
-
* Forma Reactive - Root
|
|
130
|
-
*
|
|
131
|
-
* Explicit reactive ownership scope. All effects created inside a root
|
|
132
|
-
* are automatically disposed when the root is torn down.
|
|
133
|
-
*
|
|
134
|
-
* Uses alien-signals' `effectScope` under the hood for native graph-level
|
|
135
|
-
* effect tracking, with a userland disposer list for non-effect cleanup
|
|
136
|
-
* (e.g., event listeners, DOM references, timers).
|
|
137
|
-
*
|
|
138
|
-
* Roots created inside another root are automatically owned by the parent
|
|
139
|
-
* (Solid-style). When the parent is disposed, all child roots are disposed
|
|
140
|
-
* too. Use {@link createUnownedRoot} for roots that must outlive their
|
|
141
|
-
* lexical parent (e.g., mount points, test harnesses).
|
|
142
|
-
*/
|
|
143
128
|
/**
|
|
144
129
|
* Create a reactive root scope.
|
|
145
130
|
*
|
|
@@ -312,22 +297,23 @@ type Dispatch<A> = (action: A) => void;
|
|
|
312
297
|
*/
|
|
313
298
|
declare function createReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S): [state: SignalGetter<S>, dispatch: Dispatch<A>];
|
|
314
299
|
|
|
315
|
-
/** Callback signature for
|
|
300
|
+
/** Callback signature for a global {@link onError} handler. */
|
|
316
301
|
type ErrorHandler = (error: unknown, info?: {
|
|
317
302
|
source?: string;
|
|
318
303
|
}) => void;
|
|
319
304
|
/**
|
|
320
|
-
* Install a global error handler for FormaJS reactive errors.
|
|
321
|
-
*
|
|
305
|
+
* Install a global error handler for FormaJS reactive errors. Called when
|
|
306
|
+
* effects, computeds, or event handlers throw. Multiple handlers may be
|
|
307
|
+
* registered; returns an unsubscribe function that removes only this handler.
|
|
322
308
|
*
|
|
323
309
|
* ```ts
|
|
324
|
-
* onError((err, info) => {
|
|
325
|
-
*
|
|
326
|
-
* Sentry.captureException(err);
|
|
310
|
+
* const off = onError((err, info) => {
|
|
311
|
+
* Sentry.captureException(err, { tags: { source: info?.source } });
|
|
327
312
|
* });
|
|
313
|
+
* // later: off();
|
|
328
314
|
* ```
|
|
329
315
|
*/
|
|
330
|
-
declare function onError(handler: ErrorHandler): void;
|
|
316
|
+
declare function onError(handler: ErrorHandler): () => void;
|
|
331
317
|
|
|
332
318
|
/**
|
|
333
319
|
* Forma DOM - Element
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference path="./jsx.d.ts" />
|
|
2
|
-
import { S as SignalGetter } from './signal-
|
|
3
|
-
export { a as SignalOptions, b as SignalSetter, c as createSignal } from './signal-
|
|
4
|
-
export { R as Resource, a as ResourceOptions, c as createResource } from './resource-
|
|
2
|
+
import { S as SignalGetter } from './signal-CRBJYQ6B.js';
|
|
3
|
+
export { a as SignalOptions, b as SignalSetter, c as createSignal } from './signal-CRBJYQ6B.js';
|
|
4
|
+
export { R as Resource, a as ResourceOptions, c as createResource } from './resource-ljs2X5NM.js';
|
|
5
5
|
export { getBatchDepth, isComputed, isEffect, isEffectScope, isSignal, trigger } from 'alien-signals';
|
|
6
6
|
|
|
7
7
|
declare function createEffect(fn: () => void | (() => void)): () => void;
|
|
@@ -125,21 +125,6 @@ declare function batch(fn: () => void): void;
|
|
|
125
125
|
*/
|
|
126
126
|
declare function untrack<T>(fn: () => T): T;
|
|
127
127
|
|
|
128
|
-
/**
|
|
129
|
-
* Forma Reactive - Root
|
|
130
|
-
*
|
|
131
|
-
* Explicit reactive ownership scope. All effects created inside a root
|
|
132
|
-
* are automatically disposed when the root is torn down.
|
|
133
|
-
*
|
|
134
|
-
* Uses alien-signals' `effectScope` under the hood for native graph-level
|
|
135
|
-
* effect tracking, with a userland disposer list for non-effect cleanup
|
|
136
|
-
* (e.g., event listeners, DOM references, timers).
|
|
137
|
-
*
|
|
138
|
-
* Roots created inside another root are automatically owned by the parent
|
|
139
|
-
* (Solid-style). When the parent is disposed, all child roots are disposed
|
|
140
|
-
* too. Use {@link createUnownedRoot} for roots that must outlive their
|
|
141
|
-
* lexical parent (e.g., mount points, test harnesses).
|
|
142
|
-
*/
|
|
143
128
|
/**
|
|
144
129
|
* Create a reactive root scope.
|
|
145
130
|
*
|
|
@@ -312,22 +297,23 @@ type Dispatch<A> = (action: A) => void;
|
|
|
312
297
|
*/
|
|
313
298
|
declare function createReducer<S, A>(reducer: (state: S, action: A) => S, initialState: S): [state: SignalGetter<S>, dispatch: Dispatch<A>];
|
|
314
299
|
|
|
315
|
-
/** Callback signature for
|
|
300
|
+
/** Callback signature for a global {@link onError} handler. */
|
|
316
301
|
type ErrorHandler = (error: unknown, info?: {
|
|
317
302
|
source?: string;
|
|
318
303
|
}) => void;
|
|
319
304
|
/**
|
|
320
|
-
* Install a global error handler for FormaJS reactive errors.
|
|
321
|
-
*
|
|
305
|
+
* Install a global error handler for FormaJS reactive errors. Called when
|
|
306
|
+
* effects, computeds, or event handlers throw. Multiple handlers may be
|
|
307
|
+
* registered; returns an unsubscribe function that removes only this handler.
|
|
322
308
|
*
|
|
323
309
|
* ```ts
|
|
324
|
-
* onError((err, info) => {
|
|
325
|
-
*
|
|
326
|
-
* Sentry.captureException(err);
|
|
310
|
+
* const off = onError((err, info) => {
|
|
311
|
+
* Sentry.captureException(err, { tags: { source: info?.source } });
|
|
327
312
|
* });
|
|
313
|
+
* // later: off();
|
|
328
314
|
* ```
|
|
329
315
|
*/
|
|
330
|
-
declare function onError(handler: ErrorHandler): void;
|
|
316
|
+
declare function onError(handler: ErrorHandler): () => void;
|
|
331
317
|
|
|
332
318
|
/**
|
|
333
319
|
* Forma DOM - Element
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { hydrateIsland } from './chunk-
|
|
2
|
-
export { Fragment, cleanup, createList, createShow, fragment, h, hydrateIsland, reconcileList } from './chunk-
|
|
3
|
-
import { internalEffect, createUnownedRoot, createRoot, untrack, registerDisposer, createEffect, pushSuspenseContext, popSuspenseContext,
|
|
4
|
-
export { batch, createEffect, createMemo, createReducer, createRef, createResource, createRoot, createUnownedRoot, getBatchDepth, isComputed, isEffect, isEffectScope, isSignal, on, onCleanup,
|
|
5
|
-
import { createSignal } from './chunk-
|
|
6
|
-
export { createComputed, createSignal } from './chunk-
|
|
1
|
+
import { hydrateIsland } from './chunk-MIOMT2CB.js';
|
|
2
|
+
export { Fragment, cleanup, createList, createShow, fragment, h, hydrateIsland, reconcileList } from './chunk-MIOMT2CB.js';
|
|
3
|
+
import { internalEffect, createUnownedRoot, createRoot, untrack, registerDisposer, createEffect, pushSuspenseContext, popSuspenseContext, batch } from './chunk-INNOI6TG.js';
|
|
4
|
+
export { batch, createEffect, createMemo, createReducer, createRef, createResource, createRoot, createUnownedRoot, getBatchDepth, isComputed, isEffect, isEffectScope, isSignal, on, onCleanup, trigger, untrack } from './chunk-INNOI6TG.js';
|
|
5
|
+
import { createSignal, __DEV__, reportError } from './chunk-XLVBYXOU.js';
|
|
6
|
+
export { createComputed, createSignal, onError } from './chunk-XLVBYXOU.js';
|
|
7
7
|
|
|
8
8
|
// src/dom/text.ts
|
|
9
9
|
function createText(value) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SignalGetter } from './signal-
|
|
1
|
+
import { S as SignalGetter } from './signal-CRBJYQ6B.cjs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Forma Reactive - Resource
|
|
@@ -10,6 +10,11 @@ import { S as SignalGetter } from './signal-C9v4akyJ.cjs';
|
|
|
10
10
|
* React equivalent: use() + Suspense (React 19), or useSWR/react-query
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/** Info passed to a resource fetcher — carries the AbortSignal for this fetch. */
|
|
14
|
+
interface ResourceFetcherInfo {
|
|
15
|
+
/** Aborted when the source changes / the resource refetches or is disposed. */
|
|
16
|
+
signal: AbortSignal;
|
|
17
|
+
}
|
|
13
18
|
/** An async data resource with reactive loading and error state. */
|
|
14
19
|
interface Resource<T> {
|
|
15
20
|
/** The resolved data (or undefined while loading). */
|
|
@@ -59,6 +64,6 @@ interface ResourceOptions<T> {
|
|
|
59
64
|
* );
|
|
60
65
|
* ```
|
|
61
66
|
*/
|
|
62
|
-
declare function createResource<T, S = true>(source: SignalGetter<S>, fetcher: (source: S) => Promise<T>, options?: ResourceOptions<T>): Resource<T>;
|
|
67
|
+
declare function createResource<T, S = true>(source: SignalGetter<S>, fetcher: (source: S, info: ResourceFetcherInfo) => Promise<T>, options?: ResourceOptions<T>): Resource<T>;
|
|
63
68
|
|
|
64
69
|
export { type Resource as R, type ResourceOptions as a, createResource as c };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { S as SignalGetter } from './signal-
|
|
1
|
+
import { S as SignalGetter } from './signal-CRBJYQ6B.js';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Forma Reactive - Resource
|
|
@@ -10,6 +10,11 @@ import { S as SignalGetter } from './signal-C9v4akyJ.js';
|
|
|
10
10
|
* React equivalent: use() + Suspense (React 19), or useSWR/react-query
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/** Info passed to a resource fetcher — carries the AbortSignal for this fetch. */
|
|
14
|
+
interface ResourceFetcherInfo {
|
|
15
|
+
/** Aborted when the source changes / the resource refetches or is disposed. */
|
|
16
|
+
signal: AbortSignal;
|
|
17
|
+
}
|
|
13
18
|
/** An async data resource with reactive loading and error state. */
|
|
14
19
|
interface Resource<T> {
|
|
15
20
|
/** The resolved data (or undefined while loading). */
|
|
@@ -59,6 +64,6 @@ interface ResourceOptions<T> {
|
|
|
59
64
|
* );
|
|
60
65
|
* ```
|
|
61
66
|
*/
|
|
62
|
-
declare function createResource<T, S = true>(source: SignalGetter<S>, fetcher: (source: S) => Promise<T>, options?: ResourceOptions<T>): Resource<T>;
|
|
67
|
+
declare function createResource<T, S = true>(source: SignalGetter<S>, fetcher: (source: S, info: ResourceFetcherInfo) => Promise<T>, options?: ResourceOptions<T>): Resource<T>;
|
|
63
68
|
|
|
64
69
|
export { type Resource as R, type ResourceOptions as a, createResource as c };
|