Code isolation #3593
-
Hello! I have a goal: show modal window (with some custom logic) on any page via browser extension. I click extension button - modal window with business logic injected into the page and displayed its content. Here I have a potential problem: how to isolate JS logic to avoid any interfering with other code on the page? I investigated following:
I heard that ES6 modules can help me somehow, but TBH I didn't understood how. Do preact offers some way, how to build an isolated module/micro-frontend to avoid any possible clashes with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
As long as that bundle leverages its own individual instance of Preact it will be isolated, so inlining it into the relevant module should do the trick |
Beta Was this translation helpful? Give feedback.
As long as that bundle leverages its own individual instance of Preact it will be isolated, so inlining it into the relevant module should do the trick