Issue
Do multiple apps embeded on 3rd party site share one store instance?
As crazy as it sounds this is my current suspect.
Our client is embedding several our apps into their website. I've managed to replicated on small demo https://vocavet-git-feature-vercel-georgeknap.vercel.app/ or in stackblitz: https://stackblitz.com/edit/stackblitz-starters-7k9afz?file=src%2Fmain.ts
All embedded frames are different URLs leading to data visualization page - one view per one solar power plant.
Data for the chart is stored in NgRx store. Every time I refresh that page I get different views which feels like there is race condition in which all ebbeded apps are pushing into one ngrx store instead of having their own stores.
Is that possible? Am I understanding it correctly?
Solution
Technically it is possible to share the data and technically it is possible to isolate each module. To know exactly what is going on under the hood we would need to inspect the code of your app and modules. Here is a similar story, I believe it might help you in your investigation. Also if you want to prove that store is shared or not shared, you can simply install Redux plugin in Chrome/FF/Edge and inspect the state by yourself. Shouldn't take more than 10 minutes of your time.
UPDATE:
I checked the website you provided. Notice how executed actions are overwritten. I don't know what you or your client tried to achieve but in my opinion this app was not implemented correctly.
UPDATE 20.10.23
Here is a screenshot that shows that all Angular apps (from same domain!!!) opened in IFrames within same page run in a shared memory region (JS VM):
IMPORTANT NOTE: so far I remember, this is not guaranteed behavior. It depends on specific browser implementation.
Answered By - Volodymyr Usarskyy
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.