It appears that:
- virtual-hyperscript is creating a new EvHook on each call
- the diffing algorithm compares the Hooks with reference equality, not the value inside the hook, so they are different every time
- the result is that all ev-* handlers are patched on every diff
The file explicit.js shows the behaviour I expected, no patch needed. The file hyperscript.js demonstrates the issue, which is this patch: