@vidact/runtime 0.2.0-beta.6 → 0.2.0-beta.8
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/CHANGELOG.md +13 -0
- package/dist/actions.js +1 -1
- package/dist/compiled/core.d.ts +17 -5
- package/dist/compiled/core.d.ts.map +1 -1
- package/dist/compiled/core.js +545 -155
- package/dist/compiled/core.js.map +1 -1
- package/dist/direct-dom.d.ts.map +1 -1
- package/dist/direct-dom.js +102 -11
- package/dist/direct-dom.js.map +1 -1
- package/dist/dom/events.d.ts +4 -1
- package/dist/dom/events.d.ts.map +1 -1
- package/dist/dom/events.js +66 -1
- package/dist/dom/events.js.map +1 -1
- package/dist/dom/namespace.js +1 -1
- package/dist/hydration-bridge.d.ts +4 -4
- package/dist/hydration-bridge.d.ts.map +1 -1
- package/dist/hydration-bridge.js.map +1 -1
- package/dist/hydration.d.ts +2 -2
- package/dist/hydration.d.ts.map +1 -1
- package/dist/hydration.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/keyed-list.d.ts +6 -2
- package/dist/keyed-list.d.ts.map +1 -1
- package/dist/keyed-list.js +122 -11
- package/dist/keyed-list.js.map +1 -1
- package/dist/metadata.js +1 -1
- package/dist/renderable.d.ts +2 -1
- package/dist/renderable.d.ts.map +1 -1
- package/dist/renderable.js +12 -1
- package/dist/renderable.js.map +1 -1
- package/dist/source-mask.d.ts +2 -1
- package/dist/source-mask.d.ts.map +1 -1
- package/dist/source-mask.js +16 -1
- package/dist/source-mask.js.map +1 -1
- package/dist/spread.js +2 -2
- package/dist/state-slot.d.ts +12 -1
- package/dist/state-slot.d.ts.map +1 -1
- package/dist/state-slot.js +54 -24
- package/dist/state-slot.js.map +1 -1
- package/package.json +3 -3
- package/src/compiled/core.ts +785 -179
- package/src/direct-dom.ts +136 -10
- package/src/dom/events.ts +86 -0
- package/src/hydration-bridge.ts +10 -4
- package/src/hydration.ts +5 -3
- package/src/index.ts +2 -0
- package/src/keyed-list.ts +168 -22
- package/src/renderable.ts +30 -0
- package/src/source-mask.ts +20 -0
- package/src/state-slot.ts +83 -27
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @vidact/runtime
|
|
2
2
|
|
|
3
|
+
## 0.2.0-beta.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- e480658: Reduce retained keyed-row memory by sharing scheduler, disposer, and getter callables, allocating concurrent bookkeeping lazily, and trimming inline event metadata.
|
|
8
|
+
|
|
9
|
+
## 0.2.0-beta.7
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- ed60a1c: Index updater dependencies by source when runtime-owned capabilities change a compiled scope.
|
|
14
|
+
- 977b90f: Retain unchanged Start route owners and update their loader, parameter, URL, and child props during client navigation.
|
|
15
|
+
|
|
3
16
|
## 0.2.0-beta.6
|
|
4
17
|
|
|
5
18
|
## 0.2.0-beta.5
|
package/dist/actions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { installDomPropHandler } from "./dom/properties.js";
|
|
1
2
|
import { captureCompiledTask, createCompiledExternalStore, createCompiledState, createContext, registerCompiledCleanup, runWithCompiledContext, useContext } from "./compiled/core.js";
|
|
2
3
|
import { registerTransitionAborter, registerTransitionFinalizer, registerTransitionSettlement, runUrgentUpdate, startIndependentTransition } from "./concurrent.js";
|
|
3
|
-
import { installDomPropHandler } from "./dom/properties.js";
|
|
4
4
|
import { h } from "./direct-dom.js";
|
|
5
5
|
import { resetActionForm } from "./dom/forms.js";
|
|
6
6
|
//#region src/actions.ts
|
package/dist/compiled/core.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ type RootIdentity = {
|
|
|
22
22
|
readonly onCaughtError: CompiledErrorHandler | undefined;
|
|
23
23
|
readonly onUncaughtError: CompiledErrorHandler | undefined;
|
|
24
24
|
};
|
|
25
|
-
type Owner = [disposed: boolean, cleanups:
|
|
25
|
+
type Owner = [disposed: boolean, cleanups: Array<() => void>, context: ContextFrame | null, rootIdentity: RootIdentity, errorBoundary: ErrorBoundaryHandler | null, retainedConnection?: RetainedConnection | null, profileContext?: ProfileContext | null, debugName?: string | null];
|
|
26
26
|
type DebugOwnerFrame = {
|
|
27
27
|
readonly name: string;
|
|
28
28
|
readonly parent: DebugOwnerFrame | null;
|
|
@@ -51,11 +51,14 @@ type RetainedResource = {
|
|
|
51
51
|
disposed: boolean;
|
|
52
52
|
readonly phase: number;
|
|
53
53
|
};
|
|
54
|
+
type FlushTask = (() => void) | {
|
|
55
|
+
readonly [1]: (sources?: SourceMask) => void;
|
|
56
|
+
};
|
|
54
57
|
type RetainedConnection = {
|
|
55
58
|
readonly parent: RetainedConnection | null;
|
|
56
59
|
readonly children: Set<RetainedConnection>;
|
|
57
60
|
readonly resources: Set<RetainedResource>;
|
|
58
|
-
readonly deferredFlushes: Map<
|
|
61
|
+
readonly deferredFlushes: Map<FlushTask, CancelScheduledTask>;
|
|
59
62
|
readonly afterFlush: Set<() => void>;
|
|
60
63
|
visible: boolean;
|
|
61
64
|
connected: boolean;
|
|
@@ -117,6 +120,8 @@ declare function createCompiledRestProp(scope: CompiledScope, sourceMask: Source
|
|
|
117
120
|
declare function objectRest(input: Record<PropertyKey, unknown>, excludedNames: readonly PropertyKey[]): Record<PropertyKey, unknown>;
|
|
118
121
|
declare function binding<T>(scope: CompiledScope, reads: SourceMask, evaluate: () => T, additionalScope?: CompiledScope, additionalReads?: SourceMask): CompiledBinding<T>;
|
|
119
122
|
declare function compiledEvent<Arguments extends unknown[]>(scope: CompiledScope, handler: ((...arguments_: Arguments) => void) | CompiledBinding<((...arguments_: Arguments) => void) | null | undefined> | null | undefined): (...arguments_: Arguments) => void;
|
|
123
|
+
declare function compiledInlineEvent<Arguments extends unknown[]>(scope: CompiledScope, handler: (...arguments_: Arguments) => void): (...arguments_: Arguments) => void;
|
|
124
|
+
declare function isCompiledEventHandler(value: unknown): value is EventListener;
|
|
120
125
|
interface CompiledTaskController {
|
|
121
126
|
readonly disposed: () => boolean;
|
|
122
127
|
readonly report: (error: unknown) => void;
|
|
@@ -126,7 +131,7 @@ declare function when(scope: CompiledScope, reads: SourceMask, condition: () =>
|
|
|
126
131
|
type ChoiceMode = 'truthy' | 'not-nullish';
|
|
127
132
|
declare function choose(scope: CompiledScope, reads: SourceMask, mode: ChoiceMode, select: () => unknown, consequent: () => CompiledRenderValue, alternate: () => CompiledRenderValue, additionalScope?: CompiledScope, additionalReads?: SourceMask): StructuralBinding;
|
|
128
133
|
declare function dispatch(scope: CompiledScope, reads: SourceMask, type: () => unknown, key: () => unknown, render: () => CompiledRenderValue, additionalScope?: CompiledScope, additionalReads?: SourceMask): StructuralBinding;
|
|
129
|
-
declare function keyed<T, K>(scope: CompiledScope, reads: SourceMask, values: () => readonly T[], key: (value: T, index: number) => K, render: (value: StateSlot<T>, index: StateSlot<number>, itemScope: CompiledScope) => RenderValue,
|
|
134
|
+
declare function keyed<T, K>(scope: CompiledScope, reads: SourceMask, values: () => readonly T[], key: (value: T, index: number) => K, render: (value: StateSlot<T>, index: StateSlot<number>, itemScope: CompiledScope) => RenderValue, trackIndexOrAdditionalScope?: boolean | CompiledScope, additionalScopeOrReads?: CompiledScope | SourceMask, additionalReads?: SourceMask): StructuralBinding;
|
|
130
135
|
declare function indexed<T>(scope: CompiledScope, reads: SourceMask, values: () => readonly T[], render: (value: StateSlot<T>, index: StateSlot<number>, itemScope: CompiledScope) => RenderValue, additionalScope?: CompiledScope, additionalReads?: SourceMask): StructuralBinding;
|
|
131
136
|
declare function compiledRoot(scope: CompiledScope, render: () => CompiledRenderValue): CompiledComponentResult;
|
|
132
137
|
declare function adoptCompiledRoot(root: unknown): void;
|
|
@@ -159,14 +164,21 @@ declare function isCompiledBinding(value: unknown): value is CompiledBinding<unk
|
|
|
159
164
|
declare function isStructuralBinding(value: unknown): value is StructuralBinding;
|
|
160
165
|
declare function isCompiledComponentResult(value: unknown): value is CompiledComponentResult;
|
|
161
166
|
declare function mountCompiledBinding(parent: Node, value: CompiledBinding<unknown>): void;
|
|
162
|
-
declare function mountCompiledProp(value: CompiledBinding<
|
|
167
|
+
declare function mountCompiledProp<T>(value: CompiledBinding<T>, apply: (next: T) => void | (() => void)): void;
|
|
168
|
+
declare function mountCompiledProp<T>(value: CompiledBinding<T>, apply: (element: Element, name: string, next: T) => void | (() => void), element: Element, name: string): void;
|
|
163
169
|
declare function mountCompiledPropTransition<T>(value: CompiledBinding<T>, initialize: (initial: T) => void, prepare: (next: T, previous: T) => CompiledPropTransition | undefined): void;
|
|
164
170
|
/** @internal Test-only allocation and retention evidence. */
|
|
165
171
|
declare function readCompiledOwnerMetrics(): {
|
|
166
172
|
readonly active: number;
|
|
167
173
|
readonly created: number;
|
|
174
|
+
readonly updaters: number;
|
|
175
|
+
readonly schedulerPlans: number;
|
|
176
|
+
};
|
|
177
|
+
/** @internal Test-only publication traversal evidence. */
|
|
178
|
+
declare function readCompiledPublicationMetrics(): {
|
|
179
|
+
readonly visitedNodes: number;
|
|
168
180
|
};
|
|
169
181
|
declare function isCompiledContext<Value>(value: unknown): value is CompiledContext<Value>;
|
|
170
182
|
//#endregion
|
|
171
|
-
export { COMPONENT_SPREAD_SOURCE, ChoiceMode, CompiledPropTransition, CompiledTaskController, DEV, MountCompiledOptions, Suspense, adoptCompiledRoot, binding, captureCompiledOwnerStack, captureCompiledTask, choose, compiledEffect, compiledEvent, compiledImperativeHandle, compiledInsertionEffect, compiledLayoutEffect, compiledRoot, constructCompiledComponent, createCompiledAsync, createCompiledContext, createCompiledEffectEvent, createCompiledExternalStore, createCompiledId, createCompiledMemo, createCompiledProp, createCompiledReducer, createCompiledRestProp, createCompiledScope, createCompiledState, createContext, createNarrowCompiledScope, createPortal, deferred, dispatch, enableProfiling, enableRetainedUi, errorBoundary, hydrateCompiled, indexed, isCompiledBinding, isCompiledComponentResult, isCompiledContext, isStructuralBinding, keyed, mountCompiled, mountCompiledBinding, mountCompiledProp, mountCompiledPropTransition, mountCompiledRef, objectRest, profiled, queueElementRef, readCompiledOwnerMetrics, recordCompiledDebugValue, registerCompiledCleanup, retainedActivity, runCompiledTransaction, runWithCompiledContext, suspense, use, useCallback, useContext, useEffect, useEffectEvent, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useSyncExternalStore, when };
|
|
183
|
+
export { COMPONENT_SPREAD_SOURCE, ChoiceMode, CompiledPropTransition, CompiledTaskController, DEV, MountCompiledOptions, Suspense, adoptCompiledRoot, binding, captureCompiledOwnerStack, captureCompiledTask, choose, compiledEffect, compiledEvent, compiledImperativeHandle, compiledInlineEvent, compiledInsertionEffect, compiledLayoutEffect, compiledRoot, constructCompiledComponent, createCompiledAsync, createCompiledContext, createCompiledEffectEvent, createCompiledExternalStore, createCompiledId, createCompiledMemo, createCompiledProp, createCompiledReducer, createCompiledRestProp, createCompiledScope, createCompiledState, createContext, createNarrowCompiledScope, createPortal, deferred, dispatch, enableProfiling, enableRetainedUi, errorBoundary, hydrateCompiled, indexed, isCompiledBinding, isCompiledComponentResult, isCompiledContext, isCompiledEventHandler, isStructuralBinding, keyed, mountCompiled, mountCompiledBinding, mountCompiledProp, mountCompiledPropTransition, mountCompiledRef, objectRest, profiled, queueElementRef, readCompiledOwnerMetrics, readCompiledPublicationMetrics, recordCompiledDebugValue, registerCompiledCleanup, retainedActivity, runCompiledTransaction, runWithCompiledContext, suspense, use, useCallback, useContext, useEffect, useEffectEvent, useId, useImperativeHandle, useInsertionEffect, useLayoutEffect, useMemo, useSyncExternalStore, when };
|
|
172
184
|
//# sourceMappingURL=core.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","names":[],"sources":["../../src/compiled/core.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"core.d.ts","names":[],"sources":["../../src/compiled/core.ts"],"mappings":";;;;;cA+Ea;cAGA;KA4BR;WACM,SAAS;WACT;WACA,QAAQ;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