Hacker News new | ask | show | jobs
by toan3rd 2597 days ago
If i understood it correctly, React Native basically gives you a JS runtime environment that handles communication with native APIs of the system and is shipped with your app. Flutter (and Dart) will transpile into native code and compile natively for your platform.

So on React Native you will have that abstraction layer add runtime latency and package size of your app, while Flutter (Dart) really outputs native code.

4 comments

Flutter gives you native code but not native UI. It reimplements and draws everything itself (mimicking the native look), like Swing or Qt.

React Native is the other way around - real native widgets backed by interpreted/jitted JavaScript code.

When React Native's fabric rearchitecture is available you will see much better performance. The thing that hurts performance today is that damn bridge communication between javascript and native that will be severely improved in fabric.
As I understand it, Flutter/Dart is compiled to native code but not using any of the native UI widgets.

To get native code plus native UI widgets plus some cross platform reuse you'd have to go with something like Xamarin.

Package size for Flutter apps is a lot larger than RN, even the RN Android build that ships it’s own JS runtime. There are complaints everywhere of simple apps reaching 100MB size.

As for runtime latency, I’ve recently worked on a RN app that outperformed its native sibling. Looking forward to the Fabric release.

Unless you're importing a ridiculous amount of packages and assets, you'd never hit 100MB with simple apps, that's just people looking at debug mode and thinking that it's the final app size. Simple apps can easily be under 8MB once compiled.
Not really true, you are likely comparing a debug build. An Android Flutter apk sits around 4MB for smallest app. Most of my apk sizes are around 8MB-10MB w/ Flutter
I haven't written any myself, going from reports online that builds are a lot larger than expected. That minimum size is for an app without any components or other modules. The RN app I mentioned was ~6MB with a fully blown app, state management, heavy data layer, hundreds of components, animation, i18n, a handful of native modules, encryption, and so on.

In short, Flutter doesn't really have any advantage in size over RN.