React Native's Near Death Experience [Christopher Chedeau]
Download MP3The fate of React Native hung in the balance. One man's brave decision changed an industry forever.
Listen to the Sourcegraph podcast: https://about.sourcegraph.com/podcast/christopher-chedeau/ (~28mins in)
Lessons learned:
Lessons learned:
- Hackathon is important for intrapreneurship
- Near Death moment requires leap of faith
- Solve People Problems with Technology, not just technology problems
Transcript
[00:00:00] swyx: I'm continuing my exploration of how technologies get adopted. And recently there was a really good interview of Christopher shadow by Beyang Liu on the source graph podcast. So I really had to feature it. this tells the story of the invention and adoption of react native internally within Facebook. And the context to this is.
[00:00:21] Facebook had a problem with the iteration speed of mobile apps at Facebook, and they were much slower than web apps. So basically the context before this conversation is that mark Zuckerberg had actually set an engineering priority to fix the solution and the engineers have to figure it out.
[00:00:36] Christopher Chedeau: One of those things that John had in mind, Can we embed JavaScript in a iOS app. And so at that point, we actually there was no API for this and they're going to do it, but like you found a way to cross compare something and he was able to do it. And you, you want it to be like, okay, can we run, react and power, like native iOS views out of react instead of like dibs and spans, you can like a UI label and a UI views.
[00:01:03] And. And so this is like at Facebook there's hackathons. And so in the summer does a three day hackathon. And we basically like Ashwin Lynn that's where on my team, on the photos team. And Joanne, we hacked together off for three days working on this like raw using react to power, like native use.
[00:01:25] And at the end of the three days, we had a demo where we are able to show his view and we had a primitive layout system. And. I have the texts it's on the right and the iOS, the rep on the left and basically moved the line like a before and after and a native, iOS, like button. And I bought to move the, like better from the left to the right.
[00:01:49] And we were able to click on it. Now, the lights like actually like walks and we're able to like, do. Changing and saving would be like almost entirely. I think it was a hundred milliseconds, a refresh. So it was barely perspective perceptible and we presented to the like hackathon group, like all the, did some callbacks could go.
[00:02:11] And what happened is the five project, like most interesting have an audience with Mark Zuckerberg. And so you went to present this hack to Mark Zuckerberg and there was a SRAP, the CTO of the company as well, like in this? Yes. Yeah. And wasn't for this. Yeah. And both of them were like, we're super excited.
[00:02:32] And what happened the next week is we basically did like a wall tour of Facebook and we talked to all of the management chain, . And it was like a super, like a fun thing. But now the thing that happened then is okay, so we did this demo, there was like people liking it and everything, but now for like myself as an engineer, like I joined like Facebook, like less than a year ago.
[00:02:54] And I moved like my, like myself, I married my wife. I like, this was like a huge like thing. We moved off way across the world. So now it was like a soul searching moment. Do I want to like bets, like this dream, like on a crazy idea that and I was like, like at that time I was like the answer was No.
[00:03:18] And so what happened is like a Lena Nash Ashwin basically went and B up like a, they wanted to do an iOS photo up and they built it using what was react iOS at the time. And three months after they basically came back to us and said Hey look like we really want to build like the iOS photo app.
[00:03:37] Yeah. And right now we're spending more time building this react iOS thing than actually building the products. And so we're going to restart the product like in a normal iOS. So we can actually walk on it. The project could die. All the project could live and I need to make a call. Do I want to invest in?
[00:03:58] And so I did a lot of soul searching and I basically at that point I was like, okay, I think I need to do it. And so, Tom Occhino was the manager of a Joel at the time. And Joel Dan and myself okay, now we like basically creating a small team. And then she came in after this. And this is how like the program.
[00:04:17] But this was like not an easy, like a decision to make. And this is like something, a lot of people don't realize it counting products and like they're super high risk Harry, well, for decks, but most of the projects actually fail. This is a startup. Like most of us, not the film and the fact that I'm like here talking to you, like all of the stars align and everything, like it's good work, but this was not a given at the time.
[00:04:40] Beyang Liu: You took a risk and it paid off. And I think especially it was a big risk in Facebook at the time. Cause my understanding is that they had already tried to build an initial version of the mobile application using web technologies. That was like the first attempt.
[00:04:54] And then it wasn't like performant enough for the user experience. Wasn't good. So they ended up rebuilding it in, native iOS and Android. So there must have been like probably some amount of institutional resistance. Right. . Have another go at a web based or web inspired technology, right?
[00:05:11] Christopher Chedeau: Yeah. Yeah. This was like a very interesting time. And like one of the things that's also I don't know if it's true today, but like when I like joined Facebook and even at school, there was this notion of if you're doing web, you're not a real engineer. If you're doing like a channel or like network or native, like you're real engineer.
[00:05:31] Yeah. And so there was this like super interesting notion where we are coming from a web background. And so when you have all of these preconceived notions, Whatever we'll doing is not going to be a real engineering. And we're like, scripted is, and let's do this. And this is like very interesting.
[00:05:52] The other thing which has been super interesting is there's also a very big difference between the iOS community and general. Hmm. And so, the what's super interesting is iOS community is like apple, like plays a central role. And basically there's like this notion that like everything that apple does is the right way, and this is the way things should go.
[00:06:16] And there's a very angry notion of this. And so now if you're basically come in, like we're doing something different when apple guideline, there's a lot of reasons. Yeah. And so this is in practice it has works well because like apple in practice, the software that they produce and like the libraries and everything, I actually really good in practice.
[00:06:36] So that's reasonable. But it's been like one of the very interesting thing about trying to convince people the, on the other side for Android, which was super interesting is Android, like the state of the development at the time was like very fragmented. There's 20 different of Android and everything is hiking and like the quality of the framework and the fraud, was not as good.
[00:06:57] And so basically like 400, like people were a lot more like welcoming to the idea, but the challenge there was. The actual devices were like, really, really was like for iOS, like the iPhone is actually like super powerful on Android. There was like really bad phones. And so now like a, the channel was like, oh, do you have the JavaScript runtime on top of it and everything.
[00:07:20] So it was a lot more challenging to actually get it to work well. And so it was super interesting, like how, like one place was more about like the. The like people mindset and everything and the other, one's more about like the actual techno like technology called shysters and that's well, challenges for like working on this.
[00:07:40] And one thing that we found is that in practice, like a lot of the people working on react native, I've been people like coming from a web. Yeah. And the thing is we have been hiring a lot, but it's still like how that via an iOS and Android engineers and women employee as more of them.
[00:07:58] And so we've been able to like bootstrap and say, I found them there, our team using react native through like the. And all the channels were starting to hire like dedicated native engineers. They were able to like get funded through like web development. And so it's also like a, an interesting thing.
[00:08:18] Beyang Liu: Yeah, that's a neat I guess developer team growth hack is a using a technology that allows people from a much wider pool to, to come work on, on the product. I I'm curious, you mentioned all these challenges with getting started in both iOS and Android, partly psychological, partly technical.
[00:08:37] What was the first project or first major project that the react native team targeted inside Facebook as a focal point.
[00:08:45] Christopher Chedeau: So the first one was Instagram. They had a list of all of the photos you've liked. Oh, your favorite regions. And this view like was super small and would have like being our entry point into getting Instagram.
[00:08:59] And so one of the challenge with this is like the, the, the mission is like, the feature was not big enough to justify like the investment and adding like a whole like JavaScript run time and this kind of things. And so. We were not able to like, actually succeed there. And I, in interest respect, like I think you need to start to find like something small enough, but something like significant enough that they actually solves a real problem.
[00:09:27] Fall the company. And I don't think we really judged like the right balance. And so this is four counts. The thing that actually worked out and like the first one was ads manager. And so we were building like a ads, like app for managing your ads on the phone. Yeah. One of the thing is like the team had a really hard time hiring native engineers to actually build this and this first time on the app.
[00:09:53] And so this felt like the perfect opportunity for us to actually get like a team. And most of that same like ads is like the most complicated, like piece of a JavaScript software. And so, there was a lot of really good. From an engineer's like JavaScript expelled, like in the ads organization, they were able to bootstrap the asthma job product.
[00:10:15] And we were able to walk with them. And so this was like the first big app that was shipped, using react native. And to this day, it's still using right there live and like it's been super successful.
[00:10:28] Christopher Chedeau: one of the biggest thing you're using react native is actually marketplace.
[00:10:33] And so this is a yeah, one of the big success stories. And one of the reason why they have been able to be successful as they've been able to iterate like super quickly and like figure out like what works, what doesn't work and like being able to yeah, to move faster on like with true native development.
[00:10:53] And marketplace, I think these days it's like one of the largest online marketplaces where like goods are bought and sold anywhere. I think I I've certainly bought like a ton of stuff on marketplace and have as well. So thanks for that. That's a, that was like more than 1 billion people using marketplace every month.
[00:11:14] swyx: So that is the react native story, which I don't expect to be very representative or applicable to a lot of other situations, but I think it's still notable and it still has a lot of impact and there's still some other lessons to learn from it. So the first lesson is that it's a case of entrepreneurship.
[00:11:30] It started because of a hackathon because mark Zuckerberg had some overall objectives, but didn't really prescribe this solutions. And I think hackathons and giving people space like a three-day hackathon is actually a pretty significant engineering investment, but giving people space to come up with solutions that they've always wanted to work on, I think gives you a lot of these breakthrough ideas that would just never have come up in a regular cycle or a sprint or whatever you call it.
[00:11:54] And the second point that I really learned about is deciding to bet on react native that react native had a near death experience because they tried it out on Facebook photo app, and it was just too unproductive and they could have just died if Christopher did not decide to invest more time in it. And I think you always need these.
[00:12:12] At critical moments, people to just decide that this investment is worth it, that this technology is worth it. Um, Before you get much traction because it's just not in a usable state. And finally, I think the reflection that I have is that react native solve the people problem. And solving people problems actually often solves the technology problem or beats the technology problem. Uh, Innocence that web engineers are much easier to hire than native engineers and web development cycles are much faster than native development cycles it may be inferior in all other respects but if you just win on those two things you win the technology