@fictjs/runtime 0.8.0 → 0.10.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 +46 -0
- package/dist/advanced.cjs +9 -9
- package/dist/advanced.d.cts +5 -5
- package/dist/advanced.d.ts +5 -5
- package/dist/advanced.js +4 -4
- package/dist/{effect-DAzpH7Mm.d.ts → binding-DUEukRxl.d.cts} +35 -24
- package/dist/{effect-DAzpH7Mm.d.cts → binding-DqxS9ZQf.d.ts} +35 -24
- package/dist/{chunk-WRU3IZOA.js → chunk-2JRPPCG7.js} +3 -3
- package/dist/{chunk-TLDT76RV.js → chunk-DKA2I6ET.js} +3 -3
- package/dist/{chunk-FSCBL7RI.cjs → chunk-EQ5E4WOV.cjs} +702 -534
- package/dist/chunk-EQ5E4WOV.cjs.map +1 -0
- package/dist/{chunk-7YQK3XKY.js → chunk-F4RVNXOL.js} +687 -519
- package/dist/chunk-F4RVNXOL.js.map +1 -0
- package/dist/{chunk-PRF4QG73.cjs → chunk-I4GKKAAY.cjs} +469 -248
- package/dist/chunk-I4GKKAAY.cjs.map +1 -0
- package/dist/{chunk-HHDHQGJY.cjs → chunk-K3DH5SD5.cjs} +17 -17
- package/dist/{chunk-HHDHQGJY.cjs.map → chunk-K3DH5SD5.cjs.map} +1 -1
- package/dist/chunk-P4TZLFV6.js +768 -0
- package/dist/chunk-P4TZLFV6.js.map +1 -0
- package/dist/{chunk-4LCHQ7U4.js → chunk-R6FINS25.js} +318 -97
- package/dist/chunk-R6FINS25.js.map +1 -0
- package/dist/chunk-SZLJCQFZ.cjs +768 -0
- package/dist/chunk-SZLJCQFZ.cjs.map +1 -0
- package/dist/{chunk-CEV6TO5U.cjs → chunk-V7BC64W2.cjs} +8 -8
- package/dist/{chunk-CEV6TO5U.cjs.map → chunk-V7BC64W2.cjs.map} +1 -1
- package/dist/{context-BFbHf9nC.d.cts → devtools-C4Hgfa-S.d.ts} +47 -35
- package/dist/{context-C4vBQbb4.d.ts → devtools-CMxlJUTx.d.cts} +47 -35
- package/dist/index.cjs +42 -42
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.dev.js +233 -28
- package/dist/index.dev.js.map +1 -1
- package/dist/index.js +3 -3
- package/dist/internal-list.cjs +12 -0
- package/dist/internal-list.cjs.map +1 -0
- package/dist/internal-list.d.cts +2 -0
- package/dist/internal-list.d.ts +2 -0
- package/dist/internal-list.js +12 -0
- package/dist/internal-list.js.map +1 -0
- package/dist/internal.cjs +6 -746
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +7 -75
- package/dist/internal.d.ts +7 -75
- package/dist/internal.js +12 -752
- package/dist/internal.js.map +1 -1
- package/dist/jsx-dev-runtime.d.cts +671 -0
- package/dist/jsx-dev-runtime.d.ts +671 -0
- package/dist/jsx-runtime.d.cts +671 -0
- package/dist/jsx-runtime.d.ts +671 -0
- package/dist/list-BBzsJhrm.d.ts +71 -0
- package/dist/list-_NJCcjl1.d.cts +71 -0
- package/dist/loader.cjs +99 -16
- package/dist/loader.cjs.map +1 -1
- package/dist/loader.d.cts +17 -3
- package/dist/loader.d.ts +17 -3
- package/dist/loader.js +92 -9
- package/dist/loader.js.map +1 -1
- package/dist/{props-84UJeWO8.d.cts → props--zJ4ebbT.d.cts} +3 -3
- package/dist/{props-BRhFK50f.d.ts → props-BAGR7j-j.d.ts} +3 -3
- package/dist/{resume-i-A3EFox.d.cts → resume-C5IKAIdh.d.ts} +5 -3
- package/dist/{resume-CqeQ3v_q.d.ts → resume-DPZxmA95.d.cts} +5 -3
- package/dist/{scope-D3DpsfoG.d.ts → scope-CuImnvh1.d.ts} +1 -1
- package/dist/{scope-DlCBL1Ft.d.cts → scope-Dq5hOu7c.d.cts} +1 -1
- package/dist/{signal-C4ISF17w.d.cts → signal-Z4KkDk9h.d.cts} +12 -1
- package/dist/{signal-C4ISF17w.d.ts → signal-Z4KkDk9h.d.ts} +12 -1
- package/package.json +9 -2
- package/src/binding.ts +113 -36
- package/src/cycle-guard.ts +3 -3
- package/src/devtools.ts +19 -2
- package/src/dom.ts +58 -4
- package/src/effect.ts +5 -5
- package/src/hooks.ts +13 -5
- package/src/internal/list.ts +7 -0
- package/src/internal.ts +1 -0
- package/src/lifecycle.ts +41 -3
- package/src/list-helpers.ts +1 -1
- package/src/loader.ts +128 -12
- package/src/resume.ts +6 -3
- package/src/signal.ts +200 -20
- package/src/transition.ts +9 -3
- package/dist/chunk-4LCHQ7U4.js.map +0 -1
- package/dist/chunk-7YQK3XKY.js.map +0 -1
- package/dist/chunk-FSCBL7RI.cjs.map +0 -1
- package/dist/chunk-PRF4QG73.cjs.map +0 -1
- /package/dist/{chunk-WRU3IZOA.js.map → chunk-2JRPPCG7.js.map} +0 -0
- /package/dist/{chunk-TLDT76RV.js.map → chunk-DKA2I6ET.js.map} +0 -0
package/README.md
CHANGED
|
@@ -15,3 +15,49 @@ yarn add @fictjs/runtime
|
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
You can visit [Fict](https://github.com/fictjs/fict) for more documentation.
|
|
18
|
+
|
|
19
|
+
## Dev/Prod Mode Contract (`__DEV__`)
|
|
20
|
+
|
|
21
|
+
Runtime dev-only branches use this precedence:
|
|
22
|
+
|
|
23
|
+
1. `__DEV__` (recommended, compile-time constant)
|
|
24
|
+
2. Fallback: `process.env.NODE_ENV !== 'production'` when `process` exists
|
|
25
|
+
|
|
26
|
+
For browser builds, define `__DEV__` explicitly in your bundler for predictable
|
|
27
|
+
DX and dead-code elimination:
|
|
28
|
+
|
|
29
|
+
- development: `__DEV__ = true`
|
|
30
|
+
- production: `__DEV__ = false`
|
|
31
|
+
|
|
32
|
+
## Runtime Stability Stress
|
|
33
|
+
|
|
34
|
+
Run stress scenarios for runtime correctness and reliability:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm --dir packages/runtime test:stress
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Long profile:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
pnpm --dir packages/runtime test:stress:long
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Root aliases are also available:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pnpm stress:runtime
|
|
50
|
+
pnpm stress:runtime:long
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Environment knobs:
|
|
54
|
+
|
|
55
|
+
- `FICT_RUNTIME_SOAK_ITERS`
|
|
56
|
+
- `FICT_RUNTIME_CHURN_CYCLES`
|
|
57
|
+
- `FICT_RUNTIME_CHURN_LIST_SIZE`
|
|
58
|
+
- `FICT_RUNTIME_LEAK_ROUNDS`
|
|
59
|
+
- `FICT_RUNTIME_LEAK_EFFECTS_PER_ROUND`
|
|
60
|
+
- `FICT_RUNTIME_MAX_HEAP_GROWTH_BYTES`
|
|
61
|
+
- `FICT_RUNTIME_BACKPRESSURE_UPDATES`
|
|
62
|
+
- `FICT_RUNTIME_BACKPRESSURE_TIMEOUT_MS`
|
|
63
|
+
- `FICT_RUNTIME_MAX_DRAIN_LATENCY_MS`
|
package/dist/advanced.cjs
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _chunkK3DH5SD5cjs = require('./chunk-K3DH5SD5.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkV7BC64W2cjs = require('./chunk-V7BC64W2.cjs');
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
@@ -18,7 +18,7 @@ var _chunkCEV6TO5Ucjs = require('./chunk-CEV6TO5U.cjs');
|
|
|
18
18
|
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
var
|
|
21
|
+
var _chunkI4GKKAAYcjs = require('./chunk-I4GKKAAY.cjs');
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
|
|
@@ -28,13 +28,13 @@ var _chunkPRF4QG73cjs = require('./chunk-PRF4QG73.cjs');
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
var
|
|
31
|
+
var _chunkEQ5E4WOVcjs = require('./chunk-EQ5E4WOV.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 = _chunkEQ5E4WOVcjs.signal.call(void 0, initialValue);
|
|
37
|
+
const version = _chunkEQ5E4WOVcjs.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: () => _chunkEQ5E4WOVcjs.untrack.call(void 0, () => version()),
|
|
59
|
+
peekValue: () => _chunkEQ5E4WOVcjs.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 = _chunkI4GKKAAYcjs.createAttributeBinding; exports.createChildBinding = _chunkI4GKKAAYcjs.createChildBinding; exports.createClassBinding = _chunkI4GKKAAYcjs.createClassBinding; exports.createContext = _chunkK3DH5SD5cjs.createContext; exports.createRenderEffect = _chunkEQ5E4WOVcjs.createRenderEffect; exports.createScope = _chunkV7BC64W2cjs.createScope; exports.createSelector = _chunkEQ5E4WOVcjs.createSelector; exports.createShow = _chunkI4GKKAAYcjs.createShow; exports.createSignal = _chunkEQ5E4WOVcjs.signal; exports.createStyleBinding = _chunkI4GKKAAYcjs.createStyleBinding; exports.createTextBinding = _chunkI4GKKAAYcjs.createTextBinding; exports.createVersionedSignal = createVersionedSignal; exports.effectScope = _chunkEQ5E4WOVcjs.effectScope; exports.getDevtoolsHook = _chunkEQ5E4WOVcjs.getDevtoolsHook; exports.hasContext = _chunkK3DH5SD5cjs.hasContext; exports.isReactive = _chunkI4GKKAAYcjs.isReactive; exports.nonReactive = _chunkI4GKKAAYcjs.nonReactive; exports.reactive = _chunkI4GKKAAYcjs.reactive; exports.registerErrorHandler = _chunkEQ5E4WOVcjs.registerErrorHandler; exports.runInScope = _chunkV7BC64W2cjs.runInScope; exports.setCycleProtectionOptions = _chunkEQ5E4WOVcjs.setCycleProtectionOptions; exports.unwrap = _chunkI4GKKAAYcjs.unwrap; exports.useContext = _chunkK3DH5SD5cjs.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-
|
|
2
|
-
export { S as Signal, c as createSelector, s as createSignal, e as effectScope } from './signal-
|
|
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 './
|
|
4
|
-
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './
|
|
1
|
+
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-Dq5hOu7c.cjs';
|
|
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-DUEukRxl.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-CMxlJUTx.cjs';
|
|
5
5
|
|
|
6
6
|
interface VersionedSignalOptions<T> {
|
|
7
7
|
equals?: (prev: T, next: T) => boolean;
|
|
@@ -26,7 +26,7 @@ interface VersionedSignal<T> {
|
|
|
26
26
|
declare function createVersionedSignal<T>(initialValue: T, options?: VersionedSignalOptions<T>): VersionedSignal<T>;
|
|
27
27
|
|
|
28
28
|
interface CycleProtectionOptions {
|
|
29
|
-
/** Enable cycle protection guards (enabled by default in
|
|
29
|
+
/** Enable cycle protection guards (enabled by default in dev mode) */
|
|
30
30
|
enabled?: boolean;
|
|
31
31
|
maxFlushCyclesPerMicrotask?: number;
|
|
32
32
|
maxEffectRunsPerFlush?: number;
|
package/dist/advanced.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-
|
|
2
|
-
export { S as Signal, c as createSelector, s as createSignal, e as effectScope } from './signal-
|
|
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 './
|
|
4
|
-
export { C as Context, F as FictDevtoolsHook, P as ProviderProps, c as createContext, g as getDevtoolsHook, h as hasContext, u as useContext } from './
|
|
1
|
+
export { R as ReactiveScope, c as createScope, r as runInScope } from './scope-CuImnvh1.js';
|
|
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-DqxS9ZQf.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-C4Hgfa-S.js';
|
|
5
5
|
|
|
6
6
|
interface VersionedSignalOptions<T> {
|
|
7
7
|
equals?: (prev: T, next: T) => boolean;
|
|
@@ -26,7 +26,7 @@ interface VersionedSignal<T> {
|
|
|
26
26
|
declare function createVersionedSignal<T>(initialValue: T, options?: VersionedSignalOptions<T>): VersionedSignal<T>;
|
|
27
27
|
|
|
28
28
|
interface CycleProtectionOptions {
|
|
29
|
-
/** Enable cycle protection guards (enabled by default in
|
|
29
|
+
/** Enable cycle protection guards (enabled by default in dev mode) */
|
|
30
30
|
enabled?: boolean;
|
|
31
31
|
maxFlushCyclesPerMicrotask?: number;
|
|
32
32
|
maxEffectRunsPerFlush?: number;
|
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-2JRPPCG7.js";
|
|
6
6
|
import {
|
|
7
7
|
createScope,
|
|
8
8
|
runInScope
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DKA2I6ET.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-R6FINS25.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-F4RVNXOL.js";
|
|
32
32
|
|
|
33
33
|
// src/versioned-signal.ts
|
|
34
34
|
function createVersionedSignal(initialValue, options) {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { E as EffectOptions } from './signal-Z4KkDk9h.cjs';
|
|
2
|
+
|
|
1
3
|
/** Any DOM node that can be rendered */
|
|
2
4
|
type DOMElement = Node;
|
|
3
5
|
/** Cleanup function type */
|
|
@@ -60,6 +62,28 @@ interface SuspenseToken {
|
|
|
60
62
|
then: Promise<unknown>['then'];
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
type LifecycleFn = () => void | Cleanup;
|
|
66
|
+
interface CreateRootOptions {
|
|
67
|
+
inherit?: boolean;
|
|
68
|
+
}
|
|
69
|
+
type ErrorHandler = (err: unknown, info?: ErrorInfo) => boolean | void;
|
|
70
|
+
declare function onMount(fn: LifecycleFn): void;
|
|
71
|
+
declare function onDestroy(fn: LifecycleFn): void;
|
|
72
|
+
declare function onCleanup(fn: Cleanup): void;
|
|
73
|
+
declare function createRoot<T>(fn: () => T, options?: CreateRootOptions): {
|
|
74
|
+
dispose: () => void;
|
|
75
|
+
value: T;
|
|
76
|
+
};
|
|
77
|
+
declare function registerErrorHandler(fn: ErrorHandler): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Effect callback run synchronously; async callbacks are not tracked after the first await.
|
|
81
|
+
* TypeScript will reject `async () => {}` here—split async work or read signals before awaiting.
|
|
82
|
+
*/
|
|
83
|
+
type Effect = () => void | Cleanup;
|
|
84
|
+
declare function createEffect(fn: Effect, options?: EffectOptions): () => void;
|
|
85
|
+
declare function createRenderEffect(fn: Effect, options?: EffectOptions): () => void;
|
|
86
|
+
|
|
63
87
|
/**
|
|
64
88
|
* Fict Reactive DOM Binding System
|
|
65
89
|
*
|
|
@@ -86,6 +110,15 @@ interface BindingHandle {
|
|
|
86
110
|
/** Dispose function to clean up the binding */
|
|
87
111
|
dispose: Cleanup;
|
|
88
112
|
}
|
|
113
|
+
interface ConditionalBindingOptions {
|
|
114
|
+
/**
|
|
115
|
+
* When true, track signal reads inside active branch render callbacks and
|
|
116
|
+
* re-run the branch callback on updates even if the top-level condition stays
|
|
117
|
+
* the same. This preserves reactivity for control-flow callbacks that cannot
|
|
118
|
+
* be lowered into fine-grained bindings.
|
|
119
|
+
*/
|
|
120
|
+
trackBranchReads?: boolean;
|
|
121
|
+
}
|
|
89
122
|
/** Managed child node with its dispose function */
|
|
90
123
|
/**
|
|
91
124
|
* Check if a value is reactive (a getter function that returns a value).
|
|
@@ -370,7 +403,7 @@ declare function assign(node: Element, props: Record<string, unknown>, isSVG?: b
|
|
|
370
403
|
* )
|
|
371
404
|
* ```
|
|
372
405
|
*/
|
|
373
|
-
declare function createConditional(condition: () => boolean, renderTrue: () => FictNode, createElementFn: CreateElementFn, renderFalse?: () => FictNode, startOverride?: Comment, endOverride?: Comment): BindingHandle;
|
|
406
|
+
declare function createConditional(condition: () => boolean, renderTrue: () => FictNode, createElementFn: CreateElementFn, renderFalse?: () => FictNode, startOverride?: Comment, endOverride?: Comment, options?: ConditionalBindingOptions): BindingHandle;
|
|
374
407
|
/**
|
|
375
408
|
* Create a show/hide binding that uses CSS display instead of DOM manipulation.
|
|
376
409
|
* More efficient than conditional when the content is expensive to create.
|
|
@@ -397,26 +430,4 @@ declare function createShow(el: Element & {
|
|
|
397
430
|
*/
|
|
398
431
|
declare function createPortal(container: ParentNode & Node, render: () => FictNode, createElementFn: CreateElementFn): BindingHandle;
|
|
399
432
|
|
|
400
|
-
type
|
|
401
|
-
interface CreateRootOptions {
|
|
402
|
-
inherit?: boolean;
|
|
403
|
-
}
|
|
404
|
-
type ErrorHandler = (err: unknown, info?: ErrorInfo) => boolean | void;
|
|
405
|
-
declare function onMount(fn: LifecycleFn): void;
|
|
406
|
-
declare function onDestroy(fn: LifecycleFn): void;
|
|
407
|
-
declare function onCleanup(fn: Cleanup): void;
|
|
408
|
-
declare function createRoot<T>(fn: () => T, options?: CreateRootOptions): {
|
|
409
|
-
dispose: () => void;
|
|
410
|
-
value: T;
|
|
411
|
-
};
|
|
412
|
-
declare function registerErrorHandler(fn: ErrorHandler): void;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Effect callback run synchronously; async callbacks are not tracked after the first await.
|
|
416
|
-
* TypeScript will reject `async () => {}` here—split async work or read signals before awaiting.
|
|
417
|
-
*/
|
|
418
|
-
type Effect = () => void | Cleanup;
|
|
419
|
-
declare function createEffect(fn: Effect): () => void;
|
|
420
|
-
declare function createRenderEffect(fn: Effect): () => void;
|
|
421
|
-
|
|
422
|
-
export { delegateEvents as $, bindText as A, type BaseProps as B, type Cleanup as C, type DOMElement as D, type Effect as E, type FictNode as F, bindAttribute as G, bindStyle as H, bindClass as I, setText as J, setAttr as K, setProp as L, setStyle as M, setClass as N, bindEvent as O, type PropsWithChildren as P, callEventHandler as Q, type RefObject as R, type SuspenseToken as S, bindProperty as T, bindRef as U, insert as V, insertBetween as W, createConditional as X, spread as Y, assign as Z, classList as _, createChildBinding as a, clearDelegatedEvents as a0, addEventListener as a1, type MaybeReactive as a2, type BindingHandle as a3, type CreateElementFn as a4, type AttributeSetter as a5, createAttributeBinding as b, createTextBinding as c, createStyleBinding as d, createClassBinding as e, createShow as f, registerErrorHandler as g, createRenderEffect as h, isReactive as i, createEffect as j, onDestroy as k, onCleanup as l, createRoot as m, nonReactive as n, onMount as o, createPortal as p, type FictVNode as q, reactive as r, type Component as s, type Ref as t, unwrap as u, type RefCallback as v, type StyleProp as w, type ClassProp as x, type EventHandler as y, type ErrorInfo as z };
|
|
433
|
+
export { type PropsWithChildren as $, insert as A, type BaseProps as B, insertBetween as C, createConditional as D, createPortal as E, type FictNode as F, spread as G, assign as H, classList as I, delegateEvents as J, clearDelegatedEvents as K, addEventListener as L, type MaybeReactive as M, onDestroy as N, type BindingHandle as O, type CreateElementFn as P, type AttributeSetter as Q, type DOMElement as R, type RefObject as S, type SuspenseToken as T, type Effect as U, onMount as V, onCleanup as W, createRoot as X, type FictVNode as Y, type Cleanup as Z, type Component as _, createChildBinding as a, type Ref as a0, type RefCallback as a1, type StyleProp as a2, type ClassProp as a3, type EventHandler as a4, type ErrorInfo as a5, createAttributeBinding as b, createTextBinding as c, createStyleBinding as d, createClassBinding as e, createShow as f, registerErrorHandler as g, createRenderEffect as h, isReactive as i, createEffect as j, bindText as k, bindAttribute as l, bindStyle as m, nonReactive as n, bindClass as o, setAttr as p, setProp as q, reactive as r, setText as s, setStyle as t, unwrap as u, setClass as v, bindEvent as w, callEventHandler as x, bindProperty as y, bindRef as z };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { E as EffectOptions } from './signal-Z4KkDk9h.js';
|
|
2
|
+
|
|
1
3
|
/** Any DOM node that can be rendered */
|
|
2
4
|
type DOMElement = Node;
|
|
3
5
|
/** Cleanup function type */
|
|
@@ -60,6 +62,28 @@ interface SuspenseToken {
|
|
|
60
62
|
then: Promise<unknown>['then'];
|
|
61
63
|
}
|
|
62
64
|
|
|
65
|
+
type LifecycleFn = () => void | Cleanup;
|
|
66
|
+
interface CreateRootOptions {
|
|
67
|
+
inherit?: boolean;
|
|
68
|
+
}
|
|
69
|
+
type ErrorHandler = (err: unknown, info?: ErrorInfo) => boolean | void;
|
|
70
|
+
declare function onMount(fn: LifecycleFn): void;
|
|
71
|
+
declare function onDestroy(fn: LifecycleFn): void;
|
|
72
|
+
declare function onCleanup(fn: Cleanup): void;
|
|
73
|
+
declare function createRoot<T>(fn: () => T, options?: CreateRootOptions): {
|
|
74
|
+
dispose: () => void;
|
|
75
|
+
value: T;
|
|
76
|
+
};
|
|
77
|
+
declare function registerErrorHandler(fn: ErrorHandler): void;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Effect callback run synchronously; async callbacks are not tracked after the first await.
|
|
81
|
+
* TypeScript will reject `async () => {}` here—split async work or read signals before awaiting.
|
|
82
|
+
*/
|
|
83
|
+
type Effect = () => void | Cleanup;
|
|
84
|
+
declare function createEffect(fn: Effect, options?: EffectOptions): () => void;
|
|
85
|
+
declare function createRenderEffect(fn: Effect, options?: EffectOptions): () => void;
|
|
86
|
+
|
|
63
87
|
/**
|
|
64
88
|
* Fict Reactive DOM Binding System
|
|
65
89
|
*
|
|
@@ -86,6 +110,15 @@ interface BindingHandle {
|
|
|
86
110
|
/** Dispose function to clean up the binding */
|
|
87
111
|
dispose: Cleanup;
|
|
88
112
|
}
|
|
113
|
+
interface ConditionalBindingOptions {
|
|
114
|
+
/**
|
|
115
|
+
* When true, track signal reads inside active branch render callbacks and
|
|
116
|
+
* re-run the branch callback on updates even if the top-level condition stays
|
|
117
|
+
* the same. This preserves reactivity for control-flow callbacks that cannot
|
|
118
|
+
* be lowered into fine-grained bindings.
|
|
119
|
+
*/
|
|
120
|
+
trackBranchReads?: boolean;
|
|
121
|
+
}
|
|
89
122
|
/** Managed child node with its dispose function */
|
|
90
123
|
/**
|
|
91
124
|
* Check if a value is reactive (a getter function that returns a value).
|
|
@@ -370,7 +403,7 @@ declare function assign(node: Element, props: Record<string, unknown>, isSVG?: b
|
|
|
370
403
|
* )
|
|
371
404
|
* ```
|
|
372
405
|
*/
|
|
373
|
-
declare function createConditional(condition: () => boolean, renderTrue: () => FictNode, createElementFn: CreateElementFn, renderFalse?: () => FictNode, startOverride?: Comment, endOverride?: Comment): BindingHandle;
|
|
406
|
+
declare function createConditional(condition: () => boolean, renderTrue: () => FictNode, createElementFn: CreateElementFn, renderFalse?: () => FictNode, startOverride?: Comment, endOverride?: Comment, options?: ConditionalBindingOptions): BindingHandle;
|
|
374
407
|
/**
|
|
375
408
|
* Create a show/hide binding that uses CSS display instead of DOM manipulation.
|
|
376
409
|
* More efficient than conditional when the content is expensive to create.
|
|
@@ -397,26 +430,4 @@ declare function createShow(el: Element & {
|
|
|
397
430
|
*/
|
|
398
431
|
declare function createPortal(container: ParentNode & Node, render: () => FictNode, createElementFn: CreateElementFn): BindingHandle;
|
|
399
432
|
|
|
400
|
-
type
|
|
401
|
-
interface CreateRootOptions {
|
|
402
|
-
inherit?: boolean;
|
|
403
|
-
}
|
|
404
|
-
type ErrorHandler = (err: unknown, info?: ErrorInfo) => boolean | void;
|
|
405
|
-
declare function onMount(fn: LifecycleFn): void;
|
|
406
|
-
declare function onDestroy(fn: LifecycleFn): void;
|
|
407
|
-
declare function onCleanup(fn: Cleanup): void;
|
|
408
|
-
declare function createRoot<T>(fn: () => T, options?: CreateRootOptions): {
|
|
409
|
-
dispose: () => void;
|
|
410
|
-
value: T;
|
|
411
|
-
};
|
|
412
|
-
declare function registerErrorHandler(fn: ErrorHandler): void;
|
|
413
|
-
|
|
414
|
-
/**
|
|
415
|
-
* Effect callback run synchronously; async callbacks are not tracked after the first await.
|
|
416
|
-
* TypeScript will reject `async () => {}` here—split async work or read signals before awaiting.
|
|
417
|
-
*/
|
|
418
|
-
type Effect = () => void | Cleanup;
|
|
419
|
-
declare function createEffect(fn: Effect): () => void;
|
|
420
|
-
declare function createRenderEffect(fn: Effect): () => void;
|
|
421
|
-
|
|
422
|
-
export { delegateEvents as $, bindText as A, type BaseProps as B, type Cleanup as C, type DOMElement as D, type Effect as E, type FictNode as F, bindAttribute as G, bindStyle as H, bindClass as I, setText as J, setAttr as K, setProp as L, setStyle as M, setClass as N, bindEvent as O, type PropsWithChildren as P, callEventHandler as Q, type RefObject as R, type SuspenseToken as S, bindProperty as T, bindRef as U, insert as V, insertBetween as W, createConditional as X, spread as Y, assign as Z, classList as _, createChildBinding as a, clearDelegatedEvents as a0, addEventListener as a1, type MaybeReactive as a2, type BindingHandle as a3, type CreateElementFn as a4, type AttributeSetter as a5, createAttributeBinding as b, createTextBinding as c, createStyleBinding as d, createClassBinding as e, createShow as f, registerErrorHandler as g, createRenderEffect as h, isReactive as i, createEffect as j, onDestroy as k, onCleanup as l, createRoot as m, nonReactive as n, onMount as o, createPortal as p, type FictVNode as q, reactive as r, type Component as s, type Ref as t, unwrap as u, type RefCallback as v, type StyleProp as w, type ClassProp as x, type EventHandler as y, type ErrorInfo as z };
|
|
433
|
+
export { type PropsWithChildren as $, insert as A, type BaseProps as B, insertBetween as C, createConditional as D, createPortal as E, type FictNode as F, spread as G, assign as H, classList as I, delegateEvents as J, clearDelegatedEvents as K, addEventListener as L, type MaybeReactive as M, onDestroy as N, type BindingHandle as O, type CreateElementFn as P, type AttributeSetter as Q, type DOMElement as R, type RefObject as S, type SuspenseToken as T, type Effect as U, onMount as V, onCleanup as W, createRoot as X, type FictVNode as Y, type Cleanup as Z, type Component as _, createChildBinding as a, type Ref as a0, type RefCallback as a1, type StyleProp as a2, type ClassProp as a3, type EventHandler as a4, type ErrorInfo as a5, createAttributeBinding as b, createTextBinding as c, createStyleBinding as d, createClassBinding as e, createShow as f, registerErrorHandler as g, createRenderEffect as h, isReactive as i, createEffect as j, bindText as k, bindAttribute as l, bindStyle as m, nonReactive as n, bindClass as o, setAttr as p, setProp as q, reactive as r, setText as s, setStyle as t, unwrap as u, setClass as v, bindEvent as w, callEventHandler as x, bindProperty as y, bindRef as z };
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
insertNodesBefore,
|
|
4
4
|
removeNodes,
|
|
5
5
|
toNodeArray
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-R6FINS25.js";
|
|
7
7
|
import {
|
|
8
8
|
createRenderEffect,
|
|
9
9
|
createRootContext,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
getCurrentRoot,
|
|
13
13
|
popRoot,
|
|
14
14
|
pushRoot
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-F4RVNXOL.js";
|
|
16
16
|
|
|
17
17
|
// src/context.ts
|
|
18
18
|
var contextStorage = /* @__PURE__ */ new WeakMap();
|
|
@@ -108,4 +108,4 @@ export {
|
|
|
108
108
|
useContext,
|
|
109
109
|
hasContext
|
|
110
110
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
111
|
+
//# sourceMappingURL=chunk-2JRPPCG7.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isReactive
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-R6FINS25.js";
|
|
4
4
|
import {
|
|
5
5
|
createEffect,
|
|
6
6
|
createRoot,
|
|
7
7
|
onCleanup,
|
|
8
8
|
registerRootCleanup
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F4RVNXOL.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-DKA2I6ET.js.map
|