Live data from Hacker News

React Native at Airbnb

medium.com

21–30 of 259 posts

Re: React Native at Airbnb

#21
post #17

Earlier quoted context omitted.

As a Redux maintainer, I'd be really interested to know what approaches they used, and what sorts of difficulties they had. (I'll throw out my obligatory comment that you are always welcome to use as much or as little abstraction as you want on top of Redux, and there's plenty of options available to trim down "boilerplate" depending on your situation.)

Those libs add some "magic" which is going against the point of Redux (knowing exactly what's going on). Instead of those abstraction libs I like to use the observable pattern with Rx or MobX

Depends on what your definition of "magic" is.

For example, we specifically have a "Reducing Boilerplate" docs page [0] that talks about writing reusable logic for reducers and action creators, like "higher order reducers" or a `createReducer()` util that accepts a lookup table of action types to handler functions. There's many existing libs that implement this kind of pattern [1].

Beyond that, there's other libraries that provide a higher level of abstraction, like automatically generating logic to handle common use cases (normalizing data, updating certain fields, etc) [2].

Updating data immutably can become complex [3], so there's a lot of immutable update utility libraries out there [4]. I recommend Immer [5], which lets you write normal mutative code but then applies the updates immutably.

Finally, there's frameworks built on top of Redux, like Kea and Rematch [6].

So, plenty of options available, depending on what you're comfortable with.

[0] https://redux.js.org/recipes/reducing-boilerplate

[1] https://github.com/markerikson/redux-ecosystem-links/blob/ma...

[2] https://github.com/TheComfyChair/redux-scc , https://github.com/Bloomca/redux-tiles

[3] https://redux.js.org/recipes/structuring-reducers/immutable-...

[4] https://github.com/markerikson/redux-ecosystem-links/blob/ma...

[5] https://github.com/mweststrate/immer

[6] https://github.com/keajs/kea , https://github.com/rematch/rematch

Re: React Native at Airbnb

#22
post #3

Others have been coming out and talking about similar experiences with React Native. This thread made the rounds on Twitter and Medium fairly recently: https://twitter.com/sandofsky/status/1002634185566236679 https://twitter.com/VivekxK/status/1002694526467653632

The common thread I see is that mixing native and react-native is hard. Doing so while working across organizations that may or may not use react-native is doubly so. Sometimes this boils down to the technology, knowledge, and the engineering systems needed to support both but I've also found native developers tend to strongly dislike react-native and lobby against whenever they can.

For me, I'm using it to successfully build mobile apps for a large tech company with very limited mobile developer resources. We've been able to ship Android and iOS apps in a couple months using 100% react-native. I attribute a lot of this to knowing the limitations of the platform and designing a cross-platform experience from the start rather than trying to get the "best of native" out of abstracted JavaScript.

I'll always argue that native is the way to go for the best user experience but react-native is a great tool to have in the mobile space.

Re: React Native at Airbnb

#23
post #5

None of the recent articles or HN comment threads about React Native spend much time evaluating Haxe. I guess it's not that widely used for CRUD apps and is more popular for games? Anyway, I'd love to know how it would work for an Airbnb-like org.

It is same with Xamarin. They don't have people that would know these languages, and they would be passionate about them.

Re: React Native at Airbnb

#24

"While debugging, React Native attaches to a Chrome Developer Tools instance. This is great because it is a powerful debugger. However, once the debugger is attached, all JavaScript runs within Chrome’s V8 engine. This is fine 99.9% of the time. However, in one instance, we got bit when toLocaleString worked on iOS and but only worked on Android while debugging. It turns out that the Android JSC doesn’t include it an…

I had something like that once in native web dev. It turned out that by default when using the debugging pane the browser would disable cache so the issue (whatever it was) disappeared.

Close debugging? It broke again.

Maddening.

Re: React Native at Airbnb

#25
post #8

I haven't used React Native, but I've ready a few posts from people adopting it. They typically test the waters by writing new app views in React Native instead of rewriting everything. But how much cognitive overhead is there in maintaining multiple toolchains (React Native and native and/or web views) and debugging views in different languages in one app?

I work on an app that is written with a combination of iOS native code, JS, and server side code.

It’s not easy to debug at all. The problem they mentioned where your stack traces just end at layer transitions is a real problem. Even if the server side isn’t involved in the bit you’re working on.

Re: React Native at Airbnb

#26
post #2

This is a really good write up and I love how they were cautious not to feed the ongoing fanboyism in for and against React Native folks. Say what you like but this is a very mature move from a young engineering organization.

I have to agree. It was really interesting that they highlighted that nearly 2/3rds of their engineers would use React Native again. I also assumed that the last part of the blog series was going to be mostly fluff / product announcements, but their efforts in server side rendered native screens and drastic reductions in build time are legitimate takeaways from devs who are used to development cycles at React-Native…

Server side rendered native screens just seem like fancy words for browser to me…

I get that it’ll have native performance and responsiveness, but still maybe just touch up your website and call it a day?

Re: React Native at Airbnb

#27
post #12

While i don't have much experience in RN, but have a decade of mobile native development (android + iOS) and two years of React. The whole 10 years there were people that think that they can just get "web" technology and speedup mobile development. Almost always this companies had no mobile engineers that know how this stuff works. Developers that know that you just can't listen to scroll and update animations by sen…

> Right now there are still no navigation library. React Navigation and React Native Navigation are both viable options with their own pros and cons. Been using them successfully in different projects. https://reactnavigation.org https://wix.github.io/react-native-navigation

I think what they meant is that there is no built-in production-ready navigation library, which is honestly atrocious.

Re: React Native at Airbnb

#28
post #24

"While debugging, React Native attaches to a Chrome Developer Tools instance. This is great because it is a powerful debugger. However, once the debugger is attached, all JavaScript runs within Chrome’s V8 engine. This is fine 99.9% of the time. However, in one instance, we got bit when toLocaleString worked on iOS and but only worked on Android while debugging. It turns out that the Android JSC doesn’t include it an…

I had something like that once in native web dev. It turned out that by default when using the debugging pane the browser would disable cache so the issue (whatever it was) disappeared. Close debugging? It broke again. Maddening.

> native web dev

That has to be the strangest combination of terms I've seen this month.

Re: React Native at Airbnb

#29

Earlier quoted context omitted.

I have to agree. It was really interesting that they highlighted that nearly 2/3rds of their engineers would use React Native again. I also assumed that the last part of the blog series was going to be mostly fluff / product announcements, but their efforts in server side rendered native screens and drastic reductions in build time are legitimate takeaways from devs who are used to development cycles at React-Native…

Server side rendered native screens just seem like fancy words for browser to me… I get that it’ll have native performance and responsiveness, but still maybe just touch up your website and call it a day?

Ah, my mistake, it should say "server-driven," which is more accurate. The view isn't actually rendered on the server, it just seems to be sent over in a declarative format, which the client then renders into a native view.

Re: React Native at Airbnb

#30
Reading a bit between the lines and keeping in mind that rumour that Facebook was removing RN from some of their projects…

Could it be true? Does AirBNB see the writing on the wall somehow?

I know that RN is open source and people will continue to support it and everything will be great, but without Facebook behind it, I wonder how much traction it’ll have.

Post reply on HN