Multi Browser Window Apps
youtube.com
youtube.com
Please do not confuse this with multi page apps. It is like a SPA, where multiple browser windows can connect to a shared app worker.
``` onAppConnect(name) { let me = this, view;
console.log('onAppConnect', name);
switch (name) {
case 'Covid2':
view = me.getReference('controls-panel');
Neo.getComponent(view.parentId).remove(view, false);
Neo.apps[name].on('render', () => {
setTimeout(() => {
Neo.apps[name].mainViewInstance.add(view);
}, 100);
});
}
}
```You will be able to move entire component tress into different windows. Without even needing to create new JS instances. As easy as this.
EDIT: I don't really get the demo app. How do you open a new window with it?
The version inside the video is not deployed to the online examples yet (will add it once ready). You can just clone the neomjs/neo repo and try it locally if you like to.
What I did was opening: https://github.com/neomjs/neo/tree/dev/apps/sharedcovid (index.html)
inside a first browser window and then opening: https://github.com/neomjs/neo/tree/dev/apps/sharedcovid2
inside the second window.
we could spawn new popup windows as well.
working on the dom event support next, after moving components around. it might be an easy fix just adjusting the appName config of the moved cmp tree, otherwise i need to look into the postMessages routing.
gutt feeling: 2-3 more days.