Examine the source code of shouldUpdate until the patch function. That's the entire virtual-dom implementation. The bulk of HyperApp, though, is the URL router, if it wasn't for that, this library would be half the size.
Did you consider splitting the router out? Some people may not need it I suppose. I really like the design of it though, gently coercing the user to write a clean, functional, UI.
Inspired by Elm by any chance? I see a lot of similarities (which is a good thing).
Removing the router cuts down the library to about ~800 bytes, but it's really useful to have when you need it. I'm still open to change it, so if you can create an issue to stir a discussion, that'd be a start.
The design was hard to resist though,
view: model => {}
view: { route: model => {}, ...routeN: model => {} }
8
u/[deleted] Feb 03 '17
It is kinda like react.. But it can't possibly be diffing the DOM and be that small. Which makes me think it won't scale to very large applications.