eleva 1.0.1 → 1.1.0

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 (97) hide show
  1. package/README.md +21 -10
  2. package/dist/{eleva-plugins.cjs.js → eleva-plugins.cjs} +1002 -292
  3. package/dist/eleva-plugins.cjs.map +1 -0
  4. package/dist/eleva-plugins.d.cts +1352 -0
  5. package/dist/eleva-plugins.d.cts.map +1 -0
  6. package/dist/eleva-plugins.d.ts +1352 -0
  7. package/dist/eleva-plugins.d.ts.map +1 -0
  8. package/dist/{eleva-plugins.esm.js → eleva-plugins.js} +1002 -292
  9. package/dist/eleva-plugins.js.map +1 -0
  10. package/dist/eleva-plugins.umd.js +1001 -291
  11. package/dist/eleva-plugins.umd.js.map +1 -1
  12. package/dist/eleva-plugins.umd.min.js +1 -1
  13. package/dist/eleva-plugins.umd.min.js.map +1 -1
  14. package/dist/{eleva.cjs.js → eleva.cjs} +421 -191
  15. package/dist/eleva.cjs.map +1 -0
  16. package/dist/eleva.d.cts +1329 -0
  17. package/dist/eleva.d.cts.map +1 -0
  18. package/dist/eleva.d.ts +473 -226
  19. package/dist/eleva.d.ts.map +1 -0
  20. package/dist/{eleva.esm.js → eleva.js} +422 -192
  21. package/dist/eleva.js.map +1 -0
  22. package/dist/eleva.umd.js +420 -190
  23. package/dist/eleva.umd.js.map +1 -1
  24. package/dist/eleva.umd.min.js +1 -1
  25. package/dist/eleva.umd.min.js.map +1 -1
  26. package/dist/plugins/attr.cjs +279 -0
  27. package/dist/plugins/attr.cjs.map +1 -0
  28. package/dist/plugins/attr.d.cts +101 -0
  29. package/dist/plugins/attr.d.cts.map +1 -0
  30. package/dist/plugins/attr.d.ts +101 -0
  31. package/dist/plugins/attr.d.ts.map +1 -0
  32. package/dist/plugins/attr.js +276 -0
  33. package/dist/plugins/attr.js.map +1 -0
  34. package/dist/plugins/attr.umd.js +111 -22
  35. package/dist/plugins/attr.umd.js.map +1 -1
  36. package/dist/plugins/attr.umd.min.js +1 -1
  37. package/dist/plugins/attr.umd.min.js.map +1 -1
  38. package/dist/plugins/router.cjs +1873 -0
  39. package/dist/plugins/router.cjs.map +1 -0
  40. package/dist/plugins/router.d.cts +1296 -0
  41. package/dist/plugins/router.d.cts.map +1 -0
  42. package/dist/plugins/router.d.ts +1296 -0
  43. package/dist/plugins/router.d.ts.map +1 -0
  44. package/dist/plugins/router.js +1870 -0
  45. package/dist/plugins/router.js.map +1 -0
  46. package/dist/plugins/router.umd.js +482 -186
  47. package/dist/plugins/router.umd.js.map +1 -1
  48. package/dist/plugins/router.umd.min.js +1 -1
  49. package/dist/plugins/router.umd.min.js.map +1 -1
  50. package/dist/plugins/store.cjs +920 -0
  51. package/dist/plugins/store.cjs.map +1 -0
  52. package/dist/plugins/store.d.cts +266 -0
  53. package/dist/plugins/store.d.cts.map +1 -0
  54. package/dist/plugins/store.d.ts +266 -0
  55. package/dist/plugins/store.d.ts.map +1 -0
  56. package/dist/plugins/store.js +917 -0
  57. package/dist/plugins/store.js.map +1 -0
  58. package/dist/plugins/store.umd.js +410 -85
  59. package/dist/plugins/store.umd.js.map +1 -1
  60. package/dist/plugins/store.umd.min.js +1 -1
  61. package/dist/plugins/store.umd.min.js.map +1 -1
  62. package/package.json +112 -68
  63. package/src/core/Eleva.js +195 -115
  64. package/src/index.cjs +10 -0
  65. package/src/index.js +11 -0
  66. package/src/modules/Emitter.js +68 -20
  67. package/src/modules/Renderer.js +82 -20
  68. package/src/modules/Signal.js +43 -15
  69. package/src/modules/TemplateEngine.js +50 -9
  70. package/src/plugins/Attr.js +121 -19
  71. package/src/plugins/Router.js +526 -181
  72. package/src/plugins/Store.js +448 -69
  73. package/src/plugins/index.js +1 -0
  74. package/types/core/Eleva.d.ts +263 -169
  75. package/types/core/Eleva.d.ts.map +1 -1
  76. package/types/index.d.cts +3 -0
  77. package/types/index.d.cts.map +1 -0
  78. package/types/index.d.ts +5 -0
  79. package/types/index.d.ts.map +1 -1
  80. package/types/modules/Emitter.d.ts +73 -30
  81. package/types/modules/Emitter.d.ts.map +1 -1
  82. package/types/modules/Renderer.d.ts +48 -18
  83. package/types/modules/Renderer.d.ts.map +1 -1
  84. package/types/modules/Signal.d.ts +44 -16
  85. package/types/modules/Signal.d.ts.map +1 -1
  86. package/types/modules/TemplateEngine.d.ts +46 -11
  87. package/types/modules/TemplateEngine.d.ts.map +1 -1
  88. package/types/plugins/Attr.d.ts +83 -16
  89. package/types/plugins/Attr.d.ts.map +1 -1
  90. package/types/plugins/Router.d.ts +498 -207
  91. package/types/plugins/Router.d.ts.map +1 -1
  92. package/types/plugins/Store.d.ts +211 -37
  93. package/types/plugins/Store.d.ts.map +1 -1
  94. package/dist/eleva-plugins.cjs.js.map +0 -1
  95. package/dist/eleva-plugins.esm.js.map +0 -1
  96. package/dist/eleva.cjs.js.map +0 -1
  97. package/dist/eleva.esm.js.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # Eleva.js 🚀
