LearnNewsExamplesServices
Frontmatter
id7822
titleRefactor Neo.applyDeltas to use windowId instead of appName
stateClosed
labels
enhancementai
assigneestobiu
createdAtNov 20, 2025, 12:45 PM
updatedAtNov 20, 2025, 2:09 PM
githubUrlhttps://github.com/neomjs/neo/issues/7822
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 20, 2025, 2:09 PM

Refactor Neo.applyDeltas to use windowId instead of appName

Closed v11.7.0 enhancementai
tobiu
tobiu commented on Nov 20, 2025, 12:45 PM

Goal: Refactor Neo.applyDeltas(appName, deltas) to Neo.applyDeltas(windowId, deltas) to support multi-window applications correctly.

Context: Currently, applyDeltas relies on appName to route DOM update messages. In multi-window scenarios where multiple windows share the same appName, this ambiguity prevents targeting specific windows for DOM updates. Switching to windowId (which is unique per window) resolves this.

Required Changes:

  1. Update src/worker/App.mjs:

    • Change applyDeltas(appName, deltas) signature to applyDeltas(windowId, deltas).
    • Update the message payload to send windowId instead of appName.
  2. Update Usages:

    • Identify all call sites of Neo.applyDeltas and update them to pass windowId.
    • Key locations identified include:
      • src/plugin/Responsive.mjs (already partially addressed in previous steps, verify usage)
      • src/grid/Body.mjs
      • src/selection/HelixModel.mjs
      • src/selection/GalleryModel.mjs
      • src/table/Body.mjs
      • src/dialog/Base.mjs
      • src/plugin/Resizable.mjs
      • src/component/Helix.mjs
      • src/component/Base.mjs
      • src/mixin/VdomLifecycle.mjs
      • src/calendar/view/month/Component.mjs
      • src/calendar/view/week/EventDragZone.mjs
      • src/calendar/view/week/Component.mjs
      • src/calendar/view/week/plugin/DragDrop.mjs
  3. Update Main Thread Handling:

    • Update src/Main.mjs (onUpdateDom) to handle the incoming windowId.
    • Update src/main/DeltaUpdates.mjs to use windowId for targeting the correct document/window context.

Notes:

  • This is a breaking change for custom components or plugins that use Neo.applyDeltas directly.
  • Ensure backward compatibility or migration paths if necessary (though internal framework usage seems to be the primary consumer).
tobiu assigned to @tobiu on Nov 20, 2025, 12:45 PM
tobiu added the enhancement label on Nov 20, 2025, 12:45 PM
tobiu added the ai label on Nov 20, 2025, 12:45 PM
tobiu referenced in commit d938638 - "Refactor Neo.applyDeltas to use windowId instead of appName #7822" on Nov 20, 2025, 1:13 PM
tobiu referenced in commit 60cf3c2 - "#7822 adjusted the testing suite to match the refactoring" on Nov 20, 2025, 2:09 PM
tobiu closed this issue on Nov 20, 2025, 2:09 PM