vasille 2.3.5 → 2.3.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/README.md DELETED
@@ -1,215 +0,0 @@
1
- # Vasille Core Library
2
-
3
- ![Vasille.js logo](https://gitlab.com/vasille-js/vasille-js/-/raw/v2/img/logo.png)
4
-
5
- `Vasille` core library is frontend solution for `safe`, `fast` & `powerful` applications.
6
-
7
- [![build](https://gitlab.com/vasille-js/vasille-js/badges/v2/pipeline.svg)](https://gitlab.com/vasille-js/vasille-js)
8
- [![npm](https://img.shields.io/npm/v/vasille?style=flat-square)](https://www.npmjs.com/package/vasille)
9
-
10
- ## Table of content
11
-
12
- * [Installation](#installation)
13
- * [How to use Vasille](#how-to-use-vasille)
14
- * [How SAFE is Vasille](#how-safe-is-vasille)
15
- * [How FAST is Vasille](#how-fast-is-vasille)
16
- * [How POWERFUL is Vasille](#how-powerful-is-vasille)
17
- * [Best Practices](#best-practices)
18
-
19
-
20
- <hr>
21
-
22
- ## Installation
23
-
24
- ```
25
- npm install vasille --save
26
- npm install vasille-less --save
27
- npm install vasille-magic --save
28
- ```
29
-
30
- ## How to use Vasille
31
-
32
- There are several modes to use Vasille.
33
-
34
- ### Documentation for beginners (how to create the first project step by step):
35
- * [`Vasille Core Library` - the hard way - `low-level`](https://gitlab.com/vasille-js/vasille-js/-/blob/v2/pages/GetStarted.md)
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/vasille-magic/-/blob/master/pages/GetStarted.md)
38
-
39
- ### Full documentation:
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
- * [`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-magic/-/blob/master/pages/Vasille-Magic-API.md)
43
-
44
- ### Getting ready be example
45
- * [TypeScript Example](https://gitlab.com/vasille-js/learning/vasille-ts-example)
46
- * [JavaScript Example (Vasille Magic not supported)](https://gitlab.com/vasille-js/learning/vasille-js-example)
47
- * [Flow.js Example (Vasille Magic not supported)](https://gitlab.com/vasille-js/learning/vasille-flow-js-example)
48
-
49
- <hr>
50
-
51
- ## How SAFE is Vasille
52
-
53
- The safe of your application is ensured by
54
- * `100%` coverage of `vasille` code by unit tests.
55
- Each function, each branch are working as designed.
56
- * `strong typing` makes your javascript/typescript code safe as C++ code.
57
- All entities of `vasille` core library are strong typed, including:
58
- * data fields & properties.
59
- * computed properties (function parameters & result).
60
- * methods.
61
- * events (defined handlers & event emit).
62
- * DOM events & DOM operation (attributing, styling, etc.).
63
- * slots of component.
64
- * references to children.
65
- * What you write is what you get - there is no hidden operations, you can control everything.
66
- * No asynchronous code, when the line of code is executed, the DOM and reactive things are already synced.
67
-
68
- ## How FAST is Vasille
69
-
70
- The test project was coded using the next frameworks:
71
- * Angular /
72
- [Try Initial](https://vasille-js.gitlab.io/project-x32/angular/) /
73
- [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/angular/).
74
- * React /
75
- [Try Initial](https://vasille-js.gitlab.io/project-x32/react/) /
76
- [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/react/).
77
- * Vue 2 /
78
- [Try Initial](https://vasille-js.gitlab.io/project-x32/vue-2/) /
79
- [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/vue-2/).
80
- * Vue 3 /
81
- [Try Initial](https://vasille-js.gitlab.io/project-x32/vue-3/) /
82
- [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/vue-3/).
83
- * Svelte /
84
- [Try Initial](https://vasille-js.gitlab.io/project-x32/svelte/) /
85
- [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/svelte/).
86
- * Vasille /
87
- [Try Initial](https://vasille-js.gitlab.io/project-x32/vasille-js/) /
88
- [Try Optimized](https://vasille-js.gitlab.io/project-x32-if/vasille-js/).
89
-
90
- The result of test are demonstrated in figures 1 & 2.
91
- The test result are measured in FPS (frames per second), which is calculated as `1000 / ft`,
92
- where `ft` is an average frame time in ms of 20 frames. All values are absolute. Higher is better.
93
-
94
- The initial version is updating all the page content in each frame.
95
- The page reactivity connections are very complex, and we get poor results in Angular, React, Vue & Svelte.
96
-
97
- The optimized version disables the offscreen & non-actual content, which simplifies the
98
- reactivity complexity in time. Angular & Svelte give result similar to Vasille.
99
- React & Vue continue to be slow in the beginning of test.
100
-
101
- **Conclusion:** The reactivity system of Vasille is very fast
102
- and its complexity is not slowing down the application.
103
-
104
- <hr>
105
-
106
- &nbsp;
107
-
108
- Figure 1: Initial version
109
-
110
- ![results 1](https://gitlab.com/vasille-js/vasille-js/-/raw/v2/img/scores-wo.png)
111
-
112
- <hr>
113
-
114
- &nbsp;
115
-
116
- Figure 2: Optimized version
117
-
118
- ![results 2](https://gitlab.com/vasille-js/vasille-js/-/raw/v2/img/scores-o.png)
119
-
120
- <hr>
121
-
122
- ## How POWERFUL is Vasille
123
-
124
- The secret of `Vasille` is a good task decomposition. The core library is composed of
125
- an effective reactive module and a DOM generation engine based on it.
126
-
127
- <hr>
128
-
129
- ### Reactivity Module
130
-
131
- Reactivity module is used to create a model of data. It can contain self-updating values,
132
- forward-only shared data. Reactivity of objects/fields can be disabled/enabled manually.
133
-
134
- ![Reactivity Module](https://gitlab.com/vasille-js/vasille-js/-/raw/v2/img/reactive.png)
135
-
136
- * `Destroyable` is an entity which has a custom destructor.
137
- * `IValue<T>` is a common interface for any value container, with next members:
138
- * `get $` gets the encapsulated value.
139
- * `set $` manually update the encapsulated value, if enabled triggers updating of all linked data.
140
- * `disable` disables the reactivity.
141
- * `enable` enables the reactivity and triggers updating of all linked data.
142
- * `Reference<T>` contains a value of type `T`.
143
- * `Mirror<T>` syncs self value with another `IValue` container, can be used to share a value forward-only.
144
- * `Pointer<T>` same as `Mirror`, but it can switch between `IValue` target anytime.
145
- * `Expression<ReturnType, Args...>` is a self-updating value.
146
- * `Reactive` is a reactive object which can have multiple reactive fields, emit/receive events/signals.
147
-
148
- <hr>
149
-
150
- ### DOM Generation Engine
151
-
152
- DOM Generation Engine is used to describe a virtual DOM of reactive fragments,
153
- which will be reflected into a browser DOM and keep up to date it.
154
-
155
- ![DOM Generation Engine](https://gitlab.com/vasille-js/vasille-js/-/raw/v2/img/nodes.png)
156
-
157
- * `Fragment` describes a virtual DOM node, which has siblings, children, parent & slots.
158
- * `TextNode` reflects a `Text` node.
159
- * `INode` reflects a `Element` node.
160
- * `Tag` reflect a self created `Element` node.
161
- * `Extension` reflects an existing `Element` node.
162
- * `Component` reflects a `Element` node created by a `Tag` child.
163
- * `AppNode` is root of a `Vasille` application, can be used to create applications in application.
164
- * `App` is root of a definitive `Vasille` application.
165
- * `DebugNode` reflects a `Comment` node, useful for debug.
166
- * `Watch` recompose children nodes on model value change.
167
- * `RepeatNode` creates multiples children nodes using the same code multiple time.
168
- * `BaseView` represent a view in context of MVC (Model-View-Controller).
169
- * `ObjectView` repeats slot content for each value of `ObjectModel`.
170
- * `MapView` repeats slot content for each `MapModel` value.
171
- * `SetView` repeats slot content for each `SetModel` value.
172
- * `ArrayView` repeats slot content for each `ArrayModel` value respecting its order.
173
-
174
- <hr>
175
-
176
- ### CDN
177
-
178
- ```html
179
- ES2015 version
180
- <script src="https://unpkg.com/vasille"></script>
181
- ES5 Compatible version
182
- <script src="https://unpkg.com/vasille/cdn/es5.js"></script>
183
- ```
184
-
185
- ### Flow.js typedef
186
- Add the next lines to `[libs]` section in your `.flowconfig` file
187
- ```
188
- node_modules/vasille/flow-typed
189
- node_modules/vasille-less/flow-typed
190
- node_modules/vasille-magic/flow-typed
191
- ```
192
-
193
- ## Best Practices applicable to Vasille Core Library
194
-
195
- * [Reactive Object Practice](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/reactive-object.ts)
196
- * [Application](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/application.ts)
197
- * [Application in Application](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/application-in-application.ts)
198
- * [Signaling](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/signaling.ts)
199
- * [Forward Only Data Exchange](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/forward-only.ts)
200
- * [Absolute, Relative & Auto Values](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/auto-value.ts)
201
- * [Signaling Intercepting](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/singaling-intercepting.ts)
202
- * [Debugging](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/debugging.ts)
203
- * [Fragment vs Component](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/fragment-component.ts)
204
- * [Extensions](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/extension.ts)
205
- * [Model-View-Controller](https://gitlab.com/vasille-js/vasille-practices/-/blob/main/practices/model-view-controller.ts)
206
-
207
- ## Questions
208
-
209
- If you have questions, fell free to contact the maintainer of project:
210
-
211
- * [Author's Email](mailto:lixcode@vivaldi.net)
212
- * [Project Discord Server](https://discord.gg/SNcXNZxz)
213
- * [Author's Telegram](https://t.me/lixcode)
214
- * [Author's VK](https://vk.com/lixcode)
215
-