2
2
 
3
- > **Version:** `1.0.1` | **Size:** ~6KB min (~2.3KB gzip) | **Dependencies:** Zero | **TypeScript:** Yes
3
+ > **Version:** `1.1.0` | **Size:** ~6KB min (~2.5KB gzip) | **Dependencies:** Zero | **TypeScript:** Yes
4
+ >
5
+ > *Also known as: elevajs, eleva*
4
6
 
5
7
  **Best DX for Building the Best UX** — Pure JavaScript, Pure Performance, Simply Elegant.
6
8
 
@@ -31,7 +33,7 @@
31
33
  **A minimalist, lightweight, pure vanilla JavaScript frontend runtime framework.**
32
34
  _Designed for the best Developer Experience (DX) to help you build exceptional User Experiences (UX). Built with love for native JavaScript and a minimal core that can be extended through a powerful plugin system — because sometimes, less really is more!_ 😊
33
35
 
34
- > **Stable Release**: This is `v1.0.1` - The latest stable release of Eleva.js!
36
+ > **Stable Release**: This is `v1.1.0` - The latest stable release of Eleva.js!
35
37
 
36
38
 
37
39
 
@@ -187,7 +189,7 @@ Eleva is built on a simple principle: **great DX leads to great UX**. When devel
187
189
  | **Pure JavaScript** | No JSX, no compilation — what you write is what runs |
188
190
  | **Instant Feedback** | Signal-based reactivity shows changes immediately |
189
191
  | **TypeScript Built-in** | Full autocomplete and type safety out of the box |
190
- | **Tiny Bundle** | ~2.3KB gzipped means instant page loads for your users |
192
+ | **Tiny Bundle** | ~2.5KB gzipped means instant page loads for your users |
191
193
 
192
194
  - **🎨 Craftsmanship:** Every line of code is written with care, keeping the framework lightweight, efficient, and easy to understand.
193
195
  - **🛠️ Developer-First:** Intuitive API and minimal core mean you spend less time wrestling with the framework and more time perfecting your UI.
@@ -203,7 +205,7 @@ Eleva is built on a simple principle: **great DX leads to great UX**. When devel
203
205
  - **🧩 Component-Based Architecture:** Create reusable UI components with a rich context API
204
206
  - **⚡ Signal-Based Reactivity:** Fine-grained reactivity that updates only what's needed
205
207
  - **🔔 Event Handling:** Built-in event emitter for robust inter-component communication
206
- - **📝 Template Parsing:** Secure and dynamic interpolation with a custom TemplateEngine
208
+ - **📝 Template Parsing:** Dynamic interpolation with a custom TemplateEngine (trusted templates only)
207
209
  - **🔄 DOM Diffing & Patching:** High-performance updates without a virtual DOM
208
210
  - **🔄 Lifecycle Hooks:** Complete lifecycle management with before/after mount and update hooks
209
211
  - **🧹 Automatic Cleanup:** Proper cleanup of resources, watchers, and child components on unmount
