phodal / microfrontends

Micro-frontend Architecture in Action-微前端的那些事儿

Home Page:https://microfrontends.cn/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

代码隔离要怎么做呢?

lili21 opened this issue · comments

commented

比如js的隔离(避免变量污染,全局变量被改)
css的隔离

js 隔离靠沙箱
css 主要靠规范

commented

沙箱有什么好的做法吗?需要考虑到哪些方面?

用Proxy做?

commented

不考虑兼容性的话,我能想到的是用Proxy去做,

with (proxy) {
// 运行子应用
}

commented

看了下,还是用eval做的。我的想法是基于webpack5的module federation去实现