Skip to content

Releases: TarekRaafat/eleva

v1.2.0 - Agent Plugin & Agent Experience (AX) ✨

08 Feb 12:28

Choose a tag to compare

Eleva.js v1.2.0 - Agent Plugin & Agent Experience (AX) ✨

This release introduces the Agent plugin for AI/LLM integration, Store emitter events for cross-plugin observability, and a comprehensive Agent Experience (AX) layer — making Eleva the first lightweight framework with built-in AI agent support.


✨ New: Agent Plugin (~3.5KB gzipped)

A first-class integration surface for LLMs, AI agents, and automation scripts.

Feature Details
Action Registry Register, unregister, execute, and introspect named actions with optional typed schemas
Command Bus Dispatch structured commands ({ type, target?, payload? }) to multiple handlers
Audit Logging Automatic log entries for every action, command, and event — with configurable rotation and filtering
Permissions Per-scope allow-lists for actions and commands; permissive (default) and strict modes
State Inspection inspect(), snapshot(), and diff() for component registry introspection
Reactive Signals agent.actionCount and agent.lastActivity signals for template-driven monitoring
Auto-cleanup Actions and command handlers registered in setup() are automatically cleaned up on unmount

Quick Example

import Eleva from "eleva";
import { Agent } from "eleva/plugins/agent";

const app = new Eleva("MyApp");
app.use(Agent);

app.component("Dashboard", {
  setup({ agent }) {
    agent.register("getStats", async () => {
      return { users: 42, uptime: "99.9%" };
    });

    return { agent };
  },
  template: (ctx) => `
    <p>Actions: ${ctx.agent.actionCount.value}</p>
    <button @click="() => agent.execute('getStats')">Run</button>
  `
});

✨ New: Store Emitter Events

Event When
store:dispatch Before action execution
store:mutate After successful execution
store:error On action failure
store:register Module registered
store:unregister Module removed

All events fire via eleva.emitter, enabling the Agent plugin to capture Store activity natively with emitterEvents: ["store:"].


✨ New: AX Verification System

Component Purpose
bun run verify:ax One-command pipeline: build → test → manifest validation
Docs/Source Parity Test Verifies agent-manifest.json stays in sync with source and types
AX CI Workflow GitHub Actions triggered on PRs when AI-facing files change

✨ New: Golden AI Examples

Example Description
Counter Reactive signal, increment handler, @click binding (~15 lines)
Todo App Signal array, add/remove/toggle, list rendering with key (~40 lines)
Agent Actions Action registry, schema, execute, audit log display (~50 lines)

⚠️ Breaking Changes

Change Migration
CDN Plugin Globals app.use(ElevaAgentPlugin.Agent)app.use(ElevaAgent)
app.use(ElevaRouterPlugin.Router, {...})app.use(ElevaRouter, {...})
app.use(ElevaStorePlugin.Store, {...})app.use(ElevaStore, {...})
app.use(ElevaAttrPlugin.Attr)app.use(ElevaAttr)

Note: ESM, CJS, and CDN bundled (ElevaPlugins.Agent) imports are unchanged. Only individual plugin UMD globals changed.


📦 Build & Packaging

Change Details
Agent Plugin Exports eleva/plugins/agent subpath with ESM, CJS, UMD, and TypeScript declarations
UMD Simplification Individual plugins export direct defaults instead of namespace objects
Validation Scripts validate:publint and validate:types for pre-publish quality gates

📝 Documentation

  • Agent Plugin — Three new pages: Overview, Patterns (15 examples), and API Reference
  • Store Plugin — New "Emitter Events" section in API Reference
  • LLM Docs — Enhanced llms.txt and llms-full.txt with contract metadata, AI recipes, and golden examples
  • CONTRIBUTING.md — New "AI & Agent Experience (AX)" section for contributors

📦 Version Updates

Component Version Change
Eleva (core) 1.2.0 New release
Store Plugin 1.2.0 Added emitter events
Agent Plugin 1.0.0 New plugin
Router Plugin 1.1.1 Unchanged
Attr Plugin 1.1.1 Unchanged

📥 Installation

npm install eleva@1.2.0
<!-- CDN -->
<script src="https://cdn.jsdelivr.net/npm/eleva@1.2.0"></script>

<!-- Agent Plugin (individual) -->
<script src="https://cdn.jsdelivr.net/npm/eleva@1.2.0/dist/plugins/agent.umd.min.js"></script>

📚 Documentation


🙏 Thank You

Thank you to everyone using Eleva.js! This release marks a milestone — Eleva is now the first lightweight framework with built-in AI agent support. Your feedback drives these improvements. If you encounter any issues, please open an issue.

See the Full Changelog for complete details.

v1.1.1 - Patch Release 🔧

29 Jan 18:32

Choose a tag to compare

Eleva.js v1.1.1 - Patch Release 🔧

A patch release with a bug fix for multiple event bindings, Router navigation improvements, and minor bundle size optimizations.


🐛 Bug Fixes