@@ -256,7 +258,7 @@ I follow [Semantic Versioning (SemVer)](https://semver.org/):
256
258
 
257
259
  Eleva is crafted for performance:
258
260
 
259
- - **Lightweight:** Approximately ~6 KB minified and ~2.3 KB gzipped.
261
+ - **Lightweight:** Approximately ~6 KB minified and ~2.5 KB gzipped.
260
262
  - **Efficient Reactivity:** Signal-based updates ensure only necessary DOM parts are updated.
261
263
  - **Optimized Diffing:** Renderer efficiently patches changes without the overhead of a virtual DOM.
262
264
  - **No Bloat:** Pure vanilla JavaScript with zero dependencies keeps your project nimble.
@@ -271,13 +273,13 @@ Benchmarks using [js-framework-benchmark](https://krausest.github.io/js-framewor
271
273
 
272
274
  | **Framework** | **Bundle Size (min+gzip)** | **Create 1K Rows** (ms) | **Partial Update** (ms) | **Memory** (MB)* |
273
275
  | ----------------------------- | -------------------------- | ----------------------- | ----------------------- | ---------------- |
274
- | **Eleva** (Direct DOM) | **~2.3 KB** | **~25** | ~86 | **~0.5** (Chrome) |
276
+ | **Eleva** (Direct DOM) | **~2.5 KB** | **~25** | ~86 | **~0.5** (Chrome) |
275
277
  | **React 19** (Virtual DOM) | ~44 KB | 40-70 | 10-20 | 2-5 |
276
278
  | **Vue 3.5** (Reactive) | ~35 KB | 25-45 | 5-15 | 2-4 |
277
279
  | **Angular 19** (Signals) | ~90 KB | 50-80 | 15-25 | 3-6 |
278
280
 
279
281
  **Eleva's Strengths:**
280
- - **Smallest bundle size** (~2.3 KB vs 35-90 KB)
282
+ - **Smallest bundle size** (~2.5 KB vs 35-90 KB)
281
283
  - **Competitive initial render** (~25ms for 1K rows)
282
284
  - **Zero dependencies** and minimal runtime overhead
283
285
  - **Direct DOM diffing** without virtual DOM overhead
@@ -296,7 +298,7 @@ Benchmarks using [js-framework-benchmark](https://krausest.github.io/js-framewor
296
298
 
297
299
  How does Eleva compare to popular JavaScript frameworks like React, Vue, Svelte, and Angular?
298
300
 
299
- | Feature | Eleva 1.0 | React 19 | Vue 3.5 | Svelte 5 | Angular 19 |
301
+ | Feature | Eleva 1 | React 19 | Vue 3.5 | Svelte 5 | Angular 19 |
300
302
  |---------|-----------|----------|---------|----------|------------|
301
303
  | **Bundle Size** | ~6KB | ~44KB | ~45KB | ~3KB* | ~90KB |
302
304
  | **Dependencies** | 0 | 3+ | 0 | 0 | 10+ |
@@ -447,10 +449,18 @@ Interactive Demo: [CodePen](https://codepen.io/tarekraafat/pen/jEOyzYN?editors=1
447
449
 
448
450
  ## API Reference
449
451
 
452
+ ### Named Exports
453
+
454
+ Eleva exposes the core utilities as named exports for direct use and typing:
455
+
456
+ ```javascript
457
+ import Eleva, { Signal, Emitter, Renderer, TemplateEngine } from "eleva";
458
+ ```
459
+
450
460
  ### TemplateEngine
451
461
 
452
462
  - **`TemplateEngine.evaluate(expr, data)`**
453
- Safely evaluates JavaScript expressions within a given context. Used internally for `@events` and `:props` attribute processing.
463
+ Evaluates JavaScript expressions within a given context (not sandboxed). Used internally for `@events` and `:props` attribute processing.
454
464
 
455
465
  ### Signal
456
466
 
@@ -468,7 +478,7 @@ Interactive Demo: [CodePen](https://codepen.io/tarekraafat/pen/jEOyzYN?editors=1
468
478
  - **`.on(event, handler)`**
469
479
  Listen to events.
470
480
  - **`.off(event, handler)`**
471
- Remove event listeners.
481
+ Remove event listeners (omit `handler` to remove all listeners for the event).
472
482
  - **`.emit(event, ...args)`**
473
483
  Trigger events with additional arguments.
474
484
 
@@ -502,6 +512,7 @@ Eleva's plugin system allows you to extend functionality as needed. Plugins are
502
512
  | **External Plugins** | Community/Ecosystem | `npm install eleva-plugin-x` |
503
513
 
504
514
  > **Core plugins** (Attr, Router, Store) are official, tested, and documented. **External plugins** are community-created and installed separately. See [Plugin Documentation](https://elevajs.com/plugins/) for details.
515
+ > **TypeScript:** Use `import type { ... } from "eleva"` for core types and `import { Attr, Router, Store } from "eleva/plugins"` for plugin types — no deep imports needed.
505
516
 
506
517
  #### Core Framework Only (Lightweight)
507
518