Show HN: Butterfloat 1.0: Knockout-inspired web view engine with RxJS and TSX
2 by WorldMaker | 0 comments on Hacker News.
There are never enough web frameworks right? I wanted to explore a different fork in the road from an old classic, Knockout, but in a modern context with modern tools. We’re in a very ko.computed-inspired web today: Signals, Runes, Zones, and more. Most modern web view engines use some versions of these things to try to dependency track imperative-looking code. I felt like the missing path from that fork in the road was the rest of Knockout: a binding language focused on orchestrating lots of little observables. Because it is using TSX as its compile time the Developer Experience looks a lot like modern React with hooks. It’s simpler: it’s not a Virtual DOM so components never “re-render”. Just KO some observable bindings. If you squint there’s a thing that looks like useState and one that looks like useEffect, but one is just RxJS observables and the other is a parameter to the component, there’s very little hidden state and it all should be easier to reason about than modern React. At the very least, it should be easier to unit test components. There are other advanced scheduling features inspired by modern React. Like classic React it is just trying to be a view engine with none of the rest of a framework. But it also doesn’t lose sight of the Knockout inspiration. I upgraded two old Knockout projects of mine, which was part of why I got the build a view engine itch. The Knockout view models got a little more verbose but still greatly resemble their Knockout selves. The views in TSX have a bit more differences from the HTML files they replaced, but the bind language also looks like a clear relative and I think a time traveler from the Knockout era wouldn’t be too confused looking at the codebase today.
2 by WorldMaker | 0 comments on Hacker News.
There are never enough web frameworks right? I wanted to explore a different fork in the road from an old classic, Knockout, but in a modern context with modern tools. We’re in a very ko.computed-inspired web today: Signals, Runes, Zones, and more. Most modern web view engines use some versions of these things to try to dependency track imperative-looking code. I felt like the missing path from that fork in the road was the rest of Knockout: a binding language focused on orchestrating lots of little observables. Because it is using TSX as its compile time the Developer Experience looks a lot like modern React with hooks. It’s simpler: it’s not a Virtual DOM so components never “re-render”. Just KO some observable bindings. If you squint there’s a thing that looks like useState and one that looks like useEffect, but one is just RxJS observables and the other is a parameter to the component, there’s very little hidden state and it all should be easier to reason about than modern React. At the very least, it should be easier to unit test components. There are other advanced scheduling features inspired by modern React. Like classic React it is just trying to be a view engine with none of the rest of a framework. But it also doesn’t lose sight of the Knockout inspiration. I upgraded two old Knockout projects of mine, which was part of why I got the build a view engine itch. The Knockout view models got a little more verbose but still greatly resemble their Knockout selves. The views in TSX have a bit more differences from the HTML files they replaced, but the bind language also looks like a clear relative and I think a time traveler from the Knockout era wouldn’t be too confused looking at the codebase today.