Issue Resolution
Multiple @ Event Attributes Elements with multiple event bindings now bind all handlers correctly
Router _isNavigating Flag Flag now resets via try-finally even if history API throws
Router Guards Snapshot Added regression tests to enforce guards array copy behavior

Multiple @ Event Attributes

Previously, elements with multiple @ event attributes could have some handlers silently ignored:

<!-- Before (broken): Only @click and @mouseout would bind -->
<button @click="save" @mouseover="preview" @mouseout="reset">

<!-- After (fixed): All three handlers now bind correctly -->
<button @click="save" @mouseover="preview" @mouseout="reset">

Technical details:

  • Cause: Forward iteration over live attributes collection while calling removeAttribute()
  • The removal shifted indices, causing subsequent @ attributes to be skipped
  • Fix: Changed to backward iteration which is safe for live collection mutation

Router _isNavigating Flag Reset

Fixed an issue where the _isNavigating flag could remain true forever if an error occurred during history manipulation, blocking all future navigation attempts.

Fix: Added try-finally to ensure the flag always resets via microtask.


🧹 Cleanup

Change Benefit
Removed config parameter Unused constructor parameter removed (saves 19 bytes)
Renamed _functionCache Internal _functionCache_cache in TemplateEngine (saves 24 bytes)

Note: new Eleva("app", config) still works (extra args ignored) but app.config is no longer available.


📦 Bundle Size

Build v1.1.0 v1.1.1 Change
Minified 6,213 bytes 6,173 bytes -40 bytes
Gzipped 2,484 bytes 2,463 bytes -21 bytes

📦 Version Updates

Component Version
Eleva (core) 1.1.1
Router Plugin 1.1.1
Store Plugin 1.1.1
Attr Plugin 1.1.1

📥 Installation

npm install eleva@1.1.1
<!-- CDN -->
<script src="https://unpkg.com/eleva@1.1.1/dist/eleva.umd.min.js"></script>

📚 Documentation


See Changelog for complete details.

v1.1.0 - Enhanced Developer Experience 🚀

27 Jan 16:13

Choose a tag to compare

Eleva.js v1.1.0 - Enhanced Developer Experience 🚀

This release focuses on build modernization, bug fixes, and improved TypeScript support. It includes breaking changes to align with modern ESM package conventions and fixes critical memory leaks.


⚠️ Breaking Changes

Change Migration
Build Output Filenames dist/eleva.esm.jsdist/eleva.js, dist/eleva.cjs.jsdist/eleva.cjs
Node.js Version Now requires Node.js 18+ (Node 16 EOL April 2024)
Package Exports Bundlers now receive ESM by default. For UMD, use eleva/browser
Router Event router:onErrorrouter:error (consistency with other events)

Note: Standard imports (import Eleva from 'eleva') work exactly the same. Only direct file path imports need updating.


✨ Enhancements

Feature Details
Namespaced Actions Store createAction("auth.login", fn) now correctly creates nested structure
TypeScript Support Comprehensive JSDoc types for Store, Router, and Core (50+ new type definitions)
Tree-Shaking Improved dead code elimination with Rollup treeshake.annotations
Individual Plugin Builds eleva/plugins/attr, /router, /store now support ESM, CJS, and UMD

Store Plugin: Dot-Notation Actions

// Now works correctly ✅
store.createAction("auth.login", (state, credentials) => {
  // Creates nested: actions.auth.login
});

store.dispatch("auth.login", { user: "admin", pass: "***" });

🐛 Bug Fixes

Issue Resolution
Memory Leak Child components now properly unmount when parent re-renders remove their host elements
Lifecycle Order Old children fully unmount before new children mount (synchronous cleanup)
Store Context Fixed _mountComponents override missing context parameter
Router Cleanup Removed unused to argument from internal _render call

Memory Leak Fix Details

Previously, child components orphaned by DOM patching would leak:

  • Signal watchers persisted
  • Event listeners remained active
  • onUnmount hooks never called

Now cleanup is synchronous — old components fully clean up before new ones mount, eliminating race conditions with shared resources (WebSockets, focus, scroll position).


📦 Build & Packaging

Change Benefit
ESM-first .js for ESM, .cjs for CommonJS
Nested Types Types inside import/require conditions for better TypeScript resolution
Individual Plugin Types Separate .d.ts (ESM) and .d.cts (CJS) for each plugin
Tree-Shakable Plugins Individual plugins now properly tree-shake in ESM bundlers

Package Subpaths

// Standard (auto-detects ESM/CJS)
import Eleva from 'eleva';
const Eleva = require('eleva');

// Individual plugins (tree-shakable)
import { Router } from 'eleva/plugins/router';
import { Store } from 'eleva/plugins/store';
import { Attr } from 'eleva/plugins/attr';

📝 Documentation

  • JSDoc Accuracy - Fixed type definitions across core and plugins
  • Router Docs - Added autoStart option documentation
  • Attr Docs - Fixed event handler syntax (@click="() => ...")
  • Lifecycle Docs - Clarified onBeforeUpdate and onBeforeMount behavior
  • Security Note - Clarified TemplateEngine evaluates trusted templates only

