Live data from Hacker News

Discord Switching to React Native for Android App

discord.com

71–80 of 82 posts

Re: Discord Switching to React Native for Android App

#71
post #56

Earlier quoted context omitted.

Damn I wonder why they don’t use WinForms or Qt either? Could it be that it’s an entirely different use case than a regular desktop application?

Not a different use case, all draw shapes to users' screen. I've seen people ship games with electron. If what GP is saying is correct, AAA companies should have no problem deploying CPU/GPU-intensive games using Electron. Leaving the sarcasm aside, I'm tired of people arguing Electron has no performance/memory/whatever cost. It's worse at everything compared to native programs except developer experience. I understa…

Sure they could ship games in electron that render to canvas and use wasm, otherwise yes they are entirely different use cases. Desktop UIs are mostly static. Web renderers are actually quite good at rendering mostly static UIs in an accessible and efficient way.

Re: Discord Switching to React Native for Android App

#72

I'm pretty convinced RN is only really a thing because it gives PMs/managers some good promo material about how they lead a team to "switching to a shared cross-platform codebase". They then end up using that to switch jobs/companies before they have to deal with the long-term fallout of making the switch to RN. My company recently switched both our Android and iOS apps over from native to RN. The RN promoters promis…

yeah migrating an existing app to react native is usually not a good idea, either rewrite (maybe keep a few native modules for niche things) or keep doing full native

Incrementally adding react native to an existing app is orders of magnitude harder than using react native from the start

I say this as a react native developer with some native android experience. React native is awesome, but most of the success stories are apps 100% react native or mostly react native with a few sprinkles of native code for some custom functionality

Also 3rd party libraries that are not maintained by Expo is usually better to be avoided, if you need some niche functionality just drop to native. And yes it does mean you now have 3 problems, but at least, summed together, those three problems are smaller than the previous 2 big ones

Re: Discord Switching to React Native for Android App

#73
post #13

I hate a lot of Electron and React Native based software, but Discord manages to avoid performance, stability, and quality issues that most seem to encounter. I don't know what they do or how they do it, but I think it's very impressive.

it is because they are not afraid to drop to native when it makes sense, see:

https://discord.com/blog/why-discord-is-sticking-with-react-...

react-native is NOT a total replacement for native code, you still need native devs. It is more like instead of 5 ios and 5 android devs you need 4 JS, 1 android and 1 ios devs (but the ios and android persons also need to know JS)

Re: Discord Switching to React Native for Android App

#74

Here's my experience with react native: - There were very little opportunities for sharing functionality between web and mobile. The standard react architecture is code-behind, and you can't share components between react and react native. - Time-consuming to update to new versions, especially on the IOS side of things. A constant avalanche of errors from the very convoluted cocoapods build system, with stack traces…

that was true a while ago, but react-native-web works pretty well these days. You do need to write your code react-native first though (ie your code is react-native and react-native-web adapts it to work in the web)

but a lot of things are, not clunky per se, but unsolved for web. Main example is JS-based tooltips, react-native-web doesn't give you one and it doesn't make sense to do it in mobile. So you end up needing a lot of if platform === 'web' do this, way more than just supporting ios+android

updating to new versions is a huge pain, I usually default to making a new project from scratch and re-introducing our custom native code. Having iOS build knowledge helps a lot

Re: Discord Switching to React Native for Android App

#75
post #28

Earlier quoted context omitted.

React Native isn't really web based. It draws real, native UI elements, not HTML.

Still a web framework though, even if the end result isn't HTML.

it is not much different from using python with QT on linux for example

Re: Discord Switching to React Native for Android App

#76
post #17

I thought Discord is mostly webview-powered, is it not? If so, this change will make very little difference to the user.

react native =/= electron (and similar frameworks like CEF). The former uses native widgets. The latter uses HTML/CSS rendered by a browser layout engine.

I know that. I am saying that if the app is mostly webviews anyway instead of building the views natively, there would not be much difference between being a fully native app with WebViews or being an RN app with components.

Re: Discord Switching to React Native for Android App

#77

I'm pretty convinced RN is only really a thing because it gives PMs/managers some good promo material about how they lead a team to "switching to a shared cross-platform codebase". They then end up using that to switch jobs/companies before they have to deal with the long-term fallout of making the switch to RN. My company recently switched both our Android and iOS apps over from native to RN. The RN promoters promis…

yeah migrating an existing app to react native is usually not a good idea, either rewrite (maybe keep a few native modules for niche things) or keep doing full native Incrementally adding react native to an existing app is orders of magnitude harder than using react native from the start I say this as a react native developer with some native android experience. React native is awesome, but most of the success storie…

I keep hearing the "You have go to all in" argument from React Native evangelists, but I haven't heard a reasonable explanation for why this would be. Why was Facebook able to introduce it within an existing native app? This also seems to contradict one of the major selling points, that you can always just drop down to native for problems outside its scope. This is a very important requirement for any company building more than a simple CRUD app.

A simpler explanation is that "you have to go 100% in on React Native" self-selects for anecdotes from tiny companies tackling trivial problems, and allows one to say "No true scotsman" when a bigger company has a bad experience.

Re: Discord Switching to React Native for Android App

#78

I'm pretty convinced RN is only really a thing because it gives PMs/managers some good promo material about how they lead a team to "switching to a shared cross-platform codebase". They then end up using that to switch jobs/companies before they have to deal with the long-term fallout of making the switch to RN. My company recently switched both our Android and iOS apps over from native to RN. The RN promoters promis…

This post hits the nail right on the head.

React Native is absolutely a business win, but a developer loss.

PM/Manager can advertise shared code base, and even sometimes hire less, or at least argue that they should be able to hire less, but really it ends up being a nightmare for the teams that have to use RN for all the reasons you've listed.

I work for a company that builds a very advanced mobile application (not your basic CRUD) and unfortunately the previous frontend manager decided on RN. The result is a 50% RN 50% native codebase which is a nightmare to traverse, and impossible to hire for. We need effectively 3 teams, RN / JS / TS, Java, and Swift.

The complexity added is absurd. The tooling, typescript, building, all of it. Going completely native drops all of that and allows developers to focus entirely on their craft - building rather than context switching all day long between JS / TS and Java / Swift.

Hands down the worst part is the performance. There is a very obvious performance hit in nearly all UI interactions.

If you're building out your mobile team and building a complex app, I highly recommend you do not use RN.

Re: Discord Switching to React Native for Android App

#79

I'm pretty convinced RN is only really a thing because it gives PMs/managers some good promo material about how they lead a team to "switching to a shared cross-platform codebase". They then end up using that to switch jobs/companies before they have to deal with the long-term fallout of making the switch to RN. My company recently switched both our Android and iOS apps over from native to RN. The RN promoters promis…

It looks like your company was ill prepared for the transition/ is not capable of fully transitioning as most of your mentioned "issues with RN" read like issues rather than problems with the framework itself.

> - In the end, RN code is only something like 20% of our Android app. They weren't able to just "write once" and run on both.

That has nothing to do with RN, that's on your company

> - Instead of having 2 teams, an iOS and Android, now we have 3 teams, iOS native, Android native, and RN. And the RN team is split between iOS and Android. All sorts of additional complexity now.

Again, your company/ mgmt. We shared code between iOS and Android and had zero native module maintenance.

> - We still need a fully staffed Android specific team for everything that couldn't be done in RN.

which was what exactly?

> - The performance difference vs. a native app is blatantly obvious.

The majority of apps within the app store could've been written in RN and you wouldn't know/ notice. Discords iOS App is written in RN and I bet a huge amount of commenters here wouldn't have know without reading the article.

Re: Discord Switching to React Native for Android App

#80

I'm pretty convinced RN is only really a thing because it gives PMs/managers some good promo material about how they lead a team to "switching to a shared cross-platform codebase". They then end up using that to switch jobs/companies before they have to deal with the long-term fallout of making the switch to RN. My company recently switched both our Android and iOS apps over from native to RN. The RN promoters promis…

This post hits the nail right on the head. React Native is absolutely a business win, but a developer loss. PM/Manager can advertise shared code base, and even sometimes hire less, or at least argue that they should be able to hire less, but really it ends up being a nightmare for the teams that have to use RN for all the reasons you've listed. I work for a company that builds a very advanced mobile application (not…

> I work for a company that builds a very advanced mobile application (not your basic CRUD)

I think this is your problem right here. By nature, most higher-level abstractions will work better for mainstream/expected use-cases. If you're really pushing the envelope, I can see why an abstracted framework wouldn't work for you. For my company (which does have a straightforward CRUD app), it's worked out great. Very little native code on either platform

Post reply on HN