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:
VirtualPatch {
type: 4,
vNode:
VirtualNode {
tagName: 'DIV',
properties: [Object],
children: [Object],
key: undefined,
namespace: null,
count: 1,
hasWidgets: false,
hasThunks: false,
hooks: [Object],
descendantHooks: false },
patch: { 'ev-click': [Object] } }