rasti 4.0.0-alpha.0 → 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.
Files changed (134) hide show
  1. package/README.md +30 -25
  2. package/dist/rasti.js +931 -390
  3. package/dist/rasti.js.map +1 -0
  4. package/dist/rasti.min.js +2 -1
  5. package/dist/rasti.min.js.map +1 -0
  6. package/es/Component.js +510 -255
  7. package/es/Component.js.map +1 -0
  8. package/es/Emitter.js +6 -0
  9. package/es/Emitter.js.map +1 -0
  10. package/es/Model.js +6 -0
  11. package/es/Model.js.map +1 -0
  12. package/es/View.js +26 -9
  13. package/es/View.js.map +1 -0
  14. package/es/core/Element.js +3 -2
  15. package/es/core/Element.js.map +1 -0
  16. package/es/core/EventsManager.js +1 -0
  17. package/es/core/EventsManager.js.map +1 -0
  18. package/es/core/Interpolation.js +67 -25
  19. package/es/core/Interpolation.js.map +1 -0
  20. package/es/core/Partial.js +1 -0
  21. package/es/core/Partial.js.map +1 -0
  22. package/es/core/PathManager.js +24 -6
  23. package/es/core/PathManager.js.map +1 -0
  24. package/es/core/SafeHTML.js +1 -0
  25. package/es/core/SafeHTML.js.map +1 -0
  26. package/es/index.js +10 -2
  27. package/es/index.js.map +1 -0
  28. package/es/utils/createDevelopmentErrorMessage.js +46 -0
  29. package/es/utils/createDevelopmentErrorMessage.js.map +1 -0
  30. package/es/utils/createProductionErrorMessage.js +13 -0
  31. package/es/utils/createProductionErrorMessage.js.map +1 -0
  32. package/es/utils/deepFlat.js +1 -0
  33. package/es/utils/deepFlat.js.map +1 -0
  34. package/es/utils/dev.js +13 -0
  35. package/es/utils/dev.js.map +1 -0
  36. package/es/utils/findComment.js +1 -0
  37. package/es/utils/findComment.js.map +1 -0
  38. package/es/utils/formatTemplateSource.js +115 -0
  39. package/es/utils/formatTemplateSource.js.map +1 -0
  40. package/es/utils/getAttributesDiff.js +9 -6
  41. package/es/utils/getAttributesDiff.js.map +1 -0
  42. package/es/utils/getAttributesHTML.js +1 -0
  43. package/es/utils/getAttributesHTML.js.map +1 -0
  44. package/es/utils/getResult.js +1 -0
  45. package/es/utils/getResult.js.map +1 -0
  46. package/es/utils/padEnd.js +17 -0
  47. package/es/utils/padEnd.js.map +1 -0
  48. package/es/utils/padStart.js +17 -0
  49. package/es/utils/padStart.js.map +1 -0
  50. package/es/utils/parseHTML.js +1 -0
  51. package/es/utils/parseHTML.js.map +1 -0
  52. package/es/utils/repeat.js +15 -0
  53. package/es/utils/repeat.js.map +1 -0
  54. package/es/utils/replaceNode.js +42 -0
  55. package/es/utils/replaceNode.js.map +1 -0
  56. package/es/utils/syncNode.js +1 -0
  57. package/es/utils/syncNode.js.map +1 -0
  58. package/es/utils/validateListener.js +9 -1
  59. package/es/utils/validateListener.js.map +1 -0
  60. package/lib/Component.cjs +510 -255
  61. package/lib/Component.cjs.map +1 -0
  62. package/lib/Emitter.cjs +6 -0
  63. package/lib/Emitter.cjs.map +1 -0
  64. package/lib/Model.cjs +6 -0
  65. package/lib/Model.cjs.map +1 -0
  66. package/lib/View.cjs +26 -9
  67. package/lib/View.cjs.map +1 -0
  68. package/lib/core/Element.cjs +3 -2
  69. package/lib/core/Element.cjs.map +1 -0
  70. package/lib/core/EventsManager.cjs +1 -0
  71. package/lib/core/EventsManager.cjs.map +1 -0
  72. package/lib/core/Interpolation.cjs +67 -25
  73. package/lib/core/Interpolation.cjs.map +1 -0
  74. package/lib/core/Partial.cjs +1 -0
  75. package/lib/core/Partial.cjs.map +1 -0
  76. package/lib/core/PathManager.cjs +24 -6
  77. package/lib/core/PathManager.cjs.map +1 -0
  78. package/lib/core/SafeHTML.cjs +1 -0
  79. package/lib/core/SafeHTML.cjs.map +1 -0
  80. package/lib/index.cjs +10 -2
  81. package/lib/index.cjs.map +1 -0
  82. package/lib/utils/createDevelopmentErrorMessage.cjs +48 -0
  83. package/lib/utils/createDevelopmentErrorMessage.cjs.map +1 -0
  84. package/lib/utils/createProductionErrorMessage.cjs +15 -0
  85. package/lib/utils/createProductionErrorMessage.cjs.map +1 -0
  86. package/lib/utils/deepFlat.cjs +1 -0
  87. package/lib/utils/deepFlat.cjs.map +1 -0
  88. package/lib/utils/dev.cjs +15 -0
  89. package/lib/utils/dev.cjs.map +1 -0
  90. package/lib/utils/findComment.cjs +1 -0
  91. package/lib/utils/findComment.cjs.map +1 -0
  92. package/lib/utils/formatTemplateSource.cjs +117 -0
  93. package/lib/utils/formatTemplateSource.cjs.map +1 -0
  94. package/lib/utils/getAttributesDiff.cjs +9 -6
  95. package/lib/utils/getAttributesDiff.cjs.map +1 -0
  96. package/lib/utils/getAttributesHTML.cjs +1 -0
  97. package/lib/utils/getAttributesHTML.cjs.map +1 -0
  98. package/lib/utils/getResult.cjs +1 -0
  99. package/lib/utils/getResult.cjs.map +1 -0
  100. package/lib/utils/padEnd.cjs +19 -0
  101. package/lib/utils/padEnd.cjs.map +1 -0
  102. package/lib/utils/padStart.cjs +19 -0
  103. package/lib/utils/padStart.cjs.map +1 -0
  104. package/lib/utils/parseHTML.cjs +1 -0
  105. package/lib/utils/parseHTML.cjs.map +1 -0
  106. package/lib/utils/repeat.cjs +17 -0
  107. package/lib/utils/repeat.cjs.map +1 -0
  108. package/lib/utils/replaceNode.cjs +44 -0
  109. package/lib/utils/replaceNode.cjs.map +1 -0
  110. package/lib/utils/syncNode.cjs +1 -0
  111. package/lib/utils/syncNode.cjs.map +1 -0
  112. package/lib/utils/validateListener.cjs +9 -1
  113. package/lib/utils/validateListener.cjs.map +1 -0
  114. package/package.json +4 -2
  115. package/src/Component.js +505 -255
  116. package/src/View.js +20 -9
  117. package/src/core/Element.js +2 -2
  118. package/src/core/Interpolation.js +66 -25
  119. package/src/core/PathManager.js +23 -6
  120. package/src/index.js +0 -1
  121. package/src/utils/createDevelopmentErrorMessage.js +43 -0
  122. package/src/utils/createProductionErrorMessage.js +10 -0
  123. package/src/utils/dev.js +12 -0
  124. package/src/utils/formatTemplateSource.js +112 -0
  125. package/src/utils/getAttributesDiff.js +8 -6
  126. package/src/utils/padEnd.js +14 -0
  127. package/src/utils/padStart.js +14 -0
  128. package/src/utils/repeat.js +12 -0
  129. package/src/utils/replaceNode.js +39 -0
  130. package/src/utils/validateListener.js +6 -1
  131. package/es/core/InterpolationWrapper.js +0 -14
  132. package/lib/core/InterpolationWrapper.cjs +0 -16
  133. package/src/core/InterpolationWrapper.js +0 -14
  134. /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** is a lightweight MVC library for building fast, reactive user interfaces. Inspired by **Backbone.js**, it retains a familiar API while removing non-essential features and introducing modern, declarative, and composable components to simplify complex UI development.
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
- [![Travis (.com)](https://img.shields.io/travis/com/8tentaculos/rasti?style=flat-square)](https://app.travis-ci.com/8tentaculos/rasti)
15
- [![npm version](https://img.shields.io/npm/v/rasti.svg?style=flat-square)](https://www.npmjs.com/package/rasti)
16
- [![npm package minimized gzipped size](https://img.shields.io/bundlejs/size/rasti?style=flat-square)](https://unpkg.com/rasti/dist/rasti.min.js)
17
- [![npm downloads](https://img.shields.io/npm/dm/rasti.svg?style=flat-square)](https://www.npmjs.com/package/rasti)
18
- [![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/rasti?style=flat-square)](https://www.jsdelivr.com/package/npm/rasti)
16
+ [![Travis (.com)](https://img.shields.io/travis/com/8tentaculos/rasti)](https://app.travis-ci.com/8tentaculos/rasti)
17
+ [![npm version](https://img.shields.io/npm/v/rasti.svg)](https://www.npmjs.com/package/rasti)
18
+ [![npm package minimized gzipped size](https://img.shields.io/bundlejs/size/rasti)](https://unpkg.com/rasti/dist/rasti.min.js)
19
+ [![npm downloads](https://img.shields.io/npm/dm/rasti.svg)](https://www.npmjs.com/package/rasti)
20
+ [![jsDelivr hits (npm)](https://img.shields.io/jsdelivr/npm/hm/rasti)](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 `<script>` tag
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/dist/rasti.min.js"></script>
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://https://codepen.io/8tentaculos/pen/XJXVQOR?editors=0010)
171
+ [Try it on CodePen](https://codepen.io/8tentaculos/pen/XJXVQOR?editors=0010)
163
172
 
164
173
  ## Why Choose **Rasti**?
165
174
 
@@ -180,22 +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
 
183
- ## Version History
192
+ ## Working with LLMs
184
193
 
185
- - **[v4.0.0](https://github.com/8tentaculos/rasti/releases/tag/v4.0.0)** - Current version with simpler event handling, smarter component reuse, and granular DOM updates
186
- - **[v3.0.0](https://github.com/8tentaculos/rasti/releases/tag/v3.0.0)** - Introduced **Containers**, dynamic element tags, **Component** tags, `partial` method, and dropped ES5 support
187
- - **[v2.0.0](https://github.com/8tentaculos/rasti/releases/tag/v2.0.0)** - Introduced **Components**
188
- - **[v1.0.0](https://github.com/8tentaculos/rasti/releases/tag/v1.0.0)** - Initial release
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.
189
195
 
190
- ## Powered by **Rasti**
191
-
192
- ### [Crypto Babylon](https://cryptobabylon.net)
193
-
194
- A market analytics platform efficiently rendering over 1000 dynamic rows, updated in real-time with thousands of messages per second via multiple WebSocket connections.
196
+ ## Version History
195
197
 
196
- ### [jsPacman](https://pacman.js.org)
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.
197
199
 
198
- A DOM-based remake of the classic Ms. Pac-Man game. **Rasti** powers its custom game engine.
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)**
199
204
 
200
205
  ## License
201
206