@piccalilli unpoly JS (unpoly.com/) allows exactly this, even for very complex enhancements. So bad it's a quite unknown gem 🤷