rasti 4.0.0-alpha.1 → 4.0.0-alpha.10
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 +32 -17
- package/dist/rasti.js +906 -379
- package/dist/rasti.js.map +1 -0
- package/dist/rasti.min.js +2 -1
- package/dist/rasti.min.js.map +1 -0
- package/es/Component.js +485 -244
- package/es/Component.js.map +1 -0
- package/es/Emitter.js +6 -0
- package/es/Emitter.js.map +1 -0
- package/es/Model.js +6 -0
- package/es/Model.js.map +1 -0
- package/es/View.js +26 -9
- package/es/View.js.map +1 -0
- package/es/core/Element.js +3 -2
- package/es/core/Element.js.map +1 -0
- package/es/core/EventsManager.js +1 -0
- package/es/core/EventsManager.js.map +1 -0
- package/es/core/Interpolation.js +67 -25
- package/es/core/Interpolation.js.map +1 -0
- package/es/core/Partial.js +1 -0
- package/es/core/Partial.js.map +1 -0
- package/es/core/PathManager.js +24 -6
- package/es/core/PathManager.js.map +1 -0
- package/es/core/SafeHTML.js +1 -0
- package/es/core/SafeHTML.js.map +1 -0
- package/es/index.js +10 -2
- package/es/index.js.map +1 -0
- package/es/utils/createDevelopmentErrorMessage.js +46 -0
- package/es/utils/createDevelopmentErrorMessage.js.map +1 -0
- package/es/utils/createProductionErrorMessage.js +13 -0
- package/es/utils/createProductionErrorMessage.js.map +1 -0
- package/es/utils/deepFlat.js +1 -0
- package/es/utils/deepFlat.js.map +1 -0
- package/es/utils/dev.js +13 -0
- package/es/utils/dev.js.map +1 -0
- package/es/utils/findComment.js +1 -0
- package/es/utils/findComment.js.map +1 -0
- package/es/utils/formatTemplateSource.js +115 -0
- package/es/utils/formatTemplateSource.js.map +1 -0
- package/es/utils/getAttributesDiff.js +9 -6
- package/es/utils/getAttributesDiff.js.map +1 -0
- package/es/utils/getAttributesHTML.js +1 -0
- package/es/utils/getAttributesHTML.js.map +1 -0
- package/es/utils/getResult.js +1 -0
- package/es/utils/getResult.js.map +1 -0
- package/es/utils/padEnd.js +17 -0
- package/es/utils/padEnd.js.map +1 -0
- package/es/utils/padStart.js +17 -0
- package/es/utils/padStart.js.map +1 -0
- package/es/utils/parseHTML.js +1 -0
- package/es/utils/parseHTML.js.map +1 -0
- package/es/utils/repeat.js +15 -0
- package/es/utils/repeat.js.map +1 -0
- package/es/utils/replaceNode.js +42 -0
- package/es/utils/replaceNode.js.map +1 -0
- package/es/utils/syncNode.js +1 -0
- package/es/utils/syncNode.js.map +1 -0
- package/es/utils/validateListener.js +9 -1
- package/es/utils/validateListener.js.map +1 -0
- package/lib/Component.cjs +485 -244
- package/lib/Component.cjs.map +1 -0
- package/lib/Emitter.cjs +6 -0
- package/lib/Emitter.cjs.map +1 -0
- package/lib/Model.cjs +6 -0
- package/lib/Model.cjs.map +1 -0
- package/lib/View.cjs +26 -9
- package/lib/View.cjs.map +1 -0
- package/lib/core/Element.cjs +3 -2
- package/lib/core/Element.cjs.map +1 -0
- package/lib/core/EventsManager.cjs +1 -0
- package/lib/core/EventsManager.cjs.map +1 -0
- package/lib/core/Interpolation.cjs +67 -25
- package/lib/core/Interpolation.cjs.map +1 -0
- package/lib/core/Partial.cjs +1 -0
- package/lib/core/Partial.cjs.map +1 -0
- package/lib/core/PathManager.cjs +24 -6
- package/lib/core/PathManager.cjs.map +1 -0
- package/lib/core/SafeHTML.cjs +1 -0
- package/lib/core/SafeHTML.cjs.map +1 -0
- package/lib/index.cjs +10 -2
- package/lib/index.cjs.map +1 -0
- package/lib/utils/createDevelopmentErrorMessage.cjs +48 -0
- package/lib/utils/createDevelopmentErrorMessage.cjs.map +1 -0
- package/lib/utils/createProductionErrorMessage.cjs +15 -0
- package/lib/utils/createProductionErrorMessage.cjs.map +1 -0
- package/lib/utils/deepFlat.cjs +1 -0
- package/lib/utils/deepFlat.cjs.map +1 -0
- package/lib/utils/dev.cjs +15 -0
- package/lib/utils/dev.cjs.map +1 -0
- package/lib/utils/findComment.cjs +1 -0
- package/lib/utils/findComment.cjs.map +1 -0
- package/lib/utils/formatTemplateSource.cjs +117 -0
- package/lib/utils/formatTemplateSource.cjs.map +1 -0
- package/lib/utils/getAttributesDiff.cjs +9 -6
- package/lib/utils/getAttributesDiff.cjs.map +1 -0
- package/lib/utils/getAttributesHTML.cjs +1 -0
- package/lib/utils/getAttributesHTML.cjs.map +1 -0
- package/lib/utils/getResult.cjs +1 -0
- package/lib/utils/getResult.cjs.map +1 -0
- package/lib/utils/padEnd.cjs +19 -0
- package/lib/utils/padEnd.cjs.map +1 -0
- package/lib/utils/padStart.cjs +19 -0
- package/lib/utils/padStart.cjs.map +1 -0
- package/lib/utils/parseHTML.cjs +1 -0
- package/lib/utils/parseHTML.cjs.map +1 -0
- package/lib/utils/repeat.cjs +17 -0
- package/lib/utils/repeat.cjs.map +1 -0
- package/lib/utils/replaceNode.cjs +44 -0
- package/lib/utils/replaceNode.cjs.map +1 -0
- package/lib/utils/syncNode.cjs +1 -0
- package/lib/utils/syncNode.cjs.map +1 -0
- package/lib/utils/validateListener.cjs +9 -1
- package/lib/utils/validateListener.cjs.map +1 -0
- package/package.json +4 -2
- package/src/Component.js +480 -244
- package/src/View.js +20 -9
- package/src/core/Element.js +2 -2
- package/src/core/Interpolation.js +66 -25
- package/src/core/PathManager.js +23 -6
- package/src/index.js +0 -1
- package/src/utils/createDevelopmentErrorMessage.js +43 -0
- package/src/utils/createProductionErrorMessage.js +10 -0
- package/src/utils/dev.js +12 -0
- package/src/utils/formatTemplateSource.js +112 -0
- package/src/utils/getAttributesDiff.js +8 -6
- package/src/utils/padEnd.js +14 -0
- package/src/utils/padStart.js +14 -0
- package/src/utils/repeat.js +12 -0
- package/src/utils/replaceNode.js +39 -0
- package/src/utils/validateListener.js +6 -1
- package/es/core/InterpolationWrapper.js +0 -14
- package/lib/core/InterpolationWrapper.cjs +0 -16
- package/src/core/InterpolationWrapper.js +0 -14
- /package/{LICENSE.md → LICENSE} +0 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<p align="center">
|
|
2
2
|
<picture>
|
|
3
|
-
<source media="(prefers-color-scheme: dark)" srcset="docs/logo-dark.svg">
|
|
4
|
-
<img alt="Rasti.js" src="docs/logo.svg" height="120">
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/8tentaculos/rasti@v4.0.0-alpha.10/docs/logo-dark.svg">
|
|
4
|
+
<img alt="Rasti.js" src="https://cdn.jsdelivr.net/gh/8tentaculos/rasti@v4.0.0-alpha.10/docs/logo.svg" height="120">
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
@@ -9,13 +9,15 @@
|
|
|
9
9
|
<b>Modern MVC for building user interfaces</b>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
**Rasti
|
|
12
|
+
**Rasti is a lightweight MVC library for building fast, reactive user interfaces.**
|
|
13
|
+
It provides declarative, composable **components** for building state-driven UIs.
|
|
14
|
+
Its low-level MVC core, inspired by **Backbone.js**’s architecture, provides **models**, **views** and **event emitters** as the fundamental building blocks.
|
|
13
15
|
|
|
14
|
-
[](https://img.shields.io/jsdelivr/npm/hm/rasti
|
|
16
|
+
[](https://app.travis-ci.com/8tentaculos/rasti)
|
|
17
|
+
[](https://www.npmjs.com/package/rasti)
|
|
18
|
+
[](https://unpkg.com/rasti/dist/rasti.min.js)
|
|
19
|
+
[](https://www.npmjs.com/package/rasti)
|
|
20
|
+
[](https://www.jsdelivr.com/package/npm/rasti)
|
|
19
21
|
|
|
20
22
|
## Key Features
|
|
21
23
|
|
|
@@ -30,7 +32,7 @@
|
|
|
30
32
|
- **Lightweight and Fast** ⚡
|
|
31
33
|
Minimal overhead with efficient rendering.
|
|
32
34
|
- **Legacy Compatibility** 🕰️
|
|
33
|
-
Seamlessly integrates into existing **Backbone.js** projects.
|
|
35
|
+
Seamlessly integrates into existing **Backbone.js** legacy projects.
|
|
34
36
|
- **Standards-Based** 📐
|
|
35
37
|
Built on modern web standards, no tooling required.
|
|
36
38
|
|
|
@@ -46,18 +48,25 @@ $ npm install rasti
|
|
|
46
48
|
import { Model, Component } from 'rasti';
|
|
47
49
|
```
|
|
48
50
|
|
|
49
|
-
### Using ES modules
|
|
51
|
+
### Using ES modules via CDN
|
|
50
52
|
|
|
51
53
|
```javascript
|
|
52
54
|
import { Model, Component } from 'https://esm.run/rasti';
|
|
53
55
|
```
|
|
54
56
|
|
|
55
|
-
### Using a
|
|
57
|
+
### Using a UMD build via CDN
|
|
58
|
+
|
|
59
|
+
Include **Rasti** directly in your HTML using a CDN. Available UMD builds:
|
|
60
|
+
|
|
61
|
+
- [https://cdn.jsdelivr.net/npm/rasti/dist/rasti.js](https://cdn.jsdelivr.net/npm/rasti/dist/rasti.js)
|
|
62
|
+
- [https://cdn.jsdelivr.net/npm/rasti/dist/rasti.min.js](https://cdn.jsdelivr.net/npm/rasti/dist/rasti.min.js)
|
|
56
63
|
|
|
57
64
|
```html
|
|
58
|
-
<script src="https://cdn.jsdelivr.net/npm/rasti
|
|
65
|
+
<script src="https://cdn.jsdelivr.net/npm/rasti"></script>
|
|
59
66
|
```
|
|
60
67
|
|
|
68
|
+
The UMD build exposes the `Rasti` global object:
|
|
69
|
+
|
|
61
70
|
```javascript
|
|
62
71
|
const { Model, Component } = Rasti;
|
|
63
72
|
```
|
|
@@ -159,7 +168,7 @@ Counter.mount({ model }, document.body);
|
|
|
159
168
|
// When buttons are clicked, only the text node gets updated, not the entire component.
|
|
160
169
|
```
|
|
161
170
|
|
|
162
|
-
[Try it on CodePen](https://
|
|
171
|
+
[Try it on CodePen](https://codepen.io/8tentaculos/pen/XJXVQOR?editors=0010)
|
|
163
172
|
|
|
164
173
|
## Why Choose **Rasti**?
|
|
165
174
|
|
|
@@ -180,12 +189,18 @@ You can find a sample **TODO application** in the [example folder](https://githu
|
|
|
180
189
|
|
|
181
190
|
For detailed information on how to use **Rasti**, refer to the [API documentation](/docs/api.md).
|
|
182
191
|
|
|
192
|
+
## Working with LLMs
|
|
193
|
+
|
|
194
|
+
For those working with LLMs, there is an [AI Agents reference guide](/docs/AGENTS.md) that provides API patterns, lifecycle methods, and best practices, optimized for LLM context. You can share this guide with AI assistants to help them understand **Rasti**'s architecture and component APIs.
|
|
195
|
+
|
|
183
196
|
## Version History
|
|
184
197
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
- **[
|
|
188
|
-
- **[
|
|
198
|
+
We strive to minimize breaking changes between major versions. However, if you're migrating between major versions, please refer to the release notes below for details on any breaking changes and migration tips.
|
|
199
|
+
|
|
200
|
+
- **[v4.0.0](https://github.com/8tentaculos/rasti/releases/tag/v4.0.0)**
|
|
201
|
+
- **[v3.0.0](https://github.com/8tentaculos/rasti/releases/tag/v3.0.0)**
|
|
202
|
+
- **[v2.0.0](https://github.com/8tentaculos/rasti/releases/tag/v2.0.0)**
|
|
203
|
+
- **[v1.0.0](https://github.com/8tentaculos/rasti/releases/tag/v1.0.0)**
|
|
189
204
|
|
|
190
205
|
## License
|
|
191
206
|
|