Repository navigation
v1.6.0 AbortController & Smart Target Resolution
π YpsilonEventHandler v1.6.0: Revolutionary Event Handling
β¨ Major New Features
ποΈ AbortController Support
- Modern event listener cancellation with
abortController: trueconfiguration - Automatic signal assignment to all event listeners for efficient cleanup
- Perfect fallback to manual removal when AbortController is not available
- Zero performance overhead when disabled
π― Smart Target Resolution
- Solves the infamous SVG-in-button clicking problem with
autoTargetResolution: true - Intelligent DOM traversal to find actionable parent elements
- Handles nested elements like SVG icons, paths, and complex UI components
- Only activates on configured event types for optimal performance
πΎ Enhanced SPA Demo
- Advanced localStorage persistence for todo items
- Smart counter preservation during handler destroy/recreate cycles
- Real-time configuration toggles without page refresh
- Interactive testing of all library features
- SPA Demo
π§ Live Feature Toggles
- Dynamic configuration switching in the SPA demo
- Toggle smart target resolution on/off in real-time
- Demonstrates handler recreation with preserved application state
- Perfect for testing and understanding feature impact
π§ Technical Improvements
- Complete TypeScript definitions for all new features
- Updated all CDN references to v1.6.0 across examples
- Comprehensive documentation with practical configuration examples
- Perfect backward compatibility - no breaking changes
- Enhanced error handling with better edge case coverage
π― Performance Impact
- Zero performance overhead when features are disabled
- Native AbortController efficiency when available in modern browsers
- Optimized DOM traversal with proper boundary checking
- Smart target resolution only processes configured event types
π What's Included
- πͺ 30 Interactive Examples demonstrating every feature
- π Complete Documentation with configuration guides
- ποΈ TypeScript Support for enterprise development
- π IE11+ Compatibility for maximum browser support
- β‘ Zero Dependencies - just native browser APIs
π Why This Release Matters
This release establishes YpsilonEventHandler as the definitive solution for enterprise-grade event delegation. The combination of AbortController support and smart target resolution solves two of the most common pain points in modern web development:
- Memory leak prevention with efficient event cleanup
- Nested element handling for complex UI components
π Get Started
npm install ypsilon-event-handler@1.6.4<script src="https://cdn.jsdelivr.net/npm/ypsilon-event-handler@1.6.4/ypsilon-event-handler.min.js"></script>class MyHandler extends YpsilonEventHandler {
constructor() {
super({
'body': ['click']
}, {}, {
abortController: true, // Modern cleanup
autoTargetResolution: true, // Handle nested elements
enableStats: true // Performance tracking
});
}
}
new MyHandler(); // Revolutionary event handling activated!Live Examples: https://eypsilon.github.io/YpsilonEventHandler/example/public/
Documentation: https://github.com/eypsilon/YpsilonEventHandler#readme
NPM Package: https://www.npmjs.com/package/ypsilon-event-handler