rasti 4.0.0-alpha.9 → 4.0.1
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 +15 -9
- package/dist/rasti.js +236 -104
- package/dist/rasti.js.map +1 -1
- package/dist/rasti.min.js +1 -1
- package/dist/rasti.min.js.map +1 -1
- package/es/Component.js +140 -53
- package/es/Component.js.map +1 -1
- package/es/View.js +58 -42
- package/es/View.js.map +1 -1
- package/es/utils/dev.js +1 -0
- package/es/utils/dev.js.map +1 -1
- package/es/utils/formatTemplateSource.js +1 -1
- package/es/utils/formatTemplateSource.js.map +1 -1
- package/es/utils/replaceNode.js +28 -11
- package/es/utils/replaceNode.js.map +1 -1
- package/lib/Component.cjs +140 -53
- package/lib/Component.cjs.map +1 -1
- package/lib/View.cjs +58 -42
- package/lib/View.cjs.map +1 -1
- package/lib/utils/dev.cjs +1 -0
- package/lib/utils/dev.cjs.map +1 -1
- package/lib/utils/formatTemplateSource.cjs +1 -1
- package/lib/utils/formatTemplateSource.cjs.map +1 -1
- package/lib/utils/replaceNode.cjs +28 -11
- package/lib/utils/replaceNode.cjs.map +1 -1
- package/package.json +8 -9
- package/src/Component.js +138 -51
- package/src/View.js +58 -39
- package/src/utils/dev.js +1 -0
- package/src/utils/formatTemplateSource.js +1 -1
- package/src/utils/replaceNode.js +28 -11
- /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="https://cdn.jsdelivr.net/gh/8tentaculos/rasti@v4.0.
|
|
4
|
-
<img alt="Rasti.js" src="https://cdn.jsdelivr.net/gh/8tentaculos/rasti@v4.0.
|
|
3
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://cdn.jsdelivr.net/gh/8tentaculos/rasti@v4.0.1/docs/logo-dark.svg">
|
|
4
|
+
<img alt="Rasti.js" src="https://cdn.jsdelivr.net/gh/8tentaculos/rasti@v4.0.1/docs/logo.svg" height="120">
|
|
5
5
|
</picture>
|
|
6
6
|
</p>
|
|
7
7
|
|
|
@@ -9,7 +9,9 @@
|
|
|
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
16
|
[](https://app.travis-ci.com/8tentaculos/rasti)
|
|
15
17
|
[](https://www.npmjs.com/package/rasti)
|
|
@@ -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
|
|
|
@@ -56,8 +58,8 @@ import { Model, Component } from 'https://esm.run/rasti';
|
|
|
56
58
|
|
|
57
59
|
Include **Rasti** directly in your HTML using a CDN. Available UMD builds:
|
|
58
60
|
|
|
59
|
-
- [
|
|
60
|
-
- [
|
|
61
|
+
- [rasti.js](https://cdn.jsdelivr.net/npm/rasti/dist/rasti.js)
|
|
62
|
+
- [rasti.min.js](https://cdn.jsdelivr.net/npm/rasti/dist/rasti.min.js)
|
|
61
63
|
|
|
62
64
|
```html
|
|
63
65
|
<script src="https://cdn.jsdelivr.net/npm/rasti"></script>
|
|
@@ -121,7 +123,7 @@ const Navigation = Component.create`
|
|
|
121
123
|
// Create a Main component that includes the Navigation and displays the current route's label as the title.
|
|
122
124
|
const Main = Component.create`
|
|
123
125
|
<main>
|
|
124
|
-
<${Navigation} routes
|
|
126
|
+
<${Navigation} routes="${({ props }) => props.routes}" />
|
|
125
127
|
<section>
|
|
126
128
|
<h1>
|
|
127
129
|
${({ model, props }) => props.routes.find(
|
|
@@ -166,7 +168,7 @@ Counter.mount({ model }, document.body);
|
|
|
166
168
|
// When buttons are clicked, only the text node gets updated, not the entire component.
|
|
167
169
|
```
|
|
168
170
|
|
|
169
|
-
[Try it on CodePen](https://
|
|
171
|
+
[Try it on CodePen](https://codepen.io/8tentaculos/pen/XJXVQOR?editors=0010)
|
|
170
172
|
|
|
171
173
|
## Why Choose **Rasti**?
|
|
172
174
|
|
|
@@ -177,7 +179,7 @@ Counter.mount({ model }, document.body);
|
|
|
177
179
|
- **Lightweight and Efficient**
|
|
178
180
|
Minimal footprint with optimized performance, ensuring smooth updates.
|
|
179
181
|
- **Just the Right Abstraction**
|
|
180
|
-
Keeps you close to the DOM with no over-engineering. Fully hackable
|
|
182
|
+
Keeps you close to the DOM with no over-engineering. Fully hackable, if you're curious about how something works, just check the source code.
|
|
181
183
|
|
|
182
184
|
## Example
|
|
183
185
|
|
|
@@ -187,6 +189,10 @@ You can find a sample **TODO application** in the [example folder](https://githu
|
|
|
187
189
|
|
|
188
190
|
For detailed information on how to use **Rasti**, refer to the [API documentation](/docs/api.md).
|
|
189
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
|
+
|
|
190
196
|
## Version History
|
|
191
197
|
|
|
192
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.
|