Repository navigation
v2.2.0 - The Performance & Event Upgrade 🚀
This major update brings a massive overhaul to the event system, introducing full event delegation, custom data passing, and new mobile touch gestures. Under the hood, the core iteration engine has been completely rewritten to maximize performance and reduce CPU overhead.
🚀 New Features
- Advanced Event System:
.on()and.off()now fully support Event Delegation (e.g.,$('ul').on('click', 'li', handler)) and passing custom event data to the handler. - One-Time Events: Added the
.once()method to execute a handler at most once per element and event type. - Programmatic Triggers: Added
.trigger(eventName, data)to manually dispatch native or custom events. - Touch Gestures: Built-in mobile support with
.swipeLeft(),.swipeRight(),.swipeUp(), and.swipeDown()helpers. - Mouse Helpers: Added
.hover(handlerIn, handlerOut)for quick and easy mouseenter/mouseleave chaining. - Global Utilities:
$.each(),$.throttle, and$.debounceare now globally exposed on the$object for easy access.
⚡ Performance
- High-Performance Iteration: Replaced native
.forEachwith a custom, breakable$.each()loop across the entire framework. This significantly reduces CPU overhead during DOM, CSS, and Event manipulations and allows for early loop termination.
🛡️ Bug Fixes & Architecture
- SSR Safety: Fixed a critical bug where string selectors would fall back to the global
documentinstead of the passed isolatedcontext. Node.js and Server-Side environments are now completely safe. - Event Delegation Fix: Fixed a potential
TypeErrorcrash when a user clicked on a pureTextNode(which lacks the.closest()method) during event delegation. - Typings: Fixed a TypeScript signature mismatch for
.prop()to correctly handle getter and setter overloads. - Leaner Installation: Moved
jsdomandtslibfrom standard dependencies topeerDependencies/devDependencies. This drastically reduces the installation size for browser-only users via npm.