4 ms·
It was cool seeing a demo at the end made using Choo[1]. Choo is my favorite in the current sea of react clones. I like it because its tiny (4k vs react's ~200k
by josephg 9y ago
It was cool seeing a demo at the end made using Choo[1]. Choo is my favorite in the current sea of react clones. I like it because its tiny (4k vs react's ~200k). Choo supports server-side rendering. And its made out of smaller modules which are all independently useful (DOM generator, diff engine and router).
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.
[1] https://github.com/yoshuawuyts/choo https://github.com/yoshuawuyts/choo
- leeoniya 9y agoperformance isn't great, though: https://rawgit.com/krausest/js-framework-benchmark/master/webdriver-ts/table.html https://rawgit.com/krausest/js-framework-benchmark/master/we...
- infogulch 9y agoOverall the slowdown is 3.3x, but in memory usage it places third and in startup time it's in the top 10, and both of these are only about 1.1x slower than the fastest. I wonder how many cases would give a better UX to have the smaller, faster to load library.
- komali2 9y agoWhat does "startup time" mean compared to "usage"?
- hvidgaard 9y agoThe time from you enter the URL to you have landed in a usable state where you can use the site. For something you keep open all day, like email, general performance matters. But for things you use once or twice for 5 minutes, startup time matters a great deal more compared to the former.
- komali2 9y agoDamn I never thought to consider the actual framework's startup time - just our own app.
- nonsince 9y agoIt's not better UX for the end-user if the app is slower. It's not acceptable to make your life easier as a developer in trade for making a worse app. If the developer ergonomics lead to more features then it may be a good trade-off, but there are too many cases where people will trade performance to make their life easier.
- estsauver 9y agoI think there's obviously trade offs to be weighed, but really? You hand write assembly? I'm assuming you hand inline all your functions? UX is one of three hundred things programmers have to weigh when making decisions for a business or project.
- mbaha 9y ago1.1x faster navigation-UX by the way.
- vbezhenar 9y ago0.1ms reaction time and 10ms reaction time would be instant for a human, so you definitely can make your life easier with reasonable performance trade-offs.
- infogulch 9y agoUnder 16ms is one frame so anything less than that would be equivalent (modulo battery life), but that example is a factor of 100 slower. In reality this would look more like 0.1ms vs 0.4ms, or 1ms vs 4ms.
- infogulch 9y ago"slower" by what metric? It seems like you're ignoring the user's bandwidth, latency, and memory usage. We're talking about a library that is a factor of 100 smaller. That's 100x less code to transfer, parse, store, and optimize. 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.
- Vinnl 9y agoThat's stringly typed, right? That sounds like a huge downside to me compared to the not-so-huge downside of JSX. That said, I quite like hyperscript, especially in this form: https://github.com/ohanhi/hyperscript-helpers https://github.com/ohanhi/hyperscript-helpers
- josephg 9y agoUgh, that is way harder to read than html`<h1>oh hai ${name}</h1>`. They both work without compilation, and they can both compile to the same code anyway. Maybe you can get used to hyper, but ES6 tagged template literals are much easier on the eyes.
- Vinnl 9y agoMaybe > 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 :)
- idbehold 9y agoThe "tag" part of a tagged template literal is a function so maybe your editor should be updated to recognize them.
- allover 9y ago> (4k vs react's ~200k) 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.
- RodericDay 9y agoI love Mithril.js.