News for hackers. Stuff that matters.
Re:React Native 0.69 by schr3da on Thursday June 23, 2022 @04:49AM (#31846548)
To me react native is the only real way to go if you are considering cross platform development besides using a webview and web stack for your UI.

Reason is simple. React Native abstracts only platform away by exposing base components. If you really need something for a specific platform it is very easy to write a custom plugin - so you will need some platform knowledge. I have used flutter as well but must admit it feels not the way as I would like to have - especially the shader compilation if a component gets shown for the first time I feel annoying.

So to me react native is best - but comes with its own pain points like updates...

If you can afford it go pure native and try to write business logic in a shareable language e.g. Rust, C, C++, Kotlin native... and integrate the UI based on the platform.

If thats not an option I recommend react native + if needed custom modules and try to not use too many third party libs.

Re:React Native 0.69 by andreidd on Thursday June 23, 2022 @07:01AM (#31847392)
You can do both: two years ago I was looking for the best solution to ship a cross platform app (Android + Windows) and I just couldn’t decide whether to go platform-based UI + a shared C++ core or React Native. I ended up using React Native + a shared C++ core exposed as a RN module. As long as the API surface is narrow (and it is for my use case) this turned out well and it still gives me the possibility to scrap RN at any given time for platform based UIs.

Bonus: since most of my logic is C++, I am still able to ship the app using two RN versions: 0.59 for Windows 7 and 0.67 for Android

Re:React Native 0.69 by 1ark on Thursday June 23, 2022 @07:18AM (#31847505)
Xamarin is a good alternative if you don't want the overhead of JS runtime, without going all the way down to the metal as you mentioned. Shared code base. But you sacrifice a bit of productivity for performance and maintainability.
Re:React Native 0.69 by jurmous on Thursday June 23, 2022 @09:41AM (#31848982)
In React Native they now use the Hermes engine which can have the JS code precompiled into byte code.

https://reactnative.dev/docs/hermes#confirming-hermes-is-in-...

Re:React Native 0.69 by zigzag312 on Thursday June 23, 2022 @10:57AM (#31849988)
With .NET 7, C# can be compiled into machine code.
Re:React Native 0.69 by tmitchel2 on Thursday June 23, 2022 @01:08PM (#31852096)
The lack of Jsx equivalent in c# kills the deal for this use case
Re:React Native 0.69 by account-5 on Thursday June 23, 2022 @07:44AM (#31847702)
I'm currently looking at a cross platform development technology to learn. I've limited experience all of it with Cordova. I was looking at Dart/Flutter. Is react native much better?
Re:React Native 0.69 by mhoad on Thursday June 23, 2022 @09:04AM (#31848486)
Along what metrics is the question.

As far as I know it’s:

- less popular (https://gist.github.com/tkrotoff/93f5278a4e8df7e5f6928eff986...)

- worse performance

- much more frustrating developer experience (inherently subjective but not a particularly controversial opinion)

- less supported / actively developed (some very core parts of the RN ecosystem got punted to “community supported” where they basically died in place) but also worth comparing GitHub activity for Flutter https://github.com/flutter/flutter/pulse/monthly and RN https://github.com/facebook/react-native/pulse/monthly

I think Flutter is a much better long term bet despite the fact that it’s a much newer project.

Re:React Native 0.69 by jurmous on Thursday June 23, 2022 @09:37AM (#31848945)
React Native did a lot of work with the performance issues. They have now their own JS interpreter called Hermes. It also allows your javascript code to be compiled to byte code for better performance. Furthermore their new architecture allows for better integration with native and faster performance. https://reactnative.dev/docs/new-architecture-intro

I think a lot of people have their opinions based on an image of React Native in the past. It evolved a lot to be better performant and easier to work with. And for many people the React ecosystem is way more familiar than Dart.

Re:React Native 0.69 by zigzag312 on Thursday June 23, 2022 @11:04AM (#31850105)
Dart is compiled to machine code, not just byte code.

There's also new rendering engine being worked on for Flutter called Impeller. It's not just React Native that's improving.

Re:React Native 0.69 by mrbombastic on Thursday June 23, 2022 @12:35PM (#31851555)
I think the core problem any cross platform solution is going to face is that maintaining a compatibility layer between 2+ proprietary OS’s* is a recipe for a bad time. It is why these projects need to be supported by a massive tech company. My only point being even if Flutter is at an advantage today over react native on this point, long term they will face the same problems as react native with stagnating cross platform support.

edit: silly mistake Android is open source, not sure how much it helps when compatibility layer is not a priority for the OS developers

Re:React Native 0.69 by zigzag312 on Thursday June 23, 2022 @03:46PM (#31854262)
> I think the core problem any cross platform solution is going to face is that maintaining a compatibility layer between 2+ proprietary OS’s* is a recipe for a bad time.

Flutter has big advantage in this area as it doesn't wrap OS's controls, but has build it's own controls on top of lower level OS's APIs.

Avalonia (which also renders it's own controls) has posted an article, describing how it's easier supporting new platforms this way: https://dev.to/avalonia/avalonia-platform-support-why-its-si...

Avalonia GUI apps can run on Linux without a desktop environment installed because of this.

Re:React Native 0.69 by mrbombastic on Saturday June 25, 2022 @01:55PM (#31877270)
Aha that is interesting I wasn’t aware of this difference. Pushing the layer down to lower level controls does seem like it would help with this but perhaps at the cost of ui consistency on the platforms?

Either way thanks for the link, I’ll check it out.

Re:React Native 0.69 by zigzag312 on Sunday June 26, 2022 @09:38AM (#31883826)
Yeah, since all controls are created from scratch there is no inherited consistency with the controls of the underlying platform.

However, framework developers often develop controls that emulate platform controls. Not all are 100% match. Depends on the quality of the implementation.

The quality of Flutter controls is not yet on par with iOS's controls, but if they continue to improve at the same rate as they currently do, in 1-3 years they could match or even surpass them.

Re:React Native 0.69 by jurmous on Thursday June 23, 2022 @09:31AM (#31848843)
There are way more people knowing React and JS than dart. So it is easier to find engineers and thus help if you are stuck with basic React or JS concepts.