The Neo.Main class currently manages three queues: readQueue, updateQueue, and writeQueue. Historically, writeQueue was intended for initial renders and updateQueue for subsequent updates.
Goal:
Simplify the architecture to a strict Read/Write model, aligning with standard DOM batching practices (like FastDOM).
Plan:
- Rename/Consolidate:
- Rename the current
updateQueue to writeQueue.
- Remove the old
writeQueue (and its associated logic).
- Effectively, all DOM modifications (inserts, updates, moves, removes) will now live in the
writeQueue.
- Refactor
Neo.Main:
- Update
renderFrame to process only readQueue and the new writeQueue.
- Update
queueUpdate -> queueWrite.
- Ensure
onRender (if it still exists/is used) and onUpdateVdom both feed into this single writeQueue.
- Remove
mode === 'update' logic.
- Refactor
processQueue:
- Handle operations based on their content/type if necessary, but primarily just delegate to
DeltaUpdates.
DeltaUpdates methods (update, insertNode) should be unified or handled generically. Actually, DeltaUpdates.update handles all delta types including insertNode (via action). So we might just need to call DeltaUpdates.update(operation) for everything in the write queue?
- Critical Check:
DeltaUpdates.insertNode expects a specific payload structure. DeltaUpdates.update expects { deltas: [...] }.
- If we unified
autoMount to send deltas (which we did in Manager.mjs), then everything coming from WorkerManager is now a delta update!
- So
processQueue can just call DeltaUpdates.update(operation).
Dependencies:
- This relies on the previous
Manager.mjs refactoring where autoMount was transformed into updateVdom with deltas.
The
Neo.Mainclass currently manages three queues:readQueue,updateQueue, andwriteQueue. Historically,writeQueuewas intended for initial renders andupdateQueuefor subsequent updates.Goal: Simplify the architecture to a strict Read/Write model, aligning with standard DOM batching practices (like FastDOM).
Plan:
updateQueuetowriteQueue.writeQueue(and its associated logic).writeQueue.Neo.Main:renderFrameto process onlyreadQueueand the newwriteQueue.queueUpdate->queueWrite.onRender(if it still exists/is used) andonUpdateVdomboth feed into this singlewriteQueue.mode === 'update'logic.processQueue:DeltaUpdates.DeltaUpdatesmethods (update,insertNode) should be unified or handled generically. Actually,DeltaUpdates.updatehandles all delta types includinginsertNode(via action). So we might just need to callDeltaUpdates.update(operation)for everything in the write queue?DeltaUpdates.insertNodeexpects a specific payload structure.DeltaUpdates.updateexpects{ deltas: [...] }.autoMountto send deltas (which we did inManager.mjs), then everything coming fromWorkerManageris now a delta update!processQueuecan just callDeltaUpdates.update(operation).Dependencies:
Manager.mjsrefactoring whereautoMountwas transformed intoupdateVdomwithdeltas.