vasille-jsx 5.1.4 → 6.0.0-rc

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/lib/components.js CHANGED
@@ -1,4 +1,8 @@
1
- import { ArrayModel, ArrayView, Fragment, MapModel, MapView, reportError, safe, SetModel, SetView, SwitchedNode, userError, Watch as CoreWatch, } from "vasille";
1
+ import { ArrayModel, ArrayView as CoreArrayView, SinglePassArrayView, Fragment, MapModel, MapView as CoreMapView, reportError, safe, SetModel, SetView as CoreSetView, SwitchedNode, userError, Watch as CoreWatch, } from "vasille";
2
+ import { ref } from "./internal.js";
3
+ function frag(runner) {
4
+ return new Fragment(runner);
5
+ }
2
6
  export function Slot({ model, slot, ...options }, ctx, defaultSlot) {
3
7
  try {
4
8
  if (model) {
@@ -24,27 +28,23 @@ export function For({ of: model, slot: _slot }, ctx, defaultSlot) {
24
28
  return;
25
29
  }
26
30
  if (model instanceof ArrayModel) {
27
- ctx.create(new ArrayView({
28
- model,
29
- slot: slot,
30
- }, ctx.runner));
31
+ ctx.create(new CoreArrayView(ctx.runner, model, (ctx, value, index) => {
32
+ slot(ctx, value, index.V);
33
+ }, ref, frag));
31
34
  }
32
35
  else if (model instanceof MapModel) {
33
- ctx.create(new MapView({
34
- model,
35
- slot,
36
- }, ctx.runner));
36
+ ctx.create(new CoreMapView(ctx.runner, model, (ctx, value, key) => {
37
+ slot(ctx, value.V, key);
38
+ }, ref, frag));
37
39
  }
38
40
  else if (model instanceof SetModel) {
39
- ctx.create(new SetView({
40
- model,
41
- slot: slot,
42
- }, ctx.runner));
41
+ ctx.create(new CoreSetView(ctx.runner, model, (ctx, value) => {
42
+ slot(ctx, value, value);
43
+ }, frag));
43
44
  }
44
45
  // fallback if is used external Array/Map/Set
45
46
  else {
46
47
  const safeSlot = safe(slot);
47
- console.warn("Vasille <For of/> fallback detected. Please provide reactive data.");
48
48
  if (model instanceof Array) {
49
49
  model.forEach((value) => {
50
50
  safeSlot(ctx, value, value);
@@ -56,7 +56,7 @@ export function For({ of: model, slot: _slot }, ctx, defaultSlot) {
56
56
  });
57
57
  }
58
58
  else if (model instanceof Set) {
59
- model.forEach(value => {
59
+ model.forEach((value) => {
60
60
  safeSlot(ctx, value, value);
61
61
  });
62
62
  }
@@ -65,6 +65,18 @@ export function For({ of: model, slot: _slot }, ctx, defaultSlot) {
65
65
  }
66
66
  }
67
67
  }
68
+ export function ArrayView(props, ctx) {
69
+ ctx.create(new SinglePassArrayView(ctx.runner, props.of, props.key, props.slot, ref, ref, frag));
70
+ }
71
+ export function ArrayModelView(props, ctx) {
72
+ ctx.create(new CoreArrayView(ctx.runner, props.of, props.slot, ref, frag));
73
+ }
74
+ export function MapModelView(props, ctx) {
75
+ ctx.create(new CoreMapView(ctx.runner, props.of, props.slot, ref, frag));
76
+ }
77
+ export function SetModelView(props, ctx) {
78
+ ctx.create(new CoreSetView(ctx.runner, props.of, props.slot, frag));
79
+ }
68
80
  export function Watch({ $model, slot: _slot }, ctx, defaultSlot) {
69
81
  const slot = _slot ?? defaultSlot;
70
82
  /* istanbul ignore else */
@@ -1,5 +1,5 @@
1
1
  import { safe, userError } from "vasille";
2
- import { DevArrayModel, DevArrayView, DevFragment, DevMapModel, DevMapView, DevSetModel, DevSetView, DevSwitchedNode, DevWatch as DevCoreWatch, errorToString, } from "vasille/dev";
2
+ import { DevArrayModel, DevArrayView as DevCoreArrayView, DevFragment, DevMapModel, DevMapView, DevSetModel, DevSetView, DevSinglePassArrayView, DevSwitchedNode, DevWatch as DevCoreWatch, errorToString, } from "vasille/dev";
3
3
  export function DevSlot({ model, slot, ...options }, ctx, defaultSlot, usage) {
4
4
  try {
5
5
  if (model) {
@@ -27,31 +27,30 @@ export function DevSwitch(options, ctx, _slot, usage) {
27
27
  }
28
28
  export function DevFor({ of: model, slot: _slot }, ctx, defaultSlot, usage) {
29
29
  const slot = _slot ?? defaultSlot;
30
+ console.warn("Vasille <For of/> IS DEPRECATED. " +
31
+ "Please use ArrayView/ArrayModelView/SetModelView/MapModelView/Iterate/ForEach.");
30
32
  if (!slot) {
31
33
  return;
32
34
  }
33
35
  if (model instanceof DevArrayModel) {
34
- ctx.create(new DevArrayView({
35
- model,
36
- slot: slot,
37
- }, ctx.runner, usage));
36
+ ctx.create(new DevCoreArrayView(ctx.runner, model, (ctx, value, index) => {
37
+ slot(ctx, value, index.V);
38
+ }, usage));
38
39
  }
39
40
  else if (model instanceof DevMapModel) {
40
- ctx.create(new DevMapView({
41
- model,
42
- slot,
43
- }, ctx.runner, usage));
41
+ ctx.create(new DevMapView(ctx.runner, model, (ctx, value, key) => {
42
+ slot(ctx, value.V, key);
43
+ }, usage, undefined));
44
44
  }
45
45
  else if (model instanceof DevSetModel) {
46
- ctx.create(new DevSetView({
47
- model,
48
- slot: slot,
49
- }, ctx.runner, usage));
46
+ ctx.create(new DevSetView(ctx.runner, model, (ctx, value) => {
47
+ slot(ctx, value, value);
48
+ }, usage));
50
49
  }
51
50
  // fallback if is used external Array/Map/Set
52
51
  else {
53
52
  const safeSlot = safe(slot);
54
- console.warn("Vasille <For of/> fallback detected. Please provide reactive data.");
53
+ console.warn("Vasille <For of/> fallback detected. Please use Iterate or ForEach.");
55
54
  if (model instanceof Array) {
56
55
  model.forEach((value) => {
57
56
  safeSlot(ctx, value, value);
@@ -63,7 +62,7 @@ export function DevFor({ of: model, slot: _slot }, ctx, defaultSlot, usage) {
63
62
  });
64
63
  }
65
64
  else if (model instanceof Set) {
66
- model.forEach(value => {
65
+ model.forEach((value) => {
67
66
  safeSlot(ctx, value, value);
68
67
  });
69
68
  }
@@ -72,6 +71,18 @@ export function DevFor({ of: model, slot: _slot }, ctx, defaultSlot, usage) {
72
71
  }
73
72
  }
74
73
  }
74
+ export function DevArrayView(props, ctx, usage, _defaultSlot, value, index) {
75
+ ctx.create(new DevSinglePassArrayView(ctx.runner, props.of, props.key, props.slot, usage, value, index));
76
+ }
77
+ export function DevArrayModelView(props, ctx, _defaultSlot, usage, index) {
78
+ ctx.create(new DevCoreArrayView(ctx.runner, props.of, props.slot, usage, index));
79
+ }
80
+ export function DevMapModelView(props, ctx, _defaultSlot, usage, value) {
81
+ ctx.create(new DevMapView(ctx.runner, props.of, props.slot, usage, value));
82
+ }
83
+ export function DevSetModelView(props, ctx, usage) {
84
+ ctx.create(new DevSetView(ctx.runner, props.of, props.slot, usage));
85
+ }
75
86
  export function DevWatch({ $model, slot: _slot }, ctx, defaultSlot, usage) {
76
87
  const slot = _slot ?? defaultSlot;
77
88
  /* istanbul ignore else */
@@ -1,17 +1,32 @@
1
+ import { Fragment } from "vasille";
1
2
  import { DevReactive, errorToString, remapObject, toDevIdOrValue } from "vasille/dev";
2
3
  import { DevApp, DevFragment, ModelId } from "vasille/dev";
3
4
  import { earlyInspector } from "./early-inspector.js";
5
+ export function devDynamicalModule(composed, fragments, safeRun) {
6
+ Object.defineProperties(composed, {
7
+ fragments: {
8
+ value: fragments,
9
+ },
10
+ recompose: {
11
+ value: function (previous) {
12
+ // inspector erase declaration
13
+ previous.forEach(({ props, node, usage }, key) => {
14
+ node.children.forEach(child => child.destroy());
15
+ node.children.splice(0);
16
+ safeRun(node, props, usage);
17
+ fragments.set(key, { props, node, usage });
18
+ });
19
+ },
20
+ },
21
+ });
22
+ return composed;
23
+ }
4
24
  export function devView(renderer, declaration, name) {
5
- return function (props, node, slot, usage) {
25
+ let fragments = new Map();
26
+ const safeRun = function (parent, props, usage) {
6
27
  const { callback } = props;
7
- if (!node) {
8
- throw new Error("Vasille: Component context is missing");
9
- }
10
- const frag = new DevFragment(node.runner, declaration, usage ?? null, name, props);
11
- if (slot) {
12
- props.slot = slot;
13
- }
14
- node.create(frag);
28
+ const frag = new DevFragment(parent.runner, declaration, usage ?? null, name, props);
29
+ parent.create(frag);
15
30
  try {
16
31
  const result = renderer(frag, props);
17
32
  if (result !== undefined && result !== null && callback) {
@@ -19,7 +34,7 @@ export function devView(renderer, declaration, name) {
19
34
  }
20
35
  }
21
36
  catch (e) {
22
- node.runner.inspector.reportComponentError({
37
+ parent.runner.inspector.reportComponentError({
23
38
  targetId: frag.id,
24
39
  error: errorToString(e),
25
40
  time: Date.now(),
@@ -27,12 +42,26 @@ export function devView(renderer, declaration, name) {
27
42
  reportError(e);
28
43
  }
29
44
  finally {
30
- node.runner.inspector.composeTime({
45
+ parent.runner.inspector.composeTime({
31
46
  id: frag.id,
32
47
  time: Date.now(),
33
48
  });
34
49
  }
35
50
  };
51
+ const composed = function (props, node, slot, usage) {
52
+ if (!node) {
53
+ throw new Error("Vasille: Component context is missing");
54
+ }
55
+ const frag = new Fragment(node.runner);
56
+ if (slot) {
57
+ props.slot = slot;
58
+ }
59
+ node.create(frag);
60
+ fragments.set(frag, { props, node, usage });
61
+ frag.runOnDestroy(() => fragments.delete(frag));
62
+ safeRun(frag, props, usage);
63
+ };
64
+ return devDynamicalModule(composed, fragments, safeRun);
36
65
  }
37
66
  export function devStore(fn, declaration, name) {
38
67
  const reactive = new DevReactive({ inspector: earlyInspector });
@@ -26,6 +26,9 @@ export class AbstractInspector {
26
26
  destroy(data) {
27
27
  this.send(this.destroy.name, data);
28
28
  }
29
+ erase(data) {
30
+ this.send(this.erase.name, data);
31
+ }
29
32
  eventTrigger(call) {
30
33
  this.send(this.eventTrigger.name, call);
31
34
  }
package/lib/dev/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { setErrorHandler as coreSetErrorHandler } from "vasille";
2
2
  import { errorToString } from "vasille/dev";
3
3
  import { earlyInspector } from "./early-inspector.js";
4
- export { DevDelay, DevWatch, DevFor, DevSwitch, DevSlot } from "./components.js";
5
- export { devStore, devModel, devMount, devView } from "./compose.js";
4
+ export { DevDelay, DevWatch, DevFor, DevSwitch, DevSlot, DevSetModelView, DevMapModelView, DevArrayModelView, DevArrayView, } from "./components.js";
5
+ export { devStore, devModel, devMount, devView, devDynamicalModule } from "./compose.js";
6
6
  export { devArrayModel, devMapModel, devEnsure, devExpr, devMatch, devSetModel, devRef, devSet } from "./internal.js";
7
7
  export { devAwaited } from "./library.js";
8
8
  export { AbstractInspector, EarlyInspector, earlyInspector } from "./early-inspector.js";
package/lib/index.js CHANGED
@@ -1,5 +1,6 @@
1
- export { Delay, For, Slot, Watch, Switch } from "./components.js";
1
+ export { Delay, For, Slot, Watch, Switch, ArrayView, ArrayModelView, SetModelView, MapModelView, } from "./components.js";
2
2
  export { view, mount, model, store } from "./compose.js";
3
3
  export { awaited } from "./library.js";
4
4
  export { ref, arrayModel, mapModel, expr, setModel, set, ensure, match } from "./internal.js";
5
+ export { QueuedRender } from "./queue.js";
5
6
  export { setErrorHandler } from "vasille";
package/lib/queue.js ADDED
@@ -0,0 +1,47 @@
1
+ import { Fragment, safe } from "vasille";
2
+ let queueTimer = null;
3
+ const queue = [];
4
+ function processQueue() {
5
+ const startTime = Date.now();
6
+ let i = 0;
7
+ queueTimer = null;
8
+ for (; i < queue.length; i++) {
9
+ const { node, slot } = queue[i];
10
+ safe(slot)(node);
11
+ queue[i].done = true;
12
+ if (Date.now() - startTime >= 12) {
13
+ break;
14
+ }
15
+ }
16
+ queue.splice(0, i + 1);
17
+ if (queue.length > 0) {
18
+ queueTimer = setTimeout(processQueue, 6);
19
+ }
20
+ }
21
+ export function QueuedRender(props, ctx, defaultSlot) {
22
+ /* istanbul ignore else */
23
+ if (defaultSlot) {
24
+ const node = new Fragment(ctx.runner);
25
+ const item = { done: false, node: node, slot: defaultSlot };
26
+ // mount the newly created node to the parent
27
+ ctx.create(node);
28
+ if (props.priority === "high") {
29
+ queue.unshift(item);
30
+ }
31
+ else {
32
+ queue.push(item);
33
+ }
34
+ node.runOnDestroy(() => {
35
+ if (!item.done) {
36
+ const index = queue.indexOf(item);
37
+ /* istanbul ignore else */
38
+ if (index !== -1) {
39
+ queue.splice(index, 1);
40
+ }
41
+ }
42
+ });
43
+ if (queueTimer === null) {
44
+ queueTimer = setTimeout(processQueue, 0);
45
+ }
46
+ }
47
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vasille-jsx",
3
- "version": "5.1.4",
3
+ "version": "6.0.0-rc",
4
4
  "description": "The same framework which is designed to build bulletproof frontends (JSX components)",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -65,6 +65,6 @@
65
65
  "typescript-eslint": "^8.39.1"
66
66
  },
67
67
  "dependencies": {
68
- "vasille": "^5.1.9"
68
+ "vasille": "6.0.0-rc.4"
69
69
  }
70
70
  }
@@ -1,4 +1,4 @@
1
- import { Fragment, IValue } from "vasille";
1
+ import { ArrayModel, Fragment, IValue, MapModel, SetModel } from "vasille";
2
2
  interface SlotOptions<Node, Element, TagOptions extends object, T extends object> {
3
3
  model?: (input: T, ctx: Fragment<Node, Element, TagOptions>) => void;
4
4
  slot?: (input: object, ctx: Fragment<Node, Element, TagOptions>) => void;
@@ -13,11 +13,17 @@ interface SwitchOptions<Node, Element, TagOptions extends object> {
13
13
  slot?: never;
14
14
  }
15
15
  export declare function Switch<Node, Element, TagOptions extends object>(options: SwitchOptions<Node, Element, TagOptions>, ctx: Fragment<Node, Element, TagOptions>): void;
16
- interface ForOptions<Node, Element, TagOptions extends object, T, K, V> {
16
+ interface ForOptions<Node, Element, TagOptions extends object, T, Args extends unknown[]> {
17
17
  of: T;
18
- slot?: (ctx: Fragment<Node, Element, TagOptions>, value: T, index: K) => void;
18
+ slot?: (ctx: Fragment<Node, Element, TagOptions>, ...args: Args) => void;
19
19
  }
20
- export declare function For<Node, Element, TagOptions extends object, T extends Set<unknown> | Map<unknown, unknown> | unknown[], K = T extends unknown[] ? number : T extends Set<infer R> ? R : T extends Map<infer R, unknown> ? R : never, V = T extends (infer R)[] ? R : T extends Set<infer R> ? R : T extends Map<unknown, infer R> ? R : never>({ of: model, slot: _slot }: ForOptions<Node, Element, TagOptions, T, K, V>, ctx: Fragment<Node, Element, TagOptions>, defaultSlot?: (ctx: Fragment<Node, Element, TagOptions>) => void): void;
20
+ export declare function For<Node, Element, TagOptions extends object, T extends Set<unknown> | Map<unknown, unknown> | unknown[], K = T extends unknown[] ? number : T extends Set<infer R> ? R : T extends Map<infer R, unknown> ? R : never, V = T extends (infer R)[] ? R : T extends Set<infer R> ? R : T extends Map<unknown, infer R> ? R : never>({ of: model, slot: _slot }: ForOptions<Node, Element, TagOptions, T, [V, K]>, ctx: Fragment<Node, Element, TagOptions>, defaultSlot?: (ctx: Fragment<Node, Element, TagOptions>) => void): void;
21
+ export declare function ArrayView<Node, Element, TagOptions extends object, T extends unknown[], V = T extends (infer R)[] ? R : never>(props: Required<ForOptions<Node, Element, TagOptions, IValue<V[]>, [IValue<V>, IValue<number>]>> & {
22
+ key: (value: V) => number | string;
23
+ }, ctx: Fragment<Node, Element, TagOptions>): void;
24
+ export declare function ArrayModelView<Node, Element, TagOptions extends object, V>(props: Required<ForOptions<Node, Element, TagOptions, ArrayModel<V>, [V, IValue<number>]>>, ctx: Fragment<Node, Element, TagOptions>): void;
25
+ export declare function MapModelView<Node, Element, TagOptions extends object, K, V>(props: Required<ForOptions<Node, Element, TagOptions, MapModel<K, V>, [IValue<V>, K]>>, ctx: Fragment<Node, Element, TagOptions>): void;
26
+ export declare function SetModelView<Node, Element, TagOptions extends object, V>(props: Required<ForOptions<Node, Element, TagOptions, SetModel<V>, [V]>>, ctx: Fragment<Node, Element, TagOptions>): void;
21
27
  interface WatchOptions<Node, Element, TagOptions extends object, T> {
22
28
  $model: IValue<T>;
23
29
  slot?: (ctx: Fragment<Node, Element, TagOptions>, value: T) => void;
@@ -1,5 +1,5 @@
1
- import { Fragment } from "vasille";
2
- import { DevIValue, StaticPosition } from "vasille/dev";
1
+ import { Fragment, IValue } from "vasille";
2
+ import { DevArrayModel, DevIValue, DevMapModel, DevSetModel, StaticPosition } from "vasille/dev";
3
3
  import { IDevRunner } from "vasille/dev";
4
4
  interface DevSlotOptions<Node, Element, TagOptions extends object, T extends object> {
5
5
  model?: (input: T, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>) => void;
@@ -15,11 +15,17 @@ interface DevSwitchOptions<Node, Element, TagOptions extends object> {
15
15
  slot?: never;
16
16
  }
17
17
  export declare function DevSwitch<Node, Element, TagOptions extends object>(options: DevSwitchOptions<Node, Element, TagOptions>, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, _slot: undefined, usage: StaticPosition): void;
18
- interface DevForOptions<Node, Element, TagOptions extends object, T, K, V> {
18
+ interface DevForOptions<Node, Element, TagOptions extends object, T, Args extends unknown[]> {
19
19
  of: T;
20
- slot?: (ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, value: T, index: K) => void;
20
+ slot?: (ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, ...args: Args) => void;
21
21
  }
22
- export declare function DevFor<Node, Element, TagOptions extends object, T extends Set<unknown> | Map<unknown, unknown> | unknown[], K = T extends unknown[] ? number : T extends Set<infer R> ? R : T extends Map<infer R, unknown> ? R : never, V = T extends (infer R)[] ? R : T extends Set<infer R> ? R : T extends Map<unknown, infer R> ? R : never>({ of: model, slot: _slot }: DevForOptions<Node, Element, TagOptions, T, K, V>, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, defaultSlot: ((ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>) => void) | undefined, usage: StaticPosition): void;
22
+ export declare function DevFor<Node, Element, TagOptions extends object, T extends Set<unknown> | Map<unknown, unknown> | unknown[], K = T extends unknown[] ? number : T extends Set<infer R> ? R : T extends Map<infer R, unknown> ? R : never, V = T extends (infer R)[] ? R : T extends Set<infer R> ? R : T extends Map<unknown, infer R> ? R : never>({ of: model, slot: _slot }: DevForOptions<Node, Element, TagOptions, T, [V, K]>, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, defaultSlot: ((ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>) => void) | undefined, usage: StaticPosition): void;
23
+ export declare function DevArrayView<Node, Element, TagOptions extends object, T extends unknown[], V = T extends (infer R)[] ? R : never>(props: Required<DevForOptions<Node, Element, TagOptions, IValue<V[]>, [IValue<V>, IValue<number>]>> & {
24
+ key: (value: V) => number | string;
25
+ }, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, usage: StaticPosition, _defaultSlot: never, value: StaticPosition | undefined, index: StaticPosition | undefined): void;
26
+ export declare function DevArrayModelView<Node, Element, TagOptions extends object, V>(props: Required<DevForOptions<Node, Element, TagOptions, DevArrayModel<V>, [V, IValue<number>]>>, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, _defaultSlot: never, usage: StaticPosition, index: StaticPosition | undefined): void;
27
+ export declare function DevMapModelView<Node, Element, TagOptions extends object, K, V>(props: Required<DevForOptions<Node, Element, TagOptions, DevMapModel<K, V>, [IValue<V>, K]>>, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, _defaultSlot: never, usage: StaticPosition, value: StaticPosition | undefined): void;
28
+ export declare function DevSetModelView<Node, Element, TagOptions extends object, V>(props: Required<DevForOptions<Node, Element, TagOptions, DevSetModel<V>, [V]>>, ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, usage: StaticPosition): void;
23
29
  interface DevWatchOptions<Node, Element, TagOptions extends object, T> {
24
30
  $model: DevIValue<T>;
25
31
  slot?: (ctx: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, value: T) => void;
@@ -6,6 +6,15 @@ import { DevRunner, DevTagOptions, Inspector } from "vasille/dev";
6
6
  export type DevComposed<Node, Element, TagOptions extends object, In extends CompositionProps, Out> = ($: In & {
7
7
  callback?(data: Out | undefined): void;
8
8
  }, node?: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, slot?: In["slot"], usage?: StaticPosition) => void;
9
+ export type DevInput<In, Out> = In & {
10
+ callback?(data: Out | undefined): void;
11
+ };
12
+ export type DevFragmentMap<Node, Element, TagOptions extends object, In> = Map<Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, {
13
+ props: In;
14
+ node: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>;
15
+ usage: StaticPosition | undefined;
16
+ }>;
17
+ export declare function devDynamicalModule<T, Node, Element, TagOptions extends object, Props>(composed: T, fragments: DevFragmentMap<Node, Element, TagOptions, Props>, safeRun: (parent: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, props: Props, usage: StaticPosition | undefined) => void): T;
9
18
  export declare function devView<Node, Element, TagOptions extends object, In extends CompositionProps, Out>(renderer: (node: Fragment<Node, Element, TagOptions, IDevRunner<Node, Element, TagOptions>>, input: In) => Out, declaration: StaticPosition, name: string): DevComposed<Node, Element, TagOptions, In, Out>;
10
19
  export declare function devStore<Out extends object>(fn: (ctx: Reactive) => Out, declaration: StaticPosition, name: string): Out;
11
20
  export declare function devModel<In extends object, Out extends object>(fn: (ctx: DevReactive<IDevRunner<unknown, unknown, object>>, o: In) => Out, declaration: StaticPosition, name: string): (o: In, parent: Reactive | undefined, usage: StaticPosition) => Out;
@@ -1,4 +1,4 @@
1
- import { Inspector, ProtocolComponent, ProtocolCustomModel, ProtocolExecutionPosition, ProtocolExpression, ProtocolExpressionError, ProtocolExpressionUpdate, ProtocolModel, ProtocolModelUpdate, ProtocolNode, ProtocolParent, ProtocolReference, ProtocolReferenceError, ProtocolReferenceUpdate, ProtocolState, ProtocolStore, ProtocolTag, ProtocolRouterActionCall, ProtocolRouterStateChange, ProtocolRouterTargetResult, ProtocolRoutes, ProtocolSlotError, ProtocolFunctionCall, ProtocolFunctionResult, ProtocolFunctionError, ProtocolEventTrigger, ProtocolComposeTime, ProtocolError, DestroyData } from "vasille/dev";
1
+ import { Inspector, ProtocolComponent, ProtocolCustomModel, ProtocolExecutionPosition, ProtocolExpression, ProtocolExpressionError, ProtocolExpressionUpdate, ProtocolModel, ProtocolModelUpdate, ProtocolNode, ProtocolParent, ProtocolReference, ProtocolReferenceError, ProtocolReferenceUpdate, ProtocolState, ProtocolStore, ProtocolTag, ProtocolRouterActionCall, ProtocolRouterStateChange, ProtocolRouterTargetResult, ProtocolRoutes, ProtocolSlotError, ProtocolFunctionCall, ProtocolFunctionResult, ProtocolFunctionError, ProtocolEventTrigger, ProtocolComposeTime, ProtocolError, DestroyData, EraseData } from "vasille/dev";
2
2
  export declare abstract class AbstractInspector implements Inspector {
3
3
  addContextState(state: ProtocolState): void;
4
4
  composeTime(time: ProtocolComposeTime): void;
@@ -9,6 +9,7 @@ export declare abstract class AbstractInspector implements Inspector {
9
9
  createStore(store: ProtocolStore): void;
10
10
  createTag(tag: ProtocolTag): void;
11
11
  destroy(data: DestroyData): void;
12
+ erase(data: EraseData): void;
12
13
  eventTrigger(call: ProtocolEventTrigger): void;
13
14
  functionCall(call: ProtocolFunctionCall): void;
14
15
  functionReturn(result: ProtocolFunctionResult): void;
@@ -1,5 +1,5 @@
1
- export { DevDelay, DevWatch, DevFor, DevSwitch, DevSlot } from "./components.js";
2
- export { devStore, type DevComposed, devModel, devMount, devView } from "./compose.js";
1
+ export { DevDelay, DevWatch, DevFor, DevSwitch, DevSlot, DevSetModelView, DevMapModelView, DevArrayModelView, DevArrayView, } from "./components.js";
2
+ export { devStore, type DevComposed, devModel, devMount, devView, devDynamicalModule } from "./compose.js";
3
3
  export { devArrayModel, devMapModel, devEnsure, devExpr, devMatch, devSetModel, devRef, devSet } from "./internal.js";
4
4
  export { devAwaited } from "./library.js";
5
5
  export { AbstractInspector, EarlyInspector, earlyInspector } from "./early-inspector.js";
package/types/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- export { Delay, For, Slot, Watch, Switch } from "./components.js";
1
+ export { Delay, For, Slot, Watch, Switch, ArrayView, ArrayModelView, SetModelView, MapModelView, } from "./components.js";
2
2
  export { view, mount, model, store, type Composed, type CompositionProps } from "./compose.js";
3
3
  export { awaited } from "./library.js";
4
4
  export { ref, arrayModel, mapModel, expr, setModel, set, ensure, match } from "./internal.js";
5
+ export { type QueuedRenderProps, type QueueItem, QueuedRender } from "./queue.js";
5
6
  export { setErrorHandler } from "vasille";
@@ -0,0 +1,10 @@
1
+ import { Fragment } from "vasille";
2
+ export type QueueItem<Node, Element, TagOptions extends object> = {
3
+ node: Fragment<Node, Element, TagOptions>;
4
+ slot: (ctx: Fragment<Node, Element, TagOptions>) => void;
5
+ done: boolean;
6
+ };
7
+ export interface QueuedRenderProps {
8
+ priority?: "high" | "low";
9
+ }
10
+ export declare function QueuedRender<Node, Element, TagOptions extends object>(props: QueuedRenderProps, ctx: Fragment<Node, Element, TagOptions>, defaultSlot?: (ctx: Fragment<Node, Element, TagOptions>) => void): void;