3 ms·
Hey HN, author of Tamagui here. I've been pursuing something like Tamagui for many years now, this is technically my 3rd or 4th iteration on a compile-time opt
by nwienert 5y ago
Hey HN, author of Tamagui here.
I've been pursuing something like Tamagui for many years now, this is technically my 3rd or 4th iteration on a compile-time optimized UI kit depending on how you count.
The motivation is simple: build apps with less code.
In react to do this today you have to sacrifice a lot: responsive design, themes, and general speed. None of the cross-platform UI kits do media queries or themes without resorting to JS, which hampers performance. Further, if you want a more modern API for themes, typed inline styles, media queries, etc, you sacrifice more performance. Our benchmarks[0] comparing Dripsy and NativeBase show 3-10x speed improvements, and that's not comparing stuff like media queries and themes which should be even more favorable.
Tamagui does all this with an optimizing compiler that lets you keep all the slick features without sacrificing performance. The compiler pulls out even inline JS logic into CSS on the web, or StyleSheet.create on native. It even flattens View/Text into div/span.
All that performance and platform-optimized-behavior makes a big difference, especially when building apps as apps tend to render many more components! It's also the only cross-platform UI Kit to support SSR.
Happy to answer any questions here!
There's actually a ton of room for continued improvement, and I'd love to set up some sort of sponsorship to keep realizing this. I think the current state of React is that it's tremendously powerful and well-designed, but actually releasing an app that runs on web + native is still a near-Everest type mountain to climb, and I hope to continue to change that.
[0] https://tamagui.dev/docs/intro/benchmarks https://tamagui.dev/docs/intro/benchmarks