Hacker News new | ask | show | jobs
by bhdlr 992 days ago
How do you feel about react native?

As a career mobile developer I honestly can't tell the difference between a well made react native app and a true native app

3 comments

React is a terrible patchwork of a solution, which literally doubles the UI logic and work needed to get it performant. But it works, it solves the issue of being straight-forward to make platform agnostic by following tutorials.

I don't see any other way to go trully multi platform without making separate UI for Android and iOS. Or if you are going desktop, without using a platform agnostic graphics engine like something on top of OpenGL/Vulcan (which, v8 under electron is. A platform agnostic graphics engine). But, you are never going to get the native feeling/snapiness, because you are literally placing a canvas (your, multiplatfom app), on top of another canvas (Native UI engine of your platform)

IMO, if you want to build a service for someone, which carries some actual, real world utillity. And you can sell it to someone. You can't go wrong with a WebPageRenderer like Electron and some frameworks if choice underneath. This way, you can easily let the customer in on the joke from whatever device they are comfortable with. And only if you are working with a tool for pro IT or you are well funded, go for experimentation with faster UI. And even then it is not a rule, of which examples are VSCode & intelliJ dev tools. Both built on top of JS & Java platforms, both hindering their true potential like a stone tied the scrotum...

> I don't see any other way to go trully multi platform without making separate UI for Android and iOS.

https://avaloniaui.net/

Great reply. That last sentence was pure art.
Isn't that because React Native literally uses native components? It's not like Flutter which renders its own UI.
It's not about how well made it looks, or if I can tell a difference. It's: can I run a browser, Slack, Spotify, etc." at the same time without swapping. Turns out on a modern machine with a few Electron / Tauri / other apps running, the answer is no.
The entire point of Tauri is to not spawn another browser process for every other app, and thus be able to run many apps simultaneously as easily as running many websites simultaneously. I think you misgeneralized here.
This helps with the binary size, but not memory usage. You still effectively need the browser initialised in your process. See their own memory benchmarks: https://tauri.app/v1/references/benchmarks/#memory-usage - it's basically in the same range as electron.
I think you’re mistaken. Electron apps bundle a specific version of the browser with themselves (which often doesn’t match the user’s version), thus loading up to twice amount of libraries and all the dependencies. This increases memory usage. Also the linked benchmark shows Tauri uses significantly less memory than Electron. 540MB vs 270MB in best test cases.
370 not 270. In the other test it loses, so it's not really conclusive.

It's true you have to load up more code for electron, but not everything in the chrome package is code and lots of it gets mmapped anyway. A large part of the memory usage for the electron/Tauri apps is the chrome heap and loaded app resources - that doesn't get deduplicated. An empty chrome (just started with no tabs or extensions) uses 350MB of RSS memory for me. That's going to be slightly lower for electron, but that value will be the lower bound for every single electron process started.