This is the companion repo to a talk I gave at MURAL called
Reinventing the will (to code) React
.
This talk was a brief intro to DOM and virtual DOM, followed by a frenzy of code where I tried to code a working (and much simplified) React clone in under one hour.
While this is the code I used for the talk, in this repo I'm trying to make things a bit more interesting by presenting you a series of code challenges. For each challenge you can always skip ahead and check my code.
Some boring stuff follows, feel free to skip to Getting started.
We are doing this just for fun, whatever solution we reach will probably be worse than actual React, Vue, or other stuff. And even if we reach a brilliant piece of code, those mainstream projects have community, maintainers, etc.
I guess what I'm trying to say is: don't use this in production!.
Also, I make no claim that this code has any resemblance to React at all. All we are doing here is, given somewhat similar functional requirements, exploring what we would've done, why and what challenges we'd have to face.
I find that trying to build something yourself gives you a unique understanding of the problems you are facing and the (possible) mechanics of the library you are using. In general, this exercise might give us a more refined mental model of the workings of a virtual dom library such as React.
You can read everything directly from here but if you want to follow along, I suggest you clone this repo:
git clone https://github.com/pzavolinsky/rtw-react.git
Then start the journey.
I hope you enjoy this!