React.js almost didn't go open-source back in 2013
Intro
I've recently watched the React.js documentary by?Honeypot.io. Kudos for the immersive storytelling. It was fascinating to watch ??
The documentary is quite long, so in case you don't have the time to watch here's the summary.
Early days
Jordan Walke, a then-Facebook engineer, started React.js as a small project to help build complex UIs more simply.
Adding and removing event listeners like mouse clicks was a huge source of bugs on Facebook at the time.
Facebook had an internal framework called Bolt.js. It was very similar to Backbone.js and Angular.js. It also utilized the Model View Controller design pattern and event binding.
Bolt.js helped abstract event listeners, but the code written in it was still hard to maintain because the concept of 'state', which we are familiar with today, still needed to be invented.
Jordan proposed a completely different approach to building front-end apps by updating the old version of DOM (what the user sees on the page) with the new one every time a user interacts with the app.
Testing React.js inside Facebook and Instagram
This innovation allowed developers to write much more human-like code, which was easier to maintain because they could focus purely on the business logic and not worry about event handling or binding.
Facebook had an internal debate about writing the Facebook Ad Manager feature in React.js. It was critical to the business, and React.js was tested only in small demos up to that point.
After evaluating the performance and maintainability of both React and Bolt.js, they decided to take the risk and go with React.js.
The Facebook Ad Manager ads feature was a success. Developing it allowed the team to resolve many bugs and edge cases in React.
React.js's second baptism by fire came when a small team using it could write the full web version of Instagram in 2012, saving loads of time.
Going public (spoiler: didn't go as planned!)
By 2013 React.js was ready for the public. Facebook wanted to open-source this project from the beginning, and after thorough preparation and testing, the React.js core team decided it was time to do so.
领英推荐
React.js core team announced the project being open-source in JsConf, the so-called "Oscars of JavaScript."
This announcement is where the story takes an unexpected turn. The public reaction to React.js was that of confusion, mockery and rejection.?
Writing HTML inside JavaScript seemed outrageous as it violated the then status quo of having separation of concerns over the application's styling (CSS), interactive logic (JavaScript) and semantic layout (HTML).
React.js offers an alternative way of thinking about the separation of concerns where you think more about the business case and feature you're building than the code required to create it.
The React.js core team was so demoralized that it started considering if making the framework open-source was a good idea. After years of fighting opposing opinions inside Facebook, they had to do the same in public.
Gradual adoption
However, instead of giving up, the React.js core team kept convincing one person at a time. One such person was Khan Academy's lead developer Sophie Alpert.
Sophie found that using this small library called React.js saved her a lot of time when developing complex UI parts like calculators and graphs for Khan Academy. She became the most significant individual contributor for React.js only a short time after that.
Gradually the word about React.js started spreading (this time, a more positive one). The first large company to adapt it was Netflix. The clean and immersive interface we're used to when watching Netflix was built using React.
The new UI of Netflix was groundbreaking back then, and more and more companies started using React.js. Today, it's a go-to tool for building complex user interfaces for most projects in many companies.
Summary
The documentary was fascinating because I had no idea that React.js was an underdog. I always assumed that since Facebook backed it (now Meta), it was always popular, so learning about its story and ups and downs was fascinating!
You can watch the full documentary on YouTube here: