LearnNewsExamplesServices
Frontmatter
id7820
titleRefactor Neo.apps to support multi-window instances
stateClosed
labels
enhancementai
assigneestobiu
createdAtNov 20, 2025, 11:45 AM
updatedAtNov 20, 2025, 12:38 PM
githubUrlhttps://github.com/neomjs/neo/issues/7820
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtNov 20, 2025, 12:38 PM

Refactor Neo.apps to support multi-window instances

Closed v11.7.0 enhancementai
tobiu
tobiu commented on Nov 20, 2025, 11:45 AM

Problem Currently, Neo.apps is a map keyed by appName (e.g. Neo.apps['Portal']). If multiple instances of the same app (same name) run in different windows but share the same App worker (SharedWorker context), the new instance overwrites the previous one in the Neo.apps registry. This makes it impossible to correctly manage state or references for the overwritten app instances.

Proposed Solution

  1. Refactor Neo.apps to be keyed by windowId (which is unique per window context).
    • Neo.apps[myWindowId] -> App Instance
  2. Introduce Neo.appsByName to store arrays of app instances sharing the same name.
    • Neo.appsByName['Portal'] -> [AppInstance1, AppInstance2]
  3. Update Neo.controller.Application to register itself into both structures.
  4. Update Neo.component.Abstract#getApp to resolve the correct app instance using this.windowId.
  5. Update internal framework usages of Neo.apps to align with the new structure.

Breaking Change This is a breaking change for any code directly accessing Neo.apps['AppName']. Developers should switch to using Neo.apps[windowId] or the new helper methods.

tobiu assigned to @tobiu on Nov 20, 2025, 11:45 AM
tobiu added the enhancement label on Nov 20, 2025, 11:45 AM
tobiu added the ai label on Nov 20, 2025, 11:45 AM
tobiu referenced in commit a6d5582 - "Refactor Neo.apps to support multi-window instances #7820" on Nov 20, 2025, 12:23 PM
tobiu referenced in commit 136e6f7 - "#7820 additional items" on Nov 20, 2025, 12:38 PM
tobiu closed this issue on Nov 20, 2025, 12:38 PM