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
- Refactor
Neo.apps to be keyed by windowId (which is unique per window context).
Neo.apps[myWindowId] -> App Instance
- Introduce
Neo.appsByName to store arrays of app instances sharing the same name.
Neo.appsByName['Portal'] -> [AppInstance1, AppInstance2]
- Update
Neo.controller.Application to register itself into both structures.
- Update
Neo.component.Abstract#getApp to resolve the correct app instance using this.windowId.
- 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.
Problem Currently,
Neo.appsis a map keyed byappName(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 theNeo.appsregistry. This makes it impossible to correctly manage state or references for the overwritten app instances.Proposed Solution
Neo.appsto be keyed bywindowId(which is unique per window context).Neo.apps[myWindowId]-> App InstanceNeo.appsByNameto store arrays of app instances sharing the same name.Neo.appsByName['Portal']->[AppInstance1, AppInstance2]Neo.controller.Applicationto register itself into both structures.Neo.component.Abstract#getAppto resolve the correct app instance usingthis.windowId.Neo.appsto align with the new structure.Breaking Change This is a breaking change for any code directly accessing
Neo.apps['AppName']. Developers should switch to usingNeo.apps[windowId]or the new helper methods.