📦 Version Updates

Component Version
Eleva (core) 1.1.0
Router Plugin 1.1.0
Store Plugin 1.1.0
Attr Plugin 1.1.0

📥 Installation

npm install eleva@1.1.0
<!-- CDN -->
<script src="https://cdn.jsdelivr.net/npm/eleva@1.1.0"></script>

📚 Documentation


🙏 Thank You

Thank you to everyone using Eleva.js! Your feedback drives these improvements. If you encounter any issues, please open an issue.

See the Full Changelog for complete details.

v1.0.1 - Router Fix & Documentation Polish 🔧

17 Jan 19:25

Choose a tag to compare

Eleva.js v1.0.1 - Router Fix & Documentation Polish 🔧

The first patch release for Eleva.js, addressing a Router plugin inconsistency and significantly expanding documentation coverage for lifecycle management and plugin cleanup.


🐛 Bug Fix

Issue Resolution
Router viewSelector Default Fixed default value from 'root' to 'view' to match documented behavior

⚠️ Migration Note: If your layouts use #root for the view container, either rename to #view or explicitly set viewSelector: 'root' in router options.


📝 Documentation Improvements

Lifecycle & Cleanup

  • onUnmount Hook — Clarified that it receives { container, context, cleanup } where cleanup contains { watchers, listeners, children } arrays
  • Component Unmounting — Added comprehensive MountResult object documentation (container, data, unmount) with cleanup process details
  • Plugin Uninstall Methods — Documented uninstall() for all built-in plugins (Router, Store, Attr)

Plugin Architecture

  • Cleanup Separation — Explained component cleanup (onUnmount) vs plugin cleanup (plugin.uninstall(app))
  • LIFO Uninstall Order — Added warnings about plugin uninstall order consequences (key collision, orphaned wrappers, memory leaks)
  • Best Practices — Added guidance for namespaced storage keys in custom plugins

📦 Version Updates

Component Version
Eleva (core) 1.0.1
Router Plugin 1.0.1
Attr Plugin 1.0.0 (unchanged)
Store Plugin 1.0.0 (unchanged)

📥 Installation

npm

npm install eleva

CDN

<!-- Core -->
<script src="https://cdn.jsdelivr.net/npm/eleva@1.0.1/dist/eleva.umd.js"></script>

<!-- With Plugins -->
<script src="https://cdn.jsdelivr.net/npm/eleva@1.0.1/dist/eleva-plugins.umd.min.js"></script>

📚 Documentation

Full documentation available at elevajs.com


📋 Full Changelog

See CHANGELOG for complete details.

v1.0.0 - First Stable Release 🎉

13 Jan 16:16

Choose a tag to compare

Eleva.js v1.0.0 - First Stable Release 🎉

After 14 release candidates and extensive testing, Eleva.js is ready for production use!

✨ Highlights

Feature Details
Bundle Size ~2.3KB gzipped (core)
Dependencies Zero runtime dependencies
Plugins 3 official plugins (Attr, Router, Store)
Browser Support All modern browsers
TypeScript Full type definitions included

🚀 Core Features

  • Signal-Based Reactivity - Fine-grained reactivity with .value access and .watch() subscriptions
  • Template Literals - No build step required, native JavaScript template strings
  • Direct DOM Updates - No virtual DOM, surgical DOM patching for maximum performance
  • Render Batching - Automatic batching via queueMicrotask for optimal updates
  • Component System - Nested components with props, events, and lifecycle hooks
  • Scoped Styles - Component-level CSS isolation

🧠 Simple Mental Model

Only 3 syntaxes to learn:

// 1. Template expressions - use ctx. prefix
template: (ctx) => `<p>Count: ${ctx.count.value}</p>`

// 2. Event handlers - no prefix needed
template: (ctx) => `<button @click="increment">+</button>`

// 3. Props - no prefix needed
template: (ctx) => `<Child :user="user.value" />`

📦 What Changed from RC Phase

Change Description
Native Props Props plugin removed - props now evaluated natively in core
Simplified Syntax Consistent rules: ${} needs ctx., directives don't
Memory Optimized 71-83% reduction in memory overhead
Performance 240+ FPS rendering capability

🔌 Official Plugins

Plugin Size Purpose
Attr ~2.2KB ARIA, data attributes, boolean attributes
Router ~3.5KB SPA routing with history/hash modes
Store ~1.8KB Global state management with actions

⚡ Performance

  • Chrome Memory (1K rows): ~0.5KB/row overhead
  • Chrome Memory (10K rows): ~1.37KB/row overhead
  • Update Operations: Zero memory growth
  • Clear Operations: Memory properly released

📥 Installation

npm install eleva
<script src="https://cdn.jsdelivr.net/npm/eleva"></script>

📚 Documentation

Full documentation available at elevajs.com

🙏 Thank You

Thank you to everyone who tested the release candidates and provided feedback!


Full Changelog: https://github.com/TarekRaafat/eleva/blob/master/CHANGELOG.md