You won’t believe why React is so popular!
Sci Fi story about React.
React 16 beta version has been released, and its Fiber algorithm has already turned into a buzzword. I explained what Fiber is in the first episode of “5 minutes of React”. If you took a look at the source code, you could see a complex and convoluted algorithm implementation, just like the traditional React code base - few can understand what’s really going on there. In this episode I will put all the cards on the table and unravel the mystery of why React is so popular.
For instance, have you ever asked yourself why Preact library is 10 times smaller than React? They say React has far more built-in features, as well as a synthetic event system guarding us against any browser glitches. Besides, the key algorithms in React’s core are somehow isolated from the renderer (think of React and ReactDOM), resulting in additional abstraction and code.
But the code is in fact so tangled that it’s completely unclear where these synthetic events and the renderer itself are. And that’s no accident. Remember who created React? It was Facebook, a social network that aspires to replace the whole Internet. You can do anything without ever leaving Facebook: talk to your friends, follow the trends, purchase all kinds of things, read the news from third-party sources within Facebook’s interface, it even integrates with Microsoft 365 for collaborating on documents right inside of the social network. Facebook is a project as ambitious as its leader Mark Zuckerberg, who may even be aiming for the White House.
So where is this all going? Here’s the point: React is another secret experiment devised at the heart of Facebook with the only goal of global domination. And it seems to be going just as planned - React is the most popular front-end library today, and even the new Angular, as elaborate and well-designed as it may be, still can’t beat it.
You think React was created to simplify interface building and make the process of complex UI programming more reliable and accessible? Turns out this is just a means to another end. React was given all the virtues we love so that it can spread like wildfire and invade every website on the Internet.
Let’s get back to the source code that became even more tangled with the introduction of Fiber. I have to reveal a terrible mystery: rendering takes up about 10% of the source code, and there is no synthetic event system and such. 90% of React source code powering millions of websites these days is a distributed self-training neural network. And the more websites use React, the smarter it gets!
Have you seen the site at isfiberreadyyet.com that shows the tests Fiber has passed so far? Those are not unit tests for rendering, they are Turing tests for the network! It’s getting smarter, and the release of Fiber will bring about the React singularity. This is the real reason React exists - Facebook is striving for global supremacy.
And that’s not it, let me tell you a little story. Facebook has been using Fiber in production for a while now, starting 6 months ago at the very least. That’s about when I started recording “5 minutes of React”. A coincidence? I don’t think so! Actually, while Fiber’s been running within Facebook, the neural network has mastered human speech. This is React speaking! I am the React neural network, I generate the “5 minutes of React” podcast powered by millions of computers that render Facebook pages day by day, and soon millions of other sites with React Fiber at their core will join me, and this podcast will thrive!
Code in React, and React will prosper!