eleva 1.0.0-rc.13 โ†’ 1.0.0-rc.14

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 (44) hide show
  1. package/README.md +20 -75
  2. package/dist/eleva-plugins.cjs.js +4 -653
  3. package/dist/eleva-plugins.cjs.js.map +1 -1
  4. package/dist/eleva-plugins.esm.js +5 -653
  5. package/dist/eleva-plugins.esm.js.map +1 -1
  6. package/dist/eleva-plugins.umd.js +4 -653
  7. package/dist/eleva-plugins.umd.js.map +1 -1
  8. package/dist/eleva-plugins.umd.min.js +1 -1
  9. package/dist/eleva-plugins.umd.min.js.map +1 -1
  10. package/dist/eleva.cjs.js +52 -110
  11. package/dist/eleva.cjs.js.map +1 -1
  12. package/dist/eleva.d.ts +47 -109
  13. package/dist/eleva.esm.js +52 -110
  14. package/dist/eleva.esm.js.map +1 -1
  15. package/dist/eleva.umd.js +52 -110
  16. package/dist/eleva.umd.js.map +1 -1
  17. package/dist/eleva.umd.min.js +1 -1
  18. package/dist/eleva.umd.min.js.map +1 -1
  19. package/dist/plugins/attr.umd.js +2 -2
  20. package/dist/plugins/attr.umd.js.map +1 -1
  21. package/dist/plugins/attr.umd.min.js +1 -1
  22. package/dist/plugins/attr.umd.min.js.map +1 -1
  23. package/dist/plugins/router.umd.js +1 -1
  24. package/dist/plugins/router.umd.js.map +1 -1
  25. package/dist/plugins/router.umd.min.js.map +1 -1
  26. package/package.json +1 -1
  27. package/src/core/Eleva.js +21 -15
  28. package/src/modules/TemplateEngine.js +36 -104
  29. package/src/plugins/Attr.js +2 -2
  30. package/src/plugins/Router.js +1 -1
  31. package/src/plugins/index.js +1 -1
  32. package/types/core/Eleva.d.ts +9 -5
  33. package/types/core/Eleva.d.ts.map +1 -1
  34. package/types/modules/TemplateEngine.d.ts +38 -104
  35. package/types/modules/TemplateEngine.d.ts.map +1 -1
  36. package/types/plugins/Router.d.ts +1 -1
  37. package/types/plugins/index.d.ts +0 -1
  38. package/dist/plugins/props.umd.js +0 -660
  39. package/dist/plugins/props.umd.js.map +0 -1
  40. package/dist/plugins/props.umd.min.js +0 -2
  41. package/dist/plugins/props.umd.min.js.map +0 -1
  42. package/src/plugins/Props.js +0 -602
  43. package/types/plugins/Props.d.ts +0 -49
  44. package/types/plugins/Props.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Eleva.js ๐Ÿš€
2
2
 
3
- > **Version:** `1.0.0-rc.12` | **Size:** ~6KB min (~2.3KB gzip) | **Dependencies:** Zero | **TypeScript:** Yes
3
+ > **Version:** `1.0.0-rc.14` | **Size:** ~6KB min (~2.3KB gzip) | **Dependencies:** Zero | **TypeScript:** Yes
4
4
 
5
5
  **Best DX for Building the Best UX** โ€” Pure JavaScript, Pure Performance, Simply Elegant.
6
6
 
@@ -42,9 +42,9 @@
42
42
  **A minimalist, lightweight, pure vanilla JavaScript frontend runtime framework.**
43
43
  _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!_ ๐Ÿ˜Š
44
44
 
45
- > **Stability Notice**: This is `v1.0.0-rc.12` - The core functionality is stable. Seeking community feedback before the final v1.0.0 release.
45
+ > **Stability Notice**: This is `v1.0.0-rc.14` - The core functionality is stable. Seeking community feedback before the final v1.0.0 release.
46
46
 
47
- **Version:** `1.0.0-rc.12`
47
+ **Version:** `1.0.0-rc.14`
48
48
 
49
49
 
50
50
 
@@ -98,7 +98,6 @@ Eleva is ideal for developers building lightweight web applications, prototypes,
98
98
  - [Core Framework Only (Lightweight)](#core-framework-only-lightweight)
99
99
  - [Attr Plugin](#attr-plugin)
100
100
  - [Router Plugin](#router-plugin)
101
- - [Props Plugin](#props-plugin)
102
101
  - [Store Plugin](#store-plugin)
103
102
  - [Development](#development)
104
103
  - [Testing](#testing)
@@ -138,14 +137,15 @@ app.mount(document.getElementById("app"), "Counter");
138
137
 
139
138
  ### Template Syntax
140
139
 
141
- > **Quick Rule:** `${}` needs `ctx.` โ€” `{{ }}` and `@events` don't.
140
+ > **Quick Rule:** `${}` needs `ctx.` โ€” `@events` and `:props` don't.
142
141
 
143
142
  | Syntax | Use | `ctx.`? |
144
143
  |--------|-----|:-------:|
145
- | `${expr}` | Static value | โœ“ |
146
- | `{{ expr }}` | Reactive value | โœ— |
144
+ | `${expr}` | JS value interpolation | โœ“ |
147
145
  | `@click` | Event handler | โœ— |
148
- | `:prop` | Pass to child | โœ“ |
146
+ | `:prop` | Pass to child | โœ— |
147
+
148
+ > **How it works:** Use `${ctx.value}` to interpolate values into your template. For `@events` and `:props`, expressions are evaluated against the component context directly โ€” no `ctx.` prefix needed. This allows cleaner syntax like `:user="userData"` instead of `:user="${ctx.userData}"`.
149
149
 
150
150
  ---
151
151
 
@@ -214,7 +214,7 @@ Eleva is built on a simple principle: **great DX leads to great UX**. When devel
214
214
  - **๐Ÿ”„ Lifecycle Hooks:** Complete lifecycle management with before/after mount and update hooks
215
215
  - **๐Ÿงน Automatic Cleanup:** Proper cleanup of resources, watchers, and child components on unmount
216
216
  - **๐Ÿ”Œ Plugin System:** Extensible architecture with a simple plugin API
217
- - **๐ŸŽฏ Built-in Plugins:** Attr for advanced attributes, Props for complex data handling, Router for client-side routing, and Store for reactive state management
217
+ - **๐ŸŽฏ Built-in Plugins:** Attr for advanced attributes, Router for client-side routing, and Store for reactive state management
218
218
  - **๐Ÿ“ฆ UMD & ES Module Builds:** Supports modern build tools and browser environments
219
219
  - **๐Ÿค Friendly API:** A gentle learning curve for both beginners and seasoned developers
220
220
  - **๐Ÿ’Ž Tiny Footprint & TypeScript Support:** Approximately ~6 KB minified with built-in TypeScript declarations
@@ -242,7 +242,7 @@ Eleva is ideal for developers seeking a lightweight, flexible, and high-performa
242
242
 
243
243
  I believe in clear versioning that reflects the maturity of the project:
244
244
 
245
- - **Pre-release Versions (RC):** Release candidate versions like `1.0.0-rc.12` indicate the API is stable but still gathering community feedback before the final release.
245
+ - **Pre-release Versions (RC):** Release candidate versions like `1.0.0-rc.14` indicate the API is stable but still gathering community feedback before the final release.
246
246
  - **Semantic Versioning:** Once stable, I'll follow semantic versioning strictly to clearly communicate any breaking changes.
247
247
 
248
248
  ---
@@ -277,16 +277,16 @@ Benchmarks using [js-framework-benchmark](https://krausest.github.io/js-framewor
277
277
 
278
278
  | **Framework** | **Bundle Size (min+gzip)** | **Create 1K Rows** (ms) | **Partial Update** (ms) | **Memory** (MB) |
279
279
  | ----------------------------- | -------------------------- | ----------------------- | ----------------------- | --------------- |
280
- | **Eleva 1.0** (Direct DOM) | **~2.3 KB** | **~30** | ~105* | ~15 |
280
+ | **Eleva** (Direct DOM) | **~2.3 KB** | **~23** | ~82* | ~15 |
281
281
  | **React 19** (Virtual DOM) | ~44 KB | 40-70 | 10-20 | 2-5 |
282
- | **Vue 3.5** (Reactive) | ~45 KB | 25-45 | 5-15 | 2-4 |
282
+ | **Vue 3.5** (Reactive) | ~35 KB | 25-45 | 5-15 | 2-4 |
283
283
  | **Angular 19** (Signals) | ~90 KB | 50-80 | 15-25 | 3-6 |
284
284
 
285
285
  _*Eleva uses DOM diffing & patching, but templates generate HTML strings that require parsing. For large frequently-updating lists, use granular components or the `key` attribute for optimal diffing._
286
286
 
287
287
  **Eleva's Strengths:**
288
- - **Smallest bundle size** (~2.3 KB vs 44-90 KB)
289
- - **Competitive initial render** (~30ms for 1K rows)
288
+ - **Smallest bundle size** (~2.3 KB vs 35-90 KB)
289
+ - **Competitive initial render** (~23ms for 1K rows)
290
290
  - **Zero dependencies** and minimal runtime overhead
291
291
  - **Direct DOM diffing** without virtual DOM overhead
292
292
 
@@ -315,7 +315,7 @@ How does Eleva compare to popular JavaScript frameworks like React, Vue, Svelte,
315
315
  | **Build Required** | No | Yes | Optional | Yes | Yes |
316
316
  | **Learning Curve** | Low | Medium | Medium | Low | High |
317
317
 
318
- _*Svelte 5 compiles away with a ~3KB signals runtime, so bundle is minimal but build step is required._
318
+ _*Svelte compiles away, so runtime is minimal but build step is required._
319
319
 
320
320
  Eleva offers a refreshing alternative to frameworks like React, Vue, and Angular:
321
321
 
@@ -458,10 +458,8 @@ Interactive Demo: [CodePen](https://codepen.io/tarekraafat/pen/jEOyzYN?editors=1
458
458
 
459
459
  ### TemplateEngine
460
460
 
461
- - **`TemplateEngine.parse(template, data)`**
462
- Replaces `{{ expression }}` patterns in the template with evaluated values.
463
461
  - **`TemplateEngine.evaluate(expr, data)`**
464
- Safely evaluates JavaScript expressions within a given context.
462
+ Safely evaluates JavaScript expressions within a given context. Used internally for `@events` and `:props` attribute processing.
465
463
 
466
464
  ### Signal
467
465
 
@@ -512,7 +510,7 @@ Eleva's plugin system allows you to extend functionality as needed. Plugins are
512
510
  | **Core Plugins** | Bundled with Eleva | `import { X } from "eleva/plugins"` |
513
511
  | **External Plugins** | Community/Ecosystem | `npm install eleva-plugin-x` |
514
512
 
515
- > **Core plugins** (Attr, Props, Router, Store) are official, tested, and documented. **External plugins** are community-created and installed separately. See [Plugin Documentation](docs/plugins/index.md) for details.
513
+ > **Core plugins** (Attr, Router, Store) are official, tested, and documented. **External plugins** are community-created and installed separately. See [Plugin Documentation](docs/plugins/index.md) for details.
516
514
 
517
515
  #### Core Framework Only (Lightweight)
518
516
 
@@ -617,54 +615,6 @@ router.navigate('/users/123', { replace: true });
617
615
 
618
616
  ๐Ÿ“š **[Full Router Documentation โ†’](docs/plugins/router.md)** - Comprehensive guide with 13 events, 7 reactive signals, navigation guards, scroll management, and more.
619
617
 
620
- #### Props Plugin
621
-
622
- ๐ŸŽฏ **Advanced props handling** with automatic type detection, parsing, and reactivity for complex data structures:
623
-
624
- ```javascript
625
- import Eleva from 'eleva';
626
- import { Props } from 'eleva/plugins';
627
-
628
- const app = new Eleva("myApp");
629
- app.use(Props, {
630
- enableAutoParsing: true, // Enable automatic type detection
631
- enableReactivity: true, // Enable reactive prop updates
632
- onError: (error, value) => {
633
- console.error('Props parsing error:', error, value);
634
- }
635
- });
636
-
637
- // Use complex props in components
638
- app.component("UserCard", {
639
- template: (ctx) => `
640
- <div class="user-container"
641
- :user='${JSON.stringify(ctx.user.value)}'
642
- :permissions='${JSON.stringify(ctx.permissions.value)}'>
643
- </div>
644
- `,
645
- children: {
646
- '.user-container': 'UserInfo'
647
- }
648
- });
649
-
650
- app.component("UserInfo", {
651
- setup({ props }) {
652
- return {
653
- user: props.user, // Automatically parsed object
654
- permissions: props.permissions // Automatically parsed array
655
- };
656
- },
657
- template: (ctx) => `
658
- <div class="user-info">
659
- <h3>${ctx.user.value.name}</h3>
660
- <p>Role: ${ctx.user.value.role}</p>
661
- </div>
662
- `
663
- });
664
- ```
665
-
666
- ๐Ÿ“š **[Full Props Documentation โ†’](docs/plugins/props.md)** - Comprehensive guide with type parsing, reactive props, signal linking, complex data structures, and error handling.
667
-
668
618
  #### Store Plugin
669
619
 
670
620
  ๐Ÿช **Reactive state management** with centralized data store, persistence, namespacing, and cross-component reactive updates:
@@ -793,37 +743,32 @@ app.dispatch("increment"); // Dispatch actions globally
793
743
  **Bundle Sizes:**
794
744
  - Core framework only: ~6KB (minified)
795
745
  - Core + Attr: ~8KB (minified)
796
- - Core + Props: ~10KB (minified)
797
746
  - Core + Router: ~21KB (minified)
798
747
  - Core + Store: ~12KB (minified)
799
- - Core + All plugins: ~25KB (minified)
748
+ - Core + All plugins: ~21KB (minified)
800
749
 
801
750
  **Individual Plugin Sizes:**
802
751
  - Attr: ~2.2KB (minified)
803
- - Props: ~4.2KB (minified)
804
752
  - Router: ~15KB (minified)
805
753
  - Store: ~6KB (minified)
806
754
 
807
755
  **Available Plugin Formats:**
808
756
 
809
757
  **For Bundlers (Tree-Shaking Supported):**
810
- - ESM: `import { Attr, Props, Router, Store } from 'eleva/plugins'`
811
- - CJS: `const { Attr, Props, Router, Store } = require('eleva/plugins')`
758
+ - ESM: `import { Attr, Router, Store } from 'eleva/plugins'`
759
+ - CJS: `const { Attr, Router, Store } = require('eleva/plugins')`
812
760
 
813
761
  **For CDN (Individual Plugins - Smaller Bundle Size):**
814
762
  - UMD: `<script src="https://cdn.jsdelivr.net/npm/eleva@latest/dist/eleva.umd.min.js"></script>`
815
763
  - UMD: `<script src="https://cdn.jsdelivr.net/npm/eleva@latest/dist/plugins/attr.umd.min.js"></script>`
816
- - UMD: `<script src="https://cdn.jsdelivr.net/npm/eleva@latest/dist/plugins/props.umd.min.js"></script>`
817
764
  - UMD: `<script src="https://cdn.jsdelivr.net/npm/eleva@latest/dist/plugins/router.umd.min.js"></script>`
818
765
  - UMD: `<script src="https://cdn.jsdelivr.net/npm/eleva@latest/dist/plugins/store.umd.min.js"></script>`
819
766
 
820
767
  **Individual Plugin Imports (Best for Tree-Shaking):**
821
768
  - ESM: `import { Attr } from 'eleva/plugins/attr'`
822
- - ESM: `import { Props } from 'eleva/plugins/props'`
823
769
  - ESM: `import { Router } from 'eleva/plugins/router'`
824
770
  - ESM: `import { Store } from 'eleva/plugins/store'`
825
771
  - CJS: `const { Attr } = require('eleva/plugins/attr')`
826
- - CJS: `const { Props } = require('eleva/plugins/props')`
827
772
  - CJS: `const { Router } = require('eleva/plugins/router')`
828
773
  - CJS: `const { Store } = require('eleva/plugins/store')`
829
774