We are unifying the manual DOM update path (App.applyDeltas) with the VDOM update path to ensure consistent behavior and delayed replies (synced with requestAnimationFrame).
Plan:
src/worker/App.mjs:
- Update
applyDeltas to send action: 'updateVdom' instead of 'updateDom'.
src/worker/Manager.mjs:
- In
onWorkerMessage, add a handler for action === 'updateVdom'.
- This handler will:
- Fire the
updateVdom event.
- Register a promise for the message
id.
- Define the promise resolution to send a
reply back to the origin worker.
- This mirrors the existing interception logic for VDOM replies but handles direct requests.
src/Main.mjs:
- Remove
onUpdateDom and the listener for 'message:updateDom'.
- Use the existing
onUpdateVdom (no windowId check is needed as routing is handled by the worker infrastructure).
src/main/DeltaUpdates.mjs:
- Remove the
Neo.worker.Manager.sendMessage (reply) call. The reply responsibility is fully shifted to Main (via processQueue -> resolveDomOperationPromise) resolving the promise managed by Manager.
This changes removes the redundant onUpdateDom path and ensures App.applyDeltas benefits from the same rAF synchronization as VDOM updates.
We are unifying the manual DOM update path (
App.applyDeltas) with the VDOM update path to ensure consistent behavior and delayed replies (synced withrequestAnimationFrame).Plan:
src/worker/App.mjs:applyDeltasto sendaction: 'updateVdom'instead of'updateDom'.src/worker/Manager.mjs:onWorkerMessage, add a handler foraction === 'updateVdom'.updateVdomevent.id.replyback to the origin worker.src/Main.mjs:onUpdateDomand the listener for'message:updateDom'.onUpdateVdom(nowindowIdcheck is needed as routing is handled by the worker infrastructure).src/main/DeltaUpdates.mjs:Neo.worker.Manager.sendMessage(reply) call. The reply responsibility is fully shifted toMain(viaprocessQueue->resolveDomOperationPromise) resolving the promise managed byManager.This changes removes the redundant
onUpdateDompath and ensuresApp.applyDeltasbenefits from the same rAF synchronization as VDOM updates.