Live data from Hacker News

React Native at Instagram

engineering.instagram.com

31–40 of 238 posts

Re: React Native at Instagram

#31
post #17

Earlier quoted context omitted.

Great article Martin. Do you have any performance figures or tips that you learned when porting the save feature? Specifically how was performance across Android/iOS?

Great question. First off, worth mentioning there are many performance metrics you might want to measure. On one hand start up times, but since you specifically mentioned Save, I assume you want to learn more about scroll perf (i.e.: dropped frames, memory usage, time to render next pages, etc). We don't have numbers we can share but but the React Native team is working on further improving this. Check out Spencer's…

Awesome, thanks for that link! So far I have been pretty happy with react native. On Android myself and another developer I have been working hit some issues around images on Android.

Part of the issues were our own fault: overlaying a transparent image provided by our designers instead of asking for a non transparent one, not using flags like renderToHardwareTextureAndroid.

Others were due to our use of the navigation library, react-native-router-flux, which on Android is backed by fragments. This caused a bunch of overdraw issues (i.e previously pushed views, which were not visible were being rendered in the background). We are planning on migrating away from this routing library to another one.

I'd love to read more articles about react native and performance based on real world examples at scale so please keep publishing them.

Re: React Native at Instagram

#32
I really want to look at React Native, but every time I pull up my Facebook app on my iPhone 6, it can take upwards of 30 seconds before the interface is useable.

That's on a very fast connection.

So to me the FB app is so slow, it makes me hesitant to give React Native much more thought as you'd figure the FB app would be THE showcase app for it.

Maybe I'm the only one?

Re: React Native at Instagram

#33
post #20

Earlier quoted context omitted.

What would be the biggest hurdling block to rewrite the main feed into React Native? As a follow-up, do you think there's a performant enough ListView implementation in RN to build the feed with?

I'll be more blunt: please fix ListView :)

You may be interested in https://github.com/facebook/react-native/commit/a3457486e39d.... It's likely not production-ready yet but hopefully will become really good soon.

Re: React Native at Instagram

#34

@martinbigio here in case anyone has questions

Did you guys use any other libraries from the React ecosystem to implement these features? (redux, normalizr, redux-saga, etc.) Also, what approach did you use for testing the RN flows? (unit testing, e2e testing, etc). BTW, thanks for sharing your experiences!

No, we didn't use any of those. For unit testing we used Jest <3 and for e2e an internal library developed by FB

Re: React Native at Instagram

#35
post #33

Earlier quoted context omitted.

I'll be more blunt: please fix ListView :)

You may be interested in https://github.com/facebook/react-native/commit/a3457486e39d... . It's likely not production-ready yet but hopefully will become really good soon.

Brace yourself, FlatList is coming :)

Re: React Native at Instagram

#37
post #32

I really want to look at React Native, but every time I pull up my Facebook app on my iPhone 6, it can take upwards of 30 seconds before the interface is useable. That's on a very fast connection. So to me the FB app is so slow, it makes me hesitant to give React Native much more thought as you'd figure the FB app would be THE showcase app for it. Maybe I'm the only one?

Last I'd heard, the Facebook app was still native per platform and not using React.

Re: React Native at Instagram

#38
post #32

I really want to look at React Native, but every time I pull up my Facebook app on my iPhone 6, it can take upwards of 30 seconds before the interface is useable. That's on a very fast connection. So to me the FB app is so slow, it makes me hesitant to give React Native much more thought as you'd figure the FB app would be THE showcase app for it. Maybe I'm the only one?

I wouldn't say you are the only one, but upwards of 30 seconds is very slow - I don't know anyone seeing that kind of performance. Perhaps try reinstalling?

Re: React Native at Instagram

#39
post #7

Earlier quoted context omitted.

Iirc, the reason you end up hitting the limit for 65k methods is that each library tends to keep independent copies of its dependencies. This simplifies dependency control, but ends up mushrooming quickly.

That is actually not true. Afaik multiversioning of dependencies is not actually supported by build systems without manual effort (not counting major versions in non-conflicting namespaces). Problem is really more in fat libraries and "unnecessary" (getters, setters) and synthetic (e.g. access to private methods from inner classes) methods that are usually not optimized away, especially in debug builds.

I've definitely included a library and then seen (otherlibrary).(library you included) as an option in autocomplete, fairly often. Happens a lot with utility-level things like okhttp.

Re: React Native at Instagram

#40
post #32

I really want to look at React Native, but every time I pull up my Facebook app on my iPhone 6, it can take upwards of 30 seconds before the interface is useable. That's on a very fast connection. So to me the FB app is so slow, it makes me hesitant to give React Native much more thought as you'd figure the FB app would be THE showcase app for it. Maybe I'm the only one?

Someone correct me if I'm wrong but AFAIK the Facebook app isn't really using react native yet, just in very small parts (event dashboard). The rest is still plain old swift and objc.
Post reply on HN