4 ms·
I recently did this because none of them are exactly what I wanted. I really like the idea of reactive proxies and pushing changes. Things get trickier when y
by recursive 3y ago
I recently did this because none of them are exactly what I wanted. I really like the idea of reactive proxies and pushing changes. Things get trickier when you try to address mutable arrays and other scenarios.
The one I made is https://mutraction.dev/ https://mutraction.dev/ The name is a portmanteau of mutation tracking.
- notnullorvoid 3y agoFor arrays, did you end up taking the diffing/memoization approach like solid? I've yet to see any framework have O(1) collection mutation reactivity.
- recursive 3y agoThere's no diff. Arrays get proxies just like everything else. For mutations that change the length, extra elements are built or removed at the end. Assignment straight to an index (that doesn't change length) is able to use normal object property semantics. arr.push(e) and arr[i] = e are both O(1). But not all array operations achieve this.
- notnullorvoid 3y agoWow, took a look at the ForEach code to better understand. That's a very novel approach.
- recursive 3y agoI'm not too familiar with the state of the art, but I assumed this had been done before. I have some vague ideas about implementing efficient .splice() calls. Right now knowledge about splicing semantics is lost in between the proxy layer and `ForEach` DOM node array. But I have a bunch of other plans to do first.