278 points · by jhgg · 8y ago · 154 comments
I guess that's one way to sugarcoat the fact that you're at the mercy of Facebook being timely in fixing bugs here…
People don't remember what it's like, praying to dear gods that Microsoft patches that IIS bug before you lose your last customers.
I wish more companies would give developers about 10% of their time to develop things they think would benefit the company, whether it's internal tools or open source projects they rely on (or building new things). Just give devs every Friday or every other Friday with free reign to code or learn new things.
Ah well... If the projects they rely on stop being maintained they just suck it up and let it foster eternally till forced to migrate.
Dear Discord:
Your bread and butter seems to rely upon React / React Native. It's an open source project, pay your employees to contribute to it!
Their priorities may not align with yours, but it's not such a bad policy. If you don't like it, fork it?
Recently watched Angular Material first dismiss a glaring problem with datepicker, then sit on their hands [0] while some bloke made a complete fix, adjusting anything they brought up, then sit on their hands again [1] after it was finished until someone started building pressure again.
[0][1]: I didn't actually verify that. They might have had some really busy days. Point is they stuck to Google communication policy: try to not say anything at all.
Facebook's lawyers did some very questionable things to "open source" here.
Complaining about FB not prioritizing/fixing the particular issues that affect you the most seems a little bit insane to me. Of course they have their own priorities.
EG: In Android in the past there have been bugs in core components like the `RecyclerView` (thing that renders lists) that forced us to downgrade and unlike with React - there is no option there to fork the source and make our own bug fix.
https://android.googlesource.com/platform/frameworks/support...
Native iOS would have been a better example as that code is not open source at all.
Regardless, you're really at the mercy of _any_ maintainer of components you depend upon heavily. It's a fact of life unless you feel like building it all from scratch.
I know this comment is a joke but in all seriousness even if we did move away I think it would still mean we got several years of great utility out of the framework.
No tech lasts forever and it’s important to be open to change as well as being mindful to not chase the latest trend - as in all things, balance is key.
In your defense, it's a cancer that all "modern" apps done in javascript suffer from, but still, why?
Edit: for those who don't want to click, it's a screnshot of the os x activity monitor showing the worst memory consumption, in order: Discord Helper 1.98 Gb, kernel_task 1.67 Gb, Skype Helper 1.58 Gb, Slack 1.20 Gb :)
I've seen startup latency much slower than that on my iPhone SE. In the best case, the application takes about six seconds to cold boot when I tap on a notification. Sometimes it's closer to fifteen or twenty seconds if the app sits on the "connecting" screen for a while. It's difficult to understate how much slower the app feels than everything else on my phone.
Meanwhile, we keep working towards to improving our user experience on all the devices especially the lower-end ones (I personally use iPhone 6 as my go-to test device). For instance, we will add caching very soon to shorten the interaction waiting. Hopefully you will enjoy more using Discord on your SE then :)
iOS users tend to run newer devices generally which might lead some devs to feel that this extra optimization isn’t worth the time it takes, but I disagree because it doesn’t benefit only users with older devices – it’ll make your app run better on newer devices too and make it that much more unlikely that your app gets killed or causes the OS to kill other apps in multitasking scenarios (iOS kills resource hogs much more readily). In short, everybody benefits.
With this same thought process, I plan to pick up one of the 120hz iPad Pro models to test on soon. It’s one of the most powerful iOS devices available, but driving 120FPS isn’t easy and given how many apps fail to hit the target of 60FPS on similar hardware I’d bet that a huge number, perhaps even most, don’t come anywhere close to running at 120FPS even with the extra horsepower.
Thanks for all of your work.
And thank you for helping make Rust awesome.
* Have you evaluated cross-platform "native-ish" alternatives? (Nativescript, Flutter, etc.)
* What does the "lack of 64-bit support" mean for Android?
* This can be worked around by deferring work when doing transitions/animations based on user interaction but at the time we only had a single Android Engineer (myself) and I felt it would be an overly large hurdle to cross. The team is however still interested in trying again some point in the future now that we have more time for it.
* The minimum version we support is API level 16 which is quite old and we may eventually bump that to 17.
* We have not evaluated any native-ish alternatives mostly due to bandwidth but also because the goal is to re-use our stores/business logic from the desktop/ios clients so we can move faster.
* On 64-bit support https://github.com/facebook/react-native/issues/2814 it ca be worked around without much consequence but is a consideration as ones application grows in complexity and dependencies.
I believe it's something we may eventually take on - just not currently planned - there are a lot of ways we could make the nitro experience better.
Any other insights would be great, as I'm planning to start converting my web app to RN in the next months and didn't know Android would be a problem.
When we originally got it running on Android (without the chat view since that component is native in the iOS app) we found that it performed quite poorly due to most of our pages being heavy on data and UI - as well as being very reactive (a typical discord server might have hundreds of permissions, messages and users all changing/updating in real time). React Native is single threaded and while iPhone’s have great single threaded performance, Android phones are more reliant on multiple cores and RN as I understand it mostly can’t take advantage of that.
On higher end Android phones the performance was actually fairly acceptable out of the box, but our user base has a lot of gamers who are running very old Android phones from many years ago - and in those situations the lag was unacceptable. For iOS, most users tend to only last one or two hardware generations behind.
Additionally, at the time React Native for Android had just been released and there were a whole host of other issues at the time - bugs and lack of Android specific components like the Navigator (which have since mostly been ironed out).
Today I think it is possible to build a fast React Native Android application and I would recommend someone starting from scratch do so :). However now the challenge is that we have an existing Native Android app so our users already have a baseline expectation of feature parity and performance. If we switch over we must meet or exceed that bar.
The only thing left that really bugs me is the fact that you can't paste images from the clipboard into the message field. It's made me change my entire workflow, from copying images to saving them.
Sorry to use this as a soapbox for my pet issue, but I saw the opportunity :P
So stay tuned!
Thanks for the kind words, the team really appreciates it.
One question that popped up in my while reading the article was would you consider doing the android app in react native if you had to start now ? Or do you still feel it lacks the coherency it has with iOS.
While the performance footprint is mostly the same - the ecosystem and feature set around it has improved a ton to the point where I believe you could get it 90% there very quickly.
One of my friends has a small startup and they went full React Native as a team of two and they describe the Android side as "free" as in they really just focus on iOS and it 90% of the time it also works fine on Android (they care less about older devices at the moment so they don't spend time optimizing for those).
Android inherently will always have challenges due to the vast number of devices and hardware/performance problems but going native isn't a silver bullet either and doesn't shield you from the challenges entirely - it's just a familiar form of pain ;P
I've been using Discord's OAuth and that's been nice, but I what I'd really like is to display that status on my site.
Is this what's expected from the app?
I'm not an expect on voice but iirc we do use a different codec than Skype so the audio is not going to be identical however, we have advanced settings in the `Voice and Video` section of the settings that allows you to enable/disable things like Echo Cancellation and Voice Suppression that could be the cause of the feedback.
It is good, but we all have trouble with the notifications. (this has nothing to do with react native but you are here and this is a gripe). Like if you have it running on a computer it doesn't come to your phone. So we have tons of miss-communication for stuff like "yo I am drinking near your house meet-up". Discord just sits running all the time on your PC, which for most is running all the time. So I stopped using it for time sensitive messages which sucks. I would never dare use it for a "Hey I am buzzing outside your house answer". You literally have no idea where the notification for the person is going to go. FB-Messenger never had this issue.
Works a lot better than group texts, and with better file sharing to boot. We'll still text each other for 1:1 conversations where we're not near a computer.
We'd switch to Discord if Slack's free offering is ever gimped.
I keep Discord running on my desktop at work, plus I tend to have browser windows connected to it on my both my desktop and laptop at work. I still get phone notifications.
Certain programs can keep your computer in a non-idle state indefinitely even if you don't move the mouse.
However when one grows and starts competing head to head in the App Store or Google Play with the other top social or finance or music or whatever apps, the ones who have expert teams with familiarity with the specific Android or iOS platform will pull ahead. Particularly as you can still have a (mostly) common REST API backend, base things off the same design mockups with some modifications, and so on.
Is that your experience too, that a good bit of native code is required (with RN serving as glue and handling simple screens), or have you avoided that somehow?
Would have loved to use discord at work, but in developing countries... network connectivity is not always a given.
[1] - https://medium.com/airbnb-engineering/sunsetting-react-nativ...
* companies pitching a product by way of blog post
* companies recruiting by way of blog post
* individuals pitching a product by way of blog post
* individuals pitching themselves by way of blog post
Blog posts and TED talks are the new advertising mediums.
What Discord might show is that there are also a load of mobile engineers out there who do.
Personally I find it baffling why anybody would choose to work with anything based on JavaScript (I'm grumpy enough about having to work with something as primitive and loosely-typed as C#, so I find JavaScript an endless horror show), but there are people sitting right near me in my office who work on frontend web code all day and chose to do that and actually enjoy it.
So really, I guess I'm saying we're all different. And that's a good thing, because there are lots of different jobs we need to get done to keep all these systems running.
If the announcement was the other way around (we're going from native to react native!) I bet they would have gotten a similar flood of web/rn engineers.
Just because it benefits them doesn't mean it's exploitative or bad.
2.5.2 Apps should be self-contained in their bundles, and may not read or write data outside the designated container area, nor may they download, install, or execute code which introduces or changes features or functionality of the app, including other apps.
Also,
> we also have a flag that forces our users to relaunch the app if the bug is app breaking
How do you do this?
As far as your second question, we simply deploy store logic that loads a Modal telling our users that they must relaunch the app.
[1] https://microsoft.github.io/code-push/faq/index.html#1-does-...
> Apps may contain or run code that is not embedded in the binary (e.g. HTML5-based games, bots, etc.), as long as [long list of requirements...]
Any chance you could share any info about the architecture design of your homegrown system? I've seen a few snippets where devs build their bundles and host them in s3, how complicated was it for you to roll your own OTA solution? Would you guys do it again or would you use Code Push?
This makes some sense since on Android we have to re-write most of the stores/business logic and not just UI. We have modeled the architecture similarly to things on the Desktop/iOS side so we still are able to move fast and stay lean as a team.
So if one is writing a feature that say allows one to ban a user - they don't need to write any of the banning logic or worry about fetching the user data/validating it against server roles permissions - if it exists on the main Discord app, it can be safely imported.
Other helpful examples are perhaps things like markdown parsing - iOS was able to just import and use the exact same system desktop uses to handle markdown and things like user/channel mentions, custom emoji, etc. On Android we had to write one ourselves: https://blog.discordapp.com/how-discord-renders-rich-message...
On Android since there is no code re-use everything had to be written from scratch.
This is impressive.
Says it all. It is all about cost.
The team - myself included - works normal eight hour days and there is no "crunch time" (other than very rarely when we have external dependencies like when we launched our Spotify integration).
As an engineer we all want to have agency and be able to make impactful decision on the products we work on. Over-hiring too quickly is often what can lead to organizational bloat and can make things get built slower.
Instead, I think it's better to grow slowly, hire great people, and only hire when it's needed. I've found that as a company, staying small has made us always ask ourselves to make tradeoffs and constantly be thinking about what are the most important and impactful things we can be working on.
I am hoping that in the future something like React Fiber (https://www.youtube.com/watch?v=aV1271hd9ew) will make its way to React Native and unlock a new level of performance.
This is why I really hate tools like react native. They try and create a code symmetry and that's not unreasonable, but then they go too far and create behavioral symmetry and that's pretty much unacceptable for as wide a gulf as browser apps and mobile apps. They have such radically different use cases.
However, as Discord's mobile teams grow and expand we're exploring alternative UX designs that are significantly more mobile friendly. So your feedback is heard loud and clear at HQ :)
I think the economics of RN strongly do though. Why would you use RN if you aren't planning to reuse code between environments?
+ view/UI layer
+ flux/redux stores
+ data fetching and processing
+ action creators
+ utility libraries (date functions, markdown processor, etc)
The economics of RN allows us to share the last 4. However, sharing the first is actually more or less impossible without tooling like react-native-web as the components that exist on a native iOS app and the components that exist in HTML are just different. Certainly you can argue that sharing this much business logic would necessitate that the UI layer looks all the same, but I fundamentally disagree. That is like saying that because all your clients use the same API, they all must look the same.
It was that you had disabled right click on the join server page in Chrome, it is generally considered bad practice, but somehow I liked it since it reinforced the game interface feeling.
- a Discord iOS engineer