
Building a JavaScript Framework (and Failing Twice at Reactivity)
About five years ago, I didn't set out to build a framework I'd use in production. I just wanted to understand them. I had already written parsers and interpreters before, so I knew the mechanics: tokenization, ASTs, execution. But frameworks felt different. They weren't just about parsing code; they were about state, updates, and keeping the UI in sync. Reactivity was the part I didn't understand. So I decided to build one from scratch. I started with the pieces I knew: a scanner, a parser, a JavaScript interpreter, and an HTML template parser. After a while, I had a working system: a small component model and a template engine that could render real views. It looked like a framework. But it was missing the one thing that actually makes a framework feel alive: reactivity. <template> <h1> {{count.value}} </h1> <div class= "actions" > <button @ on:click= "count -= 1" > - </button> <button @ on:click= "count += 1" > + </button> </div> </template> <script> import { signal , Component } fr
Continue reading on Dev.to JavaScript
Opens in a new tab



