vasille 2.3.3 → 2.3.5
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 +5 -5
- package/flow-typed/vasille.js +14 -12
- package/lib/index.js +1 -7
- package/lib-node/index.js +5 -8
- package/package.json +3 -3
- package/types/functional/options.d.ts +1 -1
- package/types/index.d.ts +2 -8
- package/types/spec/html.d.ts +6 -6
- package/types/spec/react.d.ts +2 -2
- package/types/spec/svg.d.ts +2 -2
- package/types/value/expression.d.ts +1 -1
- package/cdn/es2015.js +0 -2480
- package/cdn/es5.js +0 -3452
package/README.md
CHANGED
|
@@ -34,12 +34,12 @@ There are several modes to use Vasille.
|
|
|
34
34
|
### Documentation for beginners (how to create the first project step by step):
|
|
35
35
|
* [`Vasille Core Library` - the hard way - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/GetStarted.md)
|
|
36
36
|
* [`Vasille Less Library` - perfect for me - `high-level`](https://gitlab.com/vasille-js/vasille-less/-/blob/v2/pages/GetStarted.md)
|
|
37
|
-
* [`Vasille Magic` - perfect for you - `highest-level`](https://gitlab.com/vasille-js/
|
|
37
|
+
* [`Vasille Magic` - perfect for you - `highest-level`](https://gitlab.com/vasille-js/vasille-magic/-/blob/master/pages/GetStarted.md)
|
|
38
38
|
|
|
39
39
|
### Full documentation:
|
|
40
40
|
* [`Vasille Core Library API`- write anything - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/Vasille-Core-Library-API.md)
|
|
41
41
|
* [`Vasille Less Library API`- write less do more - `high-level`](https://gitlab.com/vasille-js/vasille-less/-/blob/v2/pages/Vasille-Less-Library-API.md)
|
|
42
|
-
* [`Vasille Magic API`- compiler writes for you - `highest-level`](https://gitlab.com/vasille-js/vasille-
|
|
42
|
+
* [`Vasille Magic API`- compiler writes for you - `highest-level`](https://gitlab.com/vasille-js/vasille-magic/-/blob/master/pages/Vasille-Magic-API.md)
|
|
43
43
|
|
|
44
44
|
### Getting ready be example
|
|
45
45
|
* [TypeScript Example](https://gitlab.com/vasille-js/learning/vasille-ts-example)
|
|
@@ -50,7 +50,7 @@ There are several modes to use Vasille.
|
|
|
50
50
|
|
|
51
51
|
## How SAFE is Vasille
|
|
52
52
|
|
|
53
|
-
The safe of your application is ensured by
|
|
53
|
+
The safe of your application is ensured by
|
|
54
54
|
* `100%` coverage of `vasille` code by unit tests.
|
|
55
55
|
Each function, each branch are working as designed.
|
|
56
56
|
* `strong typing` makes your javascript/typescript code safe as C++ code.
|
|
@@ -87,11 +87,11 @@ The test project was coded using the next frameworks:
|
|
|
87
87
|
[Try Initial](https://vasille-js.gitlab.io/project-x32/vasille-js/) /
|
|
88
88
|
[Try Optimized](https://vasille-js.gitlab.io/project-x32-if/vasille-js/).
|
|
89
89
|
|
|
90
|
-
The result of test are demonstrated in figures 1 & 2.
|
|
90
|
+
The result of test are demonstrated in figures 1 & 2.
|
|
91
91
|
The test result are measured in FPS (frames per second), which is calculated as `1000 / ft`,
|
|
92
92
|
where `ft` is an average frame time in ms of 20 frames. All values are absolute. Higher is better.
|
|
93
93
|
|
|
94
|
-
The initial version is updating all the page content in each frame.
|
|
94
|
+
The initial version is updating all the page content in each frame.
|
|
95
95
|
The page reactivity connections are very complex, and we get poor results in Angular, React, Vue & Svelte.
|
|
96
96
|
|
|
97
97
|
The optimized version disables the offscreen & non-actual content, which simplifies the
|
package/flow-typed/vasille.js
CHANGED
|
@@ -231,7 +231,9 @@ declare class Reference<T> extends IValue<T> {
|
|
|
231
231
|
}
|
|
232
232
|
|
|
233
233
|
|
|
234
|
-
|
|
234
|
+
export type KindOfIValue<T extends any[]> = {
|
|
235
|
+
[K : string]: IValue<T[K]>;
|
|
236
|
+
};
|
|
235
237
|
/**
|
|
236
238
|
* Bind some values to one expression
|
|
237
239
|
* @class Expression
|
|
@@ -640,12 +642,12 @@ declare class SetModel<T> extends Set<T> implements ListenableModel<T, T> {
|
|
|
640
642
|
}
|
|
641
643
|
|
|
642
644
|
|
|
643
|
-
|
|
645
|
+
export type EventHandler<T> = (ev: T) => any;
|
|
644
646
|
declare interface Tag<Attrs, Events> {
|
|
645
647
|
attrs: Attrs;
|
|
646
648
|
events: Events;
|
|
647
649
|
}
|
|
648
|
-
|
|
650
|
+
type TagEvents = {
|
|
649
651
|
[K : string]: EventHandler<HTMLElementEventMap[K]> | undefined;
|
|
650
652
|
};
|
|
651
653
|
declare interface TagAttrs {
|
|
@@ -682,10 +684,10 @@ declare interface MediaTagAttrs extends TagAttrs {
|
|
|
682
684
|
muted: boolean;
|
|
683
685
|
controls: boolean;
|
|
684
686
|
}
|
|
685
|
-
|
|
687
|
+
type MediaEvents = {
|
|
686
688
|
[K : string]: EventHandler<HTMLMediaElementEventMap[K]> | undefined;
|
|
687
689
|
};
|
|
688
|
-
|
|
690
|
+
type VideoEvents = {
|
|
689
691
|
[K : string]: EventHandler<HTMLVideoElementEventMap[K]> | undefined;
|
|
690
692
|
};
|
|
691
693
|
declare interface BaseAttrs extends TagAttrs {
|
|
@@ -719,7 +721,7 @@ declare interface StyleAttrs extends TagAttrs {
|
|
|
719
721
|
media: string;
|
|
720
722
|
blocking: string;
|
|
721
723
|
}
|
|
722
|
-
|
|
724
|
+
type BodyEvents = {
|
|
723
725
|
[K : string]: EventHandler<HTMLBodyElementEventMap[K]> | undefined;
|
|
724
726
|
};
|
|
725
727
|
declare interface BlockQuoteAttrs extends TagAttrs {
|
|
@@ -1076,7 +1078,7 @@ declare interface HtmlTagMap {
|
|
|
1076
1078
|
"wbr": Tag<TagAttrs, TagEvents>;
|
|
1077
1079
|
[K: string]: Tag<TagAttrs, TagEvents>;
|
|
1078
1080
|
}
|
|
1079
|
-
|
|
1081
|
+
type HtmlOrSvgTag = HTMLElement | SVGElement;
|
|
1080
1082
|
declare interface HtmlAndSvgEvents {
|
|
1081
1083
|
onabort?: ((this: HtmlOrSvgTag, ev: UIEvent) => any) | null;
|
|
1082
1084
|
onanimationcancel?: ((this: HtmlOrSvgTag, ev: AnimationEvent) => any) | null;
|
|
@@ -1617,7 +1619,7 @@ declare interface TagNameMap {
|
|
|
1617
1619
|
|
|
1618
1620
|
|
|
1619
1621
|
|
|
1620
|
-
|
|
1622
|
+
type SvgEvents = {
|
|
1621
1623
|
[K : string]: EventHandler<SVGElementEventMap[K]> | undefined;
|
|
1622
1624
|
};
|
|
1623
1625
|
declare interface SvgAreaAttrs {
|
|
@@ -1857,7 +1859,7 @@ declare interface SvgTagMap {
|
|
|
1857
1859
|
"use": Tag<SvgUseAttrs, SvgEvents>;
|
|
1858
1860
|
"view": Tag<SvgViewAttrs, SvgEvents>;
|
|
1859
1861
|
}
|
|
1860
|
-
|
|
1862
|
+
type SvgTag = HtmlAndSvgEvents;
|
|
1861
1863
|
declare interface SvgATag extends SvgTag {
|
|
1862
1864
|
rel: string;
|
|
1863
1865
|
}
|
|
@@ -1932,8 +1934,8 @@ declare interface SvgTagNameMap {
|
|
|
1932
1934
|
|
|
1933
1935
|
|
|
1934
1936
|
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
+
export type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
|
|
1938
|
+
export type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
|
|
1937
1939
|
|
|
1938
1940
|
|
|
1939
1941
|
/**
|
|
@@ -2479,7 +2481,7 @@ declare interface FragmentOptions {
|
|
|
2479
2481
|
return?: any;
|
|
2480
2482
|
slot?: (node: Fragment, ...args: any[]) => void;
|
|
2481
2483
|
}
|
|
2482
|
-
|
|
2484
|
+
export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
|
|
2483
2485
|
declare interface TagOptions<T> extends FragmentOptions {
|
|
2484
2486
|
"v:attr"?: {
|
|
2485
2487
|
[K : string]:? AttrType<AcceptedTagsSpec[T]['attrs'][K]>;
|
package/lib/index.js
CHANGED
|
@@ -20,10 +20,4 @@ import { SetView } from "./views/set-view";
|
|
|
20
20
|
import { Binding } from "./binding/binding";
|
|
21
21
|
import { userError } from "./core/errors";
|
|
22
22
|
import { Watch } from "./node/watch";
|
|
23
|
-
|
|
24
|
-
stack,
|
|
25
|
-
unstack,
|
|
26
|
-
current,
|
|
27
|
-
userError,
|
|
28
|
-
};
|
|
29
|
-
export { Destroyable, IValue, Reference, Mirror, Pointer, ArrayModel, MapModel, ObjectModel, SetModel, BaseView, Listener, ArrayView, MapView, ObjectView, SetView, Fragment, INode, Tag, Component, Extension, AppNode, App, Portal, Expression, Binding, Reactive, Watch, less, };
|
|
23
|
+
export { Destroyable, IValue, Reference, Mirror, Pointer, ArrayModel, MapModel, ObjectModel, SetModel, BaseView, Listener, ArrayView, MapView, ObjectView, SetView, Fragment, INode, Tag, Component, Extension, AppNode, App, Portal, Expression, Binding, Reactive, Watch, stack, unstack, userError, current, };
|
package/lib-node/index.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.current = exports.userError = exports.unstack = exports.stack = exports.Watch = exports.Reactive = exports.Binding = exports.Expression = exports.Portal = exports.App = exports.AppNode = exports.Extension = exports.Component = exports.Tag = exports.INode = exports.Fragment = exports.SetView = exports.ObjectView = exports.MapView = exports.ArrayView = exports.Listener = exports.BaseView = exports.SetModel = exports.ObjectModel = exports.MapModel = exports.ArrayModel = exports.Pointer = exports.Mirror = exports.Reference = exports.IValue = exports.Destroyable = void 0;
|
|
4
4
|
const destroyable_1 = require("./core/destroyable");
|
|
5
5
|
Object.defineProperty(exports, "Destroyable", { enumerable: true, get: function () { return destroyable_1.Destroyable; } });
|
|
6
6
|
const core_1 = require("./core/core");
|
|
7
|
+
Object.defineProperty(exports, "current", { enumerable: true, get: function () { return core_1.current; } });
|
|
7
8
|
Object.defineProperty(exports, "Reactive", { enumerable: true, get: function () { return core_1.Reactive; } });
|
|
9
|
+
Object.defineProperty(exports, "stack", { enumerable: true, get: function () { return core_1.stack; } });
|
|
10
|
+
Object.defineProperty(exports, "unstack", { enumerable: true, get: function () { return core_1.unstack; } });
|
|
8
11
|
const ivalue_1 = require("./core/ivalue");
|
|
9
12
|
Object.defineProperty(exports, "IValue", { enumerable: true, get: function () { return ivalue_1.IValue; } });
|
|
10
13
|
const array_model_1 = require("./models/array-model");
|
|
@@ -48,12 +51,6 @@ Object.defineProperty(exports, "SetView", { enumerable: true, get: function () {
|
|
|
48
51
|
const binding_1 = require("./binding/binding");
|
|
49
52
|
Object.defineProperty(exports, "Binding", { enumerable: true, get: function () { return binding_1.Binding; } });
|
|
50
53
|
const errors_1 = require("./core/errors");
|
|
54
|
+
Object.defineProperty(exports, "userError", { enumerable: true, get: function () { return errors_1.userError; } });
|
|
51
55
|
const watch_1 = require("./node/watch");
|
|
52
56
|
Object.defineProperty(exports, "Watch", { enumerable: true, get: function () { return watch_1.Watch; } });
|
|
53
|
-
const less = {
|
|
54
|
-
stack: core_1.stack,
|
|
55
|
-
unstack: core_1.unstack,
|
|
56
|
-
current: core_1.current,
|
|
57
|
-
userError: errors_1.userError,
|
|
58
|
-
};
|
|
59
|
-
exports.less = less;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Vasille - Safe. Fast. Powerful.",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
|
-
"version": "2.3.
|
|
6
|
+
"version": "2.3.5",
|
|
7
7
|
"exports": {
|
|
8
8
|
"import": "./lib/index.js",
|
|
9
9
|
"browser": "./lib/index.js",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@types/events": "3.0.0",
|
|
47
47
|
"@types/jest": "27.4.1",
|
|
48
48
|
"@types/jsdom": "16.2.14",
|
|
49
|
-
"@types/node": "
|
|
49
|
+
"@types/node": "^18.14.6",
|
|
50
50
|
"@typescript-eslint/eslint-plugin": "5.18.0",
|
|
51
51
|
"@typescript-eslint/parser": "5.18.0",
|
|
52
52
|
"es-check": "latest",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"prettier": "2.7.1",
|
|
58
58
|
"ts-jest": "27.1.4",
|
|
59
59
|
"tslint-config-prettier": "^1.18.0",
|
|
60
|
-
"typescript": "
|
|
60
|
+
"typescript": "^4.9.5"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -6,7 +6,7 @@ export interface FragmentOptions {
|
|
|
6
6
|
return?: any;
|
|
7
7
|
slot?: (node: Fragment, ...args: any[]) => void;
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined;
|
|
10
10
|
export interface TagOptions<T extends keyof AcceptedTagsMap> extends FragmentOptions {
|
|
11
11
|
"v:attr"?: {
|
|
12
12
|
[K in keyof AcceptedTagsSpec[T]['attrs']]?: AttrType<AcceptedTagsSpec[T]['attrs'][K]>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Destroyable } from "./core/destroyable";
|
|
2
|
-
import { Reactive, stack, unstack } from "./core/core";
|
|
2
|
+
import { current, Reactive, stack, unstack } from "./core/core";
|
|
3
3
|
import { IValue } from "./core/ivalue";
|
|
4
4
|
import { ArrayModel } from "./models/array-model";
|
|
5
5
|
import { Listener } from "./models/listener";
|
|
@@ -23,10 +23,4 @@ import { AcceptedTagsMap, AcceptedTagsSpec } from "./spec/react";
|
|
|
23
23
|
import { userError } from "./core/errors";
|
|
24
24
|
import { ListenableModel } from "./models/model";
|
|
25
25
|
import { Watch } from "./node/watch";
|
|
26
|
-
|
|
27
|
-
stack: typeof stack;
|
|
28
|
-
unstack: typeof unstack;
|
|
29
|
-
current: Reactive<FragmentOptions>;
|
|
30
|
-
userError: typeof userError;
|
|
31
|
-
};
|
|
32
|
-
export { Destroyable, IValue, Reference, Mirror, Pointer, ArrayModel, MapModel, ObjectModel, SetModel, BaseView, Listener, ArrayView, MapView, ObjectView, SetView, Fragment, INode, Tag, Component, Extension, AppNode, App, Portal, Expression, Binding, Reactive, Watch, FragmentOptions, TagOptions, AppOptions, AcceptedTagsSpec, AcceptedTagsMap, KindOfIValue, ListenableModel, TagOptionsWithSlot, less, };
|
|
26
|
+
export { Destroyable, IValue, Reference, Mirror, Pointer, ArrayModel, MapModel, ObjectModel, SetModel, BaseView, Listener, ArrayView, MapView, ObjectView, SetView, Fragment, INode, Tag, Component, Extension, AppNode, App, Portal, Expression, Binding, Reactive, Watch, FragmentOptions, TagOptions, AppOptions, AcceptedTagsSpec, AcceptedTagsMap, KindOfIValue, ListenableModel, TagOptionsWithSlot, stack, unstack, userError, current, };
|
package/types/spec/html.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type EventHandler<T> = (ev: T) => any;
|
|
2
2
|
export interface Tag<Attrs, Events> {
|
|
3
3
|
attrs: Attrs;
|
|
4
4
|
events: Events;
|
|
5
5
|
}
|
|
6
|
-
|
|
6
|
+
type TagEvents = {
|
|
7
7
|
[K in keyof HTMLElementEventMap]: EventHandler<HTMLElementEventMap[K]> | undefined;
|
|
8
8
|
};
|
|
9
9
|
interface TagAttrs {
|
|
@@ -40,10 +40,10 @@ interface MediaTagAttrs extends TagAttrs {
|
|
|
40
40
|
muted: boolean;
|
|
41
41
|
controls: boolean;
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
type MediaEvents = {
|
|
44
44
|
[K in keyof HTMLMediaElementEventMap]: EventHandler<HTMLMediaElementEventMap[K]> | undefined;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
type VideoEvents = {
|
|
47
47
|
[K in keyof HTMLVideoElementEventMap]: EventHandler<HTMLVideoElementEventMap[K]> | undefined;
|
|
48
48
|
};
|
|
49
49
|
interface BaseAttrs extends TagAttrs {
|
|
@@ -77,7 +77,7 @@ interface StyleAttrs extends TagAttrs {
|
|
|
77
77
|
media: string;
|
|
78
78
|
blocking: string;
|
|
79
79
|
}
|
|
80
|
-
|
|
80
|
+
type BodyEvents = {
|
|
81
81
|
[K in keyof HTMLBodyElementEventMap]: EventHandler<HTMLBodyElementEventMap[K]> | undefined;
|
|
82
82
|
};
|
|
83
83
|
interface BlockQuoteAttrs extends TagAttrs {
|
|
@@ -434,7 +434,7 @@ export interface HtmlTagMap {
|
|
|
434
434
|
"wbr": Tag<TagAttrs, TagEvents>;
|
|
435
435
|
[K: string]: Tag<TagAttrs, TagEvents>;
|
|
436
436
|
}
|
|
437
|
-
|
|
437
|
+
type HtmlOrSvgTag = HTMLElement | SVGElement;
|
|
438
438
|
export interface HtmlAndSvgEvents {
|
|
439
439
|
onabort?: ((this: HtmlOrSvgTag, ev: UIEvent) => any) | null;
|
|
440
440
|
onanimationcancel?: ((this: HtmlOrSvgTag, ev: AnimationEvent) => any) | null;
|
package/types/spec/react.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { SvgTagMap, SvgTagNameMap } from "./svg";
|
|
2
2
|
import { HtmlTagMap, TagNameMap } from "./html";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export type AcceptedTagsMap = TagNameMap & SvgTagNameMap;
|
|
4
|
+
export type AcceptedTagsSpec = HtmlTagMap & SvgTagMap;
|
package/types/spec/svg.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EventHandler, HtmlAndSvgEvents, Tag } from "./html";
|
|
2
|
-
|
|
2
|
+
type SvgEvents = {
|
|
3
3
|
[K in keyof SVGElementEventMap]: EventHandler<SVGElementEventMap[K]> | undefined;
|
|
4
4
|
};
|
|
5
5
|
interface SvgAreaAttrs {
|
|
@@ -239,7 +239,7 @@ export interface SvgTagMap {
|
|
|
239
239
|
"use": Tag<SvgUseAttrs, SvgEvents>;
|
|
240
240
|
"view": Tag<SvgViewAttrs, SvgEvents>;
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
type SvgTag = HtmlAndSvgEvents;
|
|
243
243
|
interface SvgATag extends SvgTag {
|
|
244
244
|
rel: string;
|
|
245
245
|
}
|