by josephg · 9y ago · 0 comments
Instead of using JSX files, choo uses ES6 tagged template literals. As a result the code doesn't need a compilation step at all. But you can still actually compile the templates if you want for better performance + a smaller JS bundle in production.
Its great stuff. I'm a huge fan.
That said, I quite like hyperscript, especially in this form: https://github.com/ohanhi/hyperscript-helpers
> h1(`oh hai ${name}`)
is harder to read than
> html`<h1>oh hai ${name}</h1>`
for some people, but even then your editor can understand that that is a function, can tell you when you've mistyped it, can autocomplete it for you, and can give you hints on what arguments it takes (since it has TypeScript definitions).
And as a bonus for me, I also find the former easier to read than the latter, but that might just be getting used to it :)
I love Choo too, but it's 4k gzipped compared to React 43k gzipped (incl ReactDOM). I think you were comparing gzipped Choo to non-gzipped React.
UX is one of three hundred things programmers have to weigh when making decisions for a business or project.
My claim is that for the user's benefit it may be better to choose a library that sacrifices some benchmark performance metrics like "Time to update the text of every 10th row for 10000 rows with 5 warmup iterations." in favor of startup time and memory. These are the exact same tradeoffs that Seth Thompson mentioned in the video, they can't just be dismissed wholesale.
My question is: how many real apps should make this tradeoff for the smaller library?
I would guess "many more than make it now." Developers are wooed by the columns with a lot of pretty green (myself included) and end up making their app worse because they're optimizing for the wrong thing.