Live data from Hacker News

How Discord achieves native iOS performance with React Native

blog.discordapp.com

11–20 of 115 posts

Re: How Discord achieves native iOS performance with React Native

#11
post #6

Sounds like React Native causes more work then necessary. Business logic can be easily shared between different platforms, Android, macOS, Windows and iOS. Always the most time is spend to make the app behave right for each platform, so that’s only bit which differs. I am happily writing apps in Swift for Android and iOS

Watching some videos illustrating writing iOS React Native apps using Clojurescript, with REPL changes updating app display in real time (well, "live") is what makes me interested in RN. Were it not for that, I don't see why Swift is such a bad thing. I know that maintaining two separate code bases for iOS and Android is theoretically bad, but I imagine if the apps are architected well it shouldn't be such an issue.

Re: How Discord achieves native iOS performance with React Native

#12
post #3

I recently tried to start a react native / typescript project, but the ecosystem confused me a lot. The various different tool recommended to create a project, some project templates not even compiling, the tons of different utilities required to process source files.. All that and not a single reliable source of documentation, made me feel it would be a real nightmare to maintain on the long run.

You are not wrong. It is a nightmare to maintain, and if you already took the leap you best keep that project updated as soon as possible or you will be fucked beyond repair.

There has to be a better way to write mobile applications. Is that Ionic? I don't know.

Re: How Discord achieves native iOS performance with React Native

#13
post #6

Sounds like React Native causes more work then necessary. Business logic can be easily shared between different platforms, Android, macOS, Windows and iOS. Always the most time is spend to make the app behave right for each platform, so that’s only bit which differs. I am happily writing apps in Swift for Android and iOS

The Swift for Android and iOS makes sense but how do you "easily" share same business logic between those other different platforms?

Swift will also work on Windows, and of course on MacOS (and Linux). If you prefer, you could use Kotlin in a similar role via kotlin-native.

Re: How Discord achieves native iOS performance with React Native

#14
post #11
post #6

Sounds like React Native causes more work then necessary. Business logic can be easily shared between different platforms, Android, macOS, Windows and iOS. Always the most time is spend to make the app behave right for each platform, so that’s only bit which differs. I am happily writing apps in Swift for Android and iOS

Watching some videos illustrating writing iOS React Native apps using Clojurescript, with REPL changes updating app display in real time (well, "live") is what makes me interested in RN. Were it not for that, I don't see why Swift is such a bad thing. I know that maintaining two separate code bases for iOS and Android is theoretically bad, but I imagine if the apps are architected well it shouldn't be such an issue.

> I know that maintaining two separate code bases for iOS and Android is theoretically bad

I'm not sure _why_ this should be theoretically bad. It depends what you're going for, of course, but cross-platform GUIs are typically... not good. There's a lot to be said for separate GUIs with shared business logic IMO.

Re: How Discord achieves native iOS performance with React Native

#15
Very interesting to read how they were able to overcome their performance issues and didn't know they were such a small but effective team.

For us at Standups[1] RN has been just instrumental. As a small team, we are able to ship features, just like Discord, vertically all across the stack. Having 1 language in common (TypeScript) all across your stack is the best for small teams/startups. We share most of our code.

For those of you interested in how to share code vertically using TypeScript[2], check out this guide by Bruno Lemos, super helpful, great value there for startups and especially tech solopreneurs.

[1] https://standups.io

[2] https://dev.to/brunolemos/tutorial-100-code-sharing-between-...

Re: How Discord achieves native iOS performance with React Native

#16
The iOS app of Discord is crappy compared to the Android app. I mean, it's not bad bad, but it's not good, or at least not as good. I wonder why they decided to go this route instead of hiring iOS developers?

I could understand if they used the same app for both platforms (like they do with their Electron app, which is also not as good as Ripcord), but since they have a native app for Android...

Re: How Discord achieves native iOS performance with React Native

#17
post #4
post #3

I recently tried to start a react native / typescript project, but the ecosystem confused me a lot. The various different tool recommended to create a project, some project templates not even compiling, the tons of different utilities required to process source files.. All that and not a single reliable source of documentation, made me feel it would be a real nightmare to maintain on the long run.

You are right. This is part of what made me try Flutter for a new app over RN. While it isn't perfect (no tooling is), the initial user experience is pretty good and the documentation is constantly updated as the product matures.

I understand they are using the Dart langugage? Was it hard to master?

Re: How Discord achieves native iOS performance with React Native

#18
post #4
post #3

I recently tried to start a react native / typescript project, but the ecosystem confused me a lot. The various different tool recommended to create a project, some project templates not even compiling, the tons of different utilities required to process source files.. All that and not a single reliable source of documentation, made me feel it would be a real nightmare to maintain on the long run.

You are right. This is part of what made me try Flutter for a new app over RN. While it isn't perfect (no tooling is), the initial user experience is pretty good and the documentation is constantly updated as the product matures.

I used to be into flutter (theorically), but after seeing some bugs and performance issues, i’m now thinking the best combination would be :

- write once and compile all business logic (and server and fs i/o ideally) into a portable independant libray, either in something that compiles to C, or wasm (once it’s more mature)

- write native UI code using native tooling, and call the business logic library from there.

But i haven’t settled yet on the ideal PL to write that library and have it interface easily on both android and ios.

Re: How Discord achieves native iOS performance with React Native

#19
post #4

Earlier quoted context omitted.

You are right. This is part of what made me try Flutter for a new app over RN. While it isn't perfect (no tooling is), the initial user experience is pretty good and the documentation is constantly updated as the product matures.

I understand they are using the Dart langugage? Was it hard to master?

Super easy if you know JS/TS and turns out that I actually quite like it.

Re: How Discord achieves native iOS performance with React Native

#20
post #3

I recently tried to start a react native / typescript project, but the ecosystem confused me a lot. The various different tool recommended to create a project, some project templates not even compiling, the tons of different utilities required to process source files.. All that and not a single reliable source of documentation, made me feel it would be a real nightmare to maintain on the long run.

You are not wrong. It is a nightmare to maintain, and if you already took the leap you best keep that project updated as soon as possible or you will be fucked beyond repair. There has to be a better way to write mobile applications. Is that Ionic? I don't know.

Seriously, take a stab at building an app in Flutter.
Post reply on HN