@fictjs/runtime 0.13.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/README.md +25 -0
- 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-2UR2UWE2.js → chunk-4P4DYWLQ.js} +3 -3
- package/dist/{chunk-4QGEN5SJ.cjs → chunk-AR2T7JEX.cjs} +275 -219
- package/dist/chunk-AR2T7JEX.cjs.map +1 -0
- package/dist/{chunk-FHQZCAAK.cjs → chunk-BADX4WTQ.cjs} +17 -17
- package/dist/{chunk-FHQZCAAK.cjs.map → chunk-BADX4WTQ.cjs.map} +1 -1
- package/dist/{chunk-44EQF3AR.cjs → chunk-CBRGOLTR.cjs} +40 -40
- package/dist/{chunk-44EQF3AR.cjs.map → chunk-CBRGOLTR.cjs.map} +1 -1
- package/dist/{chunk-C5IE4WUG.cjs → chunk-ECNK25S4.cjs} +8 -8
- package/dist/{chunk-C5IE4WUG.cjs.map → chunk-ECNK25S4.cjs.map} +1 -1
- package/dist/{chunk-DIK33H5U.js → chunk-MAHWGB55.js} +12 -5
- package/dist/chunk-MAHWGB55.js.map +1 -0
- package/dist/{chunk-S63VBIWN.js → chunk-RK2WSQYL.js} +3 -3
- package/dist/{chunk-QNMYVXRL.cjs → chunk-WJMZ7X46.cjs} +12 -5
- package/dist/chunk-WJMZ7X46.cjs.map +1 -0
- package/dist/{chunk-WIHNVN6L.js → chunk-ZJZ6LMDN.js} +85 -29
- package/dist/chunk-ZJZ6LMDN.js.map +1 -0
- package/dist/{chunk-FESAXMHT.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 +3 -2
- 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 +2 -2
- package/src/binding.ts +98 -27
- package/src/node-ops.ts +1 -1
- package/src/resume.ts +7 -3
- package/src/signal.ts +1 -1
- package/src/store.ts +4 -1
- package/dist/chunk-4QGEN5SJ.cjs.map +0 -1
- package/dist/chunk-DIK33H5U.js.map +0 -1
- package/dist/chunk-QNMYVXRL.cjs.map +0 -1
- package/dist/chunk-WIHNVN6L.js.map +0 -1
- /package/dist/{chunk-2UR2UWE2.js.map → chunk-4P4DYWLQ.js.map} +0 -0
- /package/dist/{chunk-S63VBIWN.js.map → chunk-RK2WSQYL.js.map} +0 -0
- /package/dist/{chunk-FESAXMHT.js.map → chunk-ZWQLXWSV.js.map} +0 -0
package/README.md
CHANGED
|
@@ -29,6 +29,31 @@ DX and dead-code elimination:
|
|
|
29
29
|
- development: `__DEV__ = true`
|
|
30
30
|
- production: `__DEV__ = false`
|
|
31
31
|
|
|
32
|
+
## Multi-Document Contract (iframe / foreign `Document`)
|
|
33
|
+
|
|
34
|
+
`@fictjs/runtime` supports rendering into containers owned by non-global documents
|
|
35
|
+
(for example, elements from an iframe document). Runtime-created nodes, markers,
|
|
36
|
+
and fragments are created from the active `ownerDocument`.
|
|
37
|
+
|
|
38
|
+
Supported contract:
|
|
39
|
+
|
|
40
|
+
- `render()` into a container from another `Document`
|
|
41
|
+
- list/conditional/suspense marker creation in that container's `ownerDocument`
|
|
42
|
+
- node insertion paths that rely on runtime-created nodes
|
|
43
|
+
|
|
44
|
+
Important caveat:
|
|
45
|
+
|
|
46
|
+
- If user code manually returns nodes created from a different document and inserts
|
|
47
|
+
them into another document tree, runtime may fall back to `adoptNode()` or
|
|
48
|
+
`importNode()` during insertion/reordering. `importNode()` clones DOM nodes and
|
|
49
|
+
does not preserve JS-side expando state or imperative listeners attached outside
|
|
50
|
+
of Fict's binding flow.
|
|
51
|
+
|
|
52
|
+
Recommendation:
|
|
53
|
+
|
|
54
|
+
- Create DOM nodes using the target container's `ownerDocument` (or let Fict create
|
|
55
|
+
nodes) when working across iframe/foreign-document boundaries.
|
|
56
|
+
|
|
32
57
|
## Runtime Stability Stress
|
|
33
58
|
|
|
34
59
|
Run stress scenarios for runtime correctness and reliability:
|
package/dist/advanced.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkBADX4WTQcjs = require('./chunk-BADX4WTQ.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkECNK25S4cjs = require('./chunk-ECNK25S4.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ var _chunkC5IE4WUGcjs = require('./chunk-C5IE4WUG.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkAR2T7JEXcjs = require('./chunk-AR2T7JEX.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -28,13 +28,13 @@ var _chunk4QGEN5SJcjs = require('./chunk-4QGEN5SJ.cjs');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkWJMZ7X46cjs = require('./chunk-WJMZ7X46.cjs');
|
|
32
32
|
|
|
33
33
|
// src/versioned-signal.ts
|
|
34
34
|
function createVersionedSignal(initialValue, options) {
|
|
35
35
|
const equals = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _ => _.equals]), () => ( Object.is));
|
|
36
|
-
const value =
|
|
37
|
-
const version =
|
|
36
|
+
const value = _chunkWJMZ7X46cjs.signal.call(void 0, initialValue);
|
|
37
|
+
const version = _chunkWJMZ7X46cjs.signal.call(void 0, 0);
|
|
38
38
|
const bumpVersion = () => {
|
|
39
39
|
const next = version() + 1;
|
|
40
40
|
version(next);
|
|
@@ -55,8 +55,8 @@ function createVersionedSignal(initialValue, options) {
|
|
|
55
55
|
force: () => {
|
|
56
56
|
bumpVersion();
|
|
57
57
|
},
|
|
58
|
-
peekVersion: () =>
|
|
59
|
-
peekValue: () =>
|
|
58
|
+
peekVersion: () => _chunkWJMZ7X46cjs.untrack.call(void 0, () => version()),
|
|
59
|
+
peekValue: () => _chunkWJMZ7X46cjs.untrack.call(void 0, () => value())
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -83,5 +83,5 @@ function createVersionedSignal(initialValue, options) {
|
|
|
83
83
|
|
|
84
84
|
|
|
85
85
|
|
|
86
|
-
exports.createAttributeBinding =
|
|
86
|
+
exports.createAttributeBinding = _chunkAR2T7JEXcjs.createAttributeBinding; exports.createChildBinding = _chunkAR2T7JEXcjs.createChildBinding; exports.createClassBinding = _chunkAR2T7JEXcjs.createClassBinding; exports.createContext = _chunkBADX4WTQcjs.createContext; exports.createRenderEffect = _chunkWJMZ7X46cjs.createRenderEffect; exports.createScope = _chunkECNK25S4cjs.createScope; exports.createSelector = _chunkWJMZ7X46cjs.createSelector; exports.createShow = _chunkAR2T7JEXcjs.createShow; exports.createSignal = _chunkWJMZ7X46cjs.signal; exports.createStyleBinding = _chunkAR2T7JEXcjs.createStyleBinding; exports.createTextBinding = _chunkAR2T7JEXcjs.createTextBinding; exports.createVersionedSignal = createVersionedSignal; exports.effectScope = _chunkWJMZ7X46cjs.effectScope; exports.getDevtoolsHook = _chunkWJMZ7X46cjs.getDevtoolsHook; exports.hasContext = _chunkBADX4WTQcjs.hasContext; exports.isReactive = _chunkAR2T7JEXcjs.isReactive; exports.nonReactive = _chunkAR2T7JEXcjs.nonReactive; exports.reactive = _chunkAR2T7JEXcjs.reactive; exports.registerErrorHandler = _chunkWJMZ7X46cjs.registerErrorHandler; exports.runInScope = _chunkECNK25S4cjs.runInScope; exports.setCycleProtectionOptions = _chunkWJMZ7X46cjs.setCycleProtectionOptions; exports.unwrap = _chunkAR2T7JEXcjs.unwrap; exports.useContext = _chunkBADX4WTQcjs.useContext;
|
|
87
87
|
//# sourceMappingURL=advanced.cjs.map
|
package/dist/advanced.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-
|
|
1
|
+
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-GwC4DJ50.cjs';
|
|
2
2
|
export { S as Signal, c as createSelector, s as createSignal, e as effectScope } from './signal-Z4KkDk9h.cjs';
|
|
3
|
-
export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-
|
|
4
|
-
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-
|
|
3
|
+
export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-BlABuUiG.cjs';
|
|
4
|
+
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-DWIZRe7L.cjs';
|
|
5
5
|
|
|
6
6
|
interface VersionedSignalOptions<T> {
|
|
7
7
|
equals?: (prev: T, next: T) => boolean;
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-
|
|
1
|
+
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-gpOMWTlf.js';
|
|
2
2
|
export { S as Signal, c as createSelector, s as createSignal, e as effectScope } from './signal-Z4KkDk9h.js';
|
|
3
|
-
export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-
|
|
4
|
-
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-
|
|
3
|
+
export { b as createAttributeBinding, a as createChildBinding, e as createClassBinding, h as createRenderEffect, f as createShow, d as createStyleBinding, c as createTextBinding, i as isReactive, n as nonReactive, r as reactive, g as registerErrorHandler, u as unwrap } from './binding-CQUGLLBI.js';
|
|
4
|
+
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './devtools-DNnnDGu1.js';
|
|
5
5
|
|
|
6
6
|
interface VersionedSignalOptions<T> {
|
|
7
7
|
equals?: (prev: T, next: T) => boolean;
|
package/dist/advanced.js
CHANGED
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
createContext,
|
|
3
3
|
hasContext,
|
|
4
4
|
useContext
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-ZWQLXWSV.js";
|
|
6
6
|
import {
|
|
7
7
|
createScope,
|
|
8
8
|
runInScope
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4P4DYWLQ.js";
|
|
10
10
|
import {
|
|
11
11
|
createAttributeBinding,
|
|
12
12
|
createChildBinding,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
nonReactive,
|
|
19
19
|
reactive,
|
|
20
20
|
unwrap
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-ZJZ6LMDN.js";
|
|
22
22
|
import {
|
|
23
23
|
createRenderEffect,
|
|
24
24
|
createSelector,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
setCycleProtectionOptions,
|
|
29
29
|
signal,
|
|
30
30
|
untrack
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-MAHWGB55.js";
|
|
32
32
|
|
|
33
33
|
// src/versioned-signal.ts
|
|
34
34
|
function createVersionedSignal(initialValue, options) {
|
|
@@ -372,7 +372,7 @@ declare function bindRef(el: Element, ref: unknown): Cleanup;
|
|
|
372
372
|
* spread(el, props, false, false)
|
|
373
373
|
* ```
|
|
374
374
|
*/
|
|
375
|
-
declare function spread(node: Element, props?: Record<string, unknown
|
|
375
|
+
declare function spread(node: Element, props?: Record<string, unknown> | (() => Record<string, unknown>), isSVG?: boolean, skipChildren?: boolean, exclude?: readonly string[]): Record<string, unknown>;
|
|
376
376
|
/**
|
|
377
377
|
* Assign props to a node, tracking previous values for efficient updates.
|
|
378
378
|
* This is the core prop assignment logic used by spread.
|
|
@@ -384,7 +384,7 @@ declare function spread(node: Element, props?: Record<string, unknown>, isSVG?:
|
|
|
384
384
|
* @param prevProps - Previous props for comparison
|
|
385
385
|
* @param skipRef - Whether to skip ref handling
|
|
386
386
|
*/
|
|
387
|
-
declare function assign(node: Element, props: Record<string, unknown>, isSVG?: boolean, skipChildren?: boolean, prevProps?: Record<string, unknown>, skipRef?: boolean): void;
|
|
387
|
+
declare function assign(node: Element, props: Record<string, unknown>, isSVG?: boolean, skipChildren?: boolean, prevProps?: Record<string, unknown>, skipRef?: boolean, excludedProps?: ReadonlySet<string>): void;
|
|
388
388
|
/**
|
|
389
389
|
* Create a conditional rendering binding.
|
|
390
390
|
* Efficiently renders one of two branches based on a condition.
|
|
@@ -372,7 +372,7 @@ declare function bindRef(el: Element, ref: unknown): Cleanup;
|
|
|
372
372
|
* spread(el, props, false, false)
|
|
373
373
|
* ```
|
|
374
374
|
*/
|
|
375
|
-
declare function spread(node: Element, props?: Record<string, unknown
|
|
375
|
+
declare function spread(node: Element, props?: Record<string, unknown> | (() => Record<string, unknown>), isSVG?: boolean, skipChildren?: boolean, exclude?: readonly string[]): Record<string, unknown>;
|
|
376
376
|
/**
|
|
377
377
|
* Assign props to a node, tracking previous values for efficient updates.
|
|
378
378
|
* This is the core prop assignment logic used by spread.
|
|
@@ -384,7 +384,7 @@ declare function spread(node: Element, props?: Record<string, unknown>, isSVG?:
|
|
|
384
384
|
* @param prevProps - Previous props for comparison
|
|
385
385
|
* @param skipRef - Whether to skip ref handling
|
|
386
386
|
*/
|
|
387
|
-
declare function assign(node: Element, props: Record<string, unknown>, isSVG?: boolean, skipChildren?: boolean, prevProps?: Record<string, unknown>, skipRef?: boolean): void;
|
|
387
|
+
declare function assign(node: Element, props: Record<string, unknown>, isSVG?: boolean, skipChildren?: boolean, prevProps?: Record<string, unknown>, skipRef?: boolean, excludedProps?: ReadonlySet<string>): void;
|
|
388
388
|
/**
|
|
389
389
|
* Create a conditional rendering binding.
|
|
390
390
|
* Efficiently renders one of two branches based on a condition.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isReactive
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZJZ6LMDN.js";
|
|
4
4
|
import {
|
|
5
5
|
createEffect,
|
|
6
6
|
createRoot,
|
|
7
7
|
onCleanup,
|
|
8
8
|
registerRootCleanup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MAHWGB55.js";
|
|
10
10
|
|
|
11
11
|
// src/scope.ts
|
|
12
12
|
function createScope() {
|
|
@@ -44,4 +44,4 @@ export {
|
|
|
44
44
|
createScope,
|
|
45
45
|
runInScope
|
|
46
46
|
};
|
|
47
|
-
//# sourceMappingURL=chunk-
|
|
47
|
+
//# sourceMappingURL=chunk-4P4DYWLQ.js.map
|