Hacker News new | comments | show | ask | jobs | submit login
Using React Native: One Year Later (discord.engineering)
127 points by sotojuan 495 days ago | hide | past | web | 23 comments | favorite



The Discord iOS app is fantastic! It's a great example of dropping down from JS to native to implement features that aren't yet possible with just JS (in this case, smooth animations while simultaneously doing work in JS and a chat view).

Related to this: I recently did a talk about building an Android app with React Native in pure JS at ReactEurope in Paris, and discussed the main issues that we had encountered -- people interested in this article might also enjoy the talk: https://www.youtube.com/watch?v=cI9bDvDEsYE


> We tried to run the app on Android too when React Native for Android came out, but unfortunately encountered some performance issues and decided to hold off.

Is this still the case for Android? I've been thinking of trying out React Native, but for me Android would be the main platform and iOS a bonus that may or may not be used.


We built our app (Dugout FC) in RN for iOS and implemented Android about 3 months after the Android RN stuff was released. Performance was ok (and getting better with later RN versions) and it has a > 4 star rating in the play store.

Totally love React Native. Unless you are doing something pretty unusual, I can't see a reason not to choose it over native dev.


If you're able to share, would love to hear:

What does "performance was ok" mean in your context? Any stats to share?

What's the workload profile of Dugout FC like?


We haven't tried in months so I can't give a scientific answer but our assessment early on was more that due to the diversity of Android devices. The low end ones that are for sale even now won't perform well enough for our use case.


Did your case have some things that make it heavy in some way? e.g. very long list with many images, data structures that were big and kept in memory? Video or heavy animations? Or not really and the whole thing was just slow?


We ran the exact same code (minus the Chat view) that we have on iOS which performs really well. It performed poorly on Android devices we care about. Touch events would lag (because of the JS computations hey resulted in), animations would be choppy (Android has native Animated.js now though, we haven't tried it). Our conclusion was since we already had a pretty good native Android app it was probably not investing time in a degraded experience. We will maybe try again in the future but the gut feeling is JS performance on many slow cores (Android devices love this) is obviously not as good as two fast cores (iOS devices).


The performance of the native Animated class is much better than handling animations in JS - definitely give that a try if you're trying RN again.

I'm curious about touch events - what JS computations were happening on touch events, was it complex and app-specific or was it something relatively standard?


I can't speak to the experience of building a large Android app with RN, but a regular old pages, lists and forms app (for which RN shines) it's a good choice.


It's quite the opposite actually, I found out it was working best on iOS.


Well yes, that's what the article says, so I was asking whether it would be good enough on Android already now.


Keep an eye on Alibaba's Weex, especially if you like VueJS:

http://alibaba.github.io/weex/


I've been using VueJS for a few months and am a big fan. Can you elaborate on why Weex would be attractive to VueJS users? I couldn't find much documentation on it.


I've never used Weex (or React Native) but it looks like Weex uses VueJS syntax to render components [1], just like React Native uses React syntax.

[1]: https://github.com/vuejs/vue/issues/2119


I love Discord and I think it'll seriously challenge a lot of communications tools out in the market. Discord won't just stop at communication for gaming. It can be a general purpose communication tool.


The React community uses it for all their discussions (ranging from React core to the various libraries in the ecosystem) and it works great and is very fast. Even their Electron desktop app performs very well!


Is there still no way to mark channels as favorites or otherwise organize/hide channels? I can't stand using the reactiflux Discord for this reason.


The best way to do this right now is to "mute" channels by clicking the bell icon on the right of the channel header (or opening the server notification settings, or right-clicking the channel name). You can then easily hide all muted channels, providing a good way to get a condensed or filtered view of large servers.


At the end of the day Discord is a chat for gamers and gaming so features like that and searchable history aren't implemented yet because they're not things gamers usually use. They'll come eventually though.


"Apple has recently allowed you to update the app over the air using JavaScriptCore without going through the App Store review process again."

What does this mean? Can someone elaborate on this?


You can push updates OTA for your app. i.e. https://microsoft.github.io/code-push/


"Flexbox’s style code is about half as long and far easier to understand than the code of Auto Layout."

Hell yes! Is this a rough estimate or did you compare implementations in each?


A way to use React but without JS, like with swift?




Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: