eleva 1.2.17-beta โ 1.2.19-beta
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 +27 -15
- package/dist/eleva.cjs.js +352 -155
- package/dist/eleva.cjs.js.map +1 -1
- package/dist/eleva.d.ts +271 -103
- package/dist/eleva.esm.js +352 -155
- package/dist/eleva.esm.js.map +1 -1
- package/dist/eleva.umd.js +352 -155
- package/dist/eleva.umd.js.map +1 -1
- package/dist/eleva.umd.min.js +2 -2
- package/dist/eleva.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/src/core/Eleva.js +143 -75
- package/src/modules/Emitter.js +23 -7
- package/src/modules/Renderer.js +187 -77
- package/src/modules/Signal.js +10 -7
- package/src/modules/TemplateEngine.js +6 -3
- package/types/core/Eleva.d.ts +164 -68
- package/types/core/Eleva.d.ts.map +1 -1
- package/types/modules/Emitter.d.ts +26 -10
- package/types/modules/Emitter.d.ts.map +1 -1
- package/types/modules/Renderer.d.ts +70 -16
- package/types/modules/Renderer.d.ts.map +1 -1
- package/types/modules/Signal.d.ts +11 -9
- package/types/modules/Signal.d.ts.map +1 -1
- package/types/modules/TemplateEngine.d.ts +8 -5
- package/types/modules/TemplateEngine.d.ts.map +1 -1
package/README.md
CHANGED
|
@@ -29,10 +29,9 @@ Pure JavaScript, Pure Performance, Simply Elegant.
|
|
|
29
29
|
**A minimalist, lightweight, pure vanilla JavaScript frontend runtime framework.**
|
|
30
30
|
_Built with love for native JavaScript-because sometimes, less really is more!_ ๐
|
|
31
31
|
|
|
32
|
-
> **Stability Notice**: This is `v1.2.
|
|
33
|
-
> While suitable for production use, please be aware of the [known limitations](docs/known-limitations.md).
|
|
32
|
+
> **Stability Notice**: This is `v1.2.19-beta` - The core functionality is stable, but I'm seeking community feedback before the final v1.0.0 release.
|
|
34
33
|
|
|
35
|
-
**Version:** `1.2.
|
|
34
|
+
**Version:** `1.2.19-beta`
|
|
36
35
|
|
|
37
36
|
|
|
38
37
|
|
|
@@ -118,14 +117,17 @@ This unique, developer-first approach makes Eleva a standout choice for building
|
|
|
118
117
|
|
|
119
118
|
## Features
|
|
120
119
|
|
|
121
|
-
- **๐งฉ Component-Based Architecture:** Create reusable UI components
|
|
122
|
-
- **โก Signal-Based Reactivity:** Fine-grained reactivity that updates only what's needed
|
|
123
|
-
- **๐ Event Handling:** Built-in event emitter for robust inter-component communication
|
|
124
|
-
- **๐ Template Parsing:** Secure and dynamic interpolation with a custom TemplateEngine
|
|
125
|
-
- **๐ DOM Diffing & Patching:** High-performance updates without a virtual DOM
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
120
|
+
- **๐งฉ Component-Based Architecture:** Create reusable UI components with a rich context API
|
|
121
|
+
- **โก Signal-Based Reactivity:** Fine-grained reactivity that updates only what's needed
|
|
122
|
+
- **๐ Event Handling:** Built-in event emitter for robust inter-component communication
|
|
123
|
+
- **๐ Template Parsing:** Secure and dynamic interpolation with a custom TemplateEngine
|
|
124
|
+
- **๐ DOM Diffing & Patching:** High-performance updates without a virtual DOM
|
|
125
|
+
- **๐ Lifecycle Hooks:** Complete lifecycle management with before/after mount and update hooks
|
|
126
|
+
- **๐งน Automatic Cleanup:** Proper cleanup of resources, watchers, and child components on unmount
|
|
127
|
+
- **๐ Plugin System:** Extensible architecture with a simple plugin API
|
|
128
|
+
- **๐ฆ UMD & ES Module Builds:** Supports modern build tools and browser environments
|
|
129
|
+
- **๐ค Friendly API:** A gentle learning curve for both beginners and seasoned developers
|
|
130
|
+
- **๐ Tiny Footprint & TypeScript Support:** Approximately ~6 KB minified with built-in TypeScript declarations
|
|
129
131
|
|
|
130
132
|
---
|
|
131
133
|
|
|
@@ -247,7 +249,12 @@ app.component("HelloWorld", {
|
|
|
247
249
|
// The setup method is optional; if omitted, an empty state is used.
|
|
248
250
|
setup({ signal }) {
|
|
249
251
|
const count = signal(0);
|
|
250
|
-
return {
|
|
252
|
+
return {
|
|
253
|
+
count,
|
|
254
|
+
onMount: ({ container, context }) => {
|
|
255
|
+
console.log('Component mounted!');
|
|
256
|
+
}
|
|
257
|
+
};
|
|
251
258
|
},
|
|
252
259
|
template: ({ count }) => `
|
|
253
260
|
<div>
|
|
@@ -255,11 +262,16 @@ app.component("HelloWorld", {
|
|
|
255
262
|
<p>Count: ${count.value}</p>
|
|
256
263
|
<button @click="() => count.value++">Increment</button>
|
|
257
264
|
</div>
|
|
258
|
-
|
|
265
|
+
`
|
|
259
266
|
});
|
|
260
267
|
|
|
261
|
-
// Mount the component
|
|
262
|
-
app.mount(document.getElementById("app"), "HelloWorld")
|
|
268
|
+
// Mount the component and handle the Promise
|
|
269
|
+
app.mount(document.getElementById("app"), "HelloWorld")
|
|
270
|
+
.then(instance => {
|
|
271
|
+
console.log("Component mounted:", instance);
|
|
272
|
+
// Later...
|
|
273
|
+
// instance.unmount();
|
|
274
|
+
});
|
|
263
275
|
```
|
|
264
276
|
|
|
265
277
|
Interactive Demo: [CodePen](https://codepen.io/tarekraafat/pen/GgRrxdY?editors=1010)
|