Skip to content

Runtime Instance shared by more than one App eg in different Tabs #15

Description

@pchainho

Summary made by @antonroman from reTHINK-project/dev-runtime-core#111

To summarize, we should focus on three possible solutions to check which of them meets more reTHINK requirements.

  1. intertab communication using localStorage: This solution has been discussed in How to use a reTHINK runtime deployed in a different tab core-framework#137 it could work but it has several drawbacks: reTHINKS iframes need to be loaded from the same domain (one of this iFrames wouldn't load the whole runtime but would interact with the runtime loaded in the other tab).
  2. intertab communication using sharedWorker: SharedWorkers are defined here: https://developer.mozilla.org/en-US/docs/Web/API/SharedWorker They are supported both from Chrome and Firefox. The solution sound more natural than the localStorage-based. Maybe the runtime should have always a sharedWorker, if another sharedWorker is detected then it should communicate with it ti use its runtime instead of deploying the rest of files of the core-runtime. Any feedback is welcome.
  3. intertab communication using channel messaging: in the doc(https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API/Using_channel_messaging) it claims to be able to communicate two documents via a SharedWorker so it sounds as a higher abstraction layer to use sharedworkers but it seems that it should be possible to do what we need.

This should not be needed for NodeJS, since there should be a one to one relationship between NodeJS instances and App instances.

See reTHINK-project/core-framework#137 to keep discussing the localStorage approach and discuss sharedWorkers and Channel API in this issue.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions