Live data from Hacker News

React Native at Airbnb

medium.com

41–50 of 259 posts

Re: React Native at Airbnb

#42
post #4

"Redux is notorious for its boilerplate and has a relatively difficult learning curve. We provided generators for some common templates but it was still one of the most challenging pieces and source of confusion while working with React Native." Interesting to see even Airbnb struggles with Redux

Having never worked with Redux, what is its point? Is it really so hard to stick app state in a JS object and databind off that?

Re: React Native at Airbnb

#43

Earlier quoted context omitted.

> 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.

I never understood the obsession with native navigation libaries.

I built a bunch of apps with JS navs and nobody ever complained...

Re: React Native at Airbnb

#44
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?

If you can use Expo you're probably good to go without much tooling.

Re: React Native at Airbnb

#45

Really curious as to how Flutter (and Xamarin, NativeScript, Ionic, Vue-based write-once frameworks, etc.) can overcome the difficulties expressed in this piece.

Me too. Last time I played with Ionic it was still mostly wrapped webviews though. And Vue-native is actually the worst. It transpiles Vue code into React Native code that then gets sent across the bridge to native apis.

Re: React Native at Airbnb

#46
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.

> Say what you like but this is a very mature move from a young engineering organization.

Airbnb is ten years old at this point, I'm not sure that really counts as young!

Re: React Native at Airbnb

#47
post #14
post #4

"Redux is notorious for its boilerplate and has a relatively difficult learning curve. We provided generators for some common templates but it was still one of the most challenging pieces and source of confusion while working with React Native." Interesting to see even Airbnb struggles with Redux

The cognitive overhead of redux ends up being pretty high due to the boilerplate in my opinion. It feels like complexity increases very linearly as project size goes. I've found that MobX translates to a much simpler mental model, though it does have a variety of quirks to deal with that Redux doesn't face (like converting objects to non-observable for test case assertions)

Yeah, MobX is significantly easier to reason about, even if it may have a few idiosyncrasies that make debugging more challenging. Also, performance optimization of React components is a cinch with MobX and a nightmare with Redux.

Re: React Native at Airbnb

#48
post #4

"Redux is notorious for its boilerplate and has a relatively difficult learning curve. We provided generators for some common templates but it was still one of the most challenging pieces and source of confusion while working with React Native." Interesting to see even Airbnb struggles with Redux

Having never worked with Redux, what is its point? Is it really so hard to stick app state in a JS object and databind off that?

Yes and no.

The main point of Redux is to make your state updates predictable and traceable throughout the codebase.

Sure, you can create a global object and stuff your data in there. But, if any random part of the app is allowed to modify that object at any time, then it's a lot harder to understand how your app got into a particular end situation.

Redux is based on the "Flux Architecture" concept, and asks you to follow restrictions on how you structure your logic. Only certain functions are allowed to update the state, and in order to run that logic, you create plain JS objects called "actions" that describe some event or update that needs to occur, and ask the update logic to determine the new state values in response.

This adds a level of indirection to your code, but it provides a way to log and trace when, where, why, and how a given piece of state got updated.

If you've got about 45 minutes, I did a "Redux Fundamentals" presentation at Reactathon a few months ago that walks through the basic principles of Redux. Here's a link to the video and the slides:

https://blog.isquaredsoftware.com/2018/03/presentation-react...

Re: React Native at Airbnb

#49
post #14

Earlier quoted context omitted.

The cognitive overhead of redux ends up being pretty high due to the boilerplate in my opinion. It feels like complexity increases very linearly as project size goes. I've found that MobX translates to a much simpler mental model, though it does have a variety of quirks to deal with that Redux doesn't face (like converting objects to non-observable for test case assertions)

Yeah, MobX is significantly easier to reason about, even if it may have a few idiosyncrasies that make debugging more challenging. Also, performance optimization of React components is a cinch with MobX and a nightmare with Redux.

Can you explain what you mean by "perf optimization is a nightmare with Redux" ? Generally, Redux helps improve performance in a React app, especially as you connect more components.

Re: React Native at Airbnb

#50

Really curious as to how Flutter (and Xamarin, NativeScript, Ionic, Vue-based write-once frameworks, etc.) can overcome the difficulties expressed in this piece.

At the risk of being flippant, few companies are building major consumer mobile apps like Airbnb (100 mobile devs is massive compared to the rest of the market), and many are building data-driven business apps. That, or they don’t have the history of native app dev so they don’t have existing native engineers or apps. So while most of the technologies mentioned above wouldn’t work for Airbnb, they work great for a huge chunk of the market. At Ionic we work with teams every day that are meeting their mobile goals with our tech, so we don’t live or die by what works for Airbnb or not.
Post reply on HN