LearnNewsExamplesServices
Frontmatter
id8124
titleUnified Delayed DOM Update Strategy
stateClosed
labels
bugairefactoringarchitecture
assigneestobiu
createdAtDec 16, 2025, 6:48 PM
updatedAtDec 16, 2025, 7:30 PM
githubUrlhttps://github.com/neomjs/neo/issues/8124
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtDec 16, 2025, 7:11 PM

Unified Delayed DOM Update Strategy

Closed v11.17.0 bugairefactoringarchitecture
tobiu
tobiu commented on Dec 16, 2025, 6:48 PM

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:

  1. src/worker/App.mjs:

    • Update applyDeltas to send action: 'updateVdom' instead of 'updateDom'.
  2. 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.
  3. 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).
  4. 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.

tobiu added the bug label on Dec 16, 2025, 6:48 PM
tobiu added the refactoring label on Dec 16, 2025, 6:48 PM
tobiu added the architecture label on Dec 16, 2025, 6:48 PM
tobiu assigned to @tobiu on Dec 16, 2025, 7:07 PM
tobiu referenced in commit b20ec53 - "Unified Delayed DOM Update Strategy #8124" on Dec 16, 2025, 7:11 PM
tobiu closed this issue on Dec 16, 2025, 7:11 PM
tobiu added the ai label on Dec 16, 2025, 7:30 PM