We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
CONSOLE_OS_GLOBAL_HOOK _CONSOLE_OS_GLOBAL_VARS ……等 这些全局变量似乎还增加了维护的复杂程度
Sorry, something went wrong.
目前微前端大家的思路都是在项目入口导出几个方法用来挂载 & 卸载子应用。 但是实现思路各自各有不同
飞冰的思路是把子应用导出的方法,直接挂载到 window 的 变量里面,然后去使用子应用的导出的生命周期函数。然后如果想使用沙箱,必须通过 xhr 把脚本请求回来然后再去 new Function 的执行
在 Alfa 中 有 CONSOLE_OS_GLOBAL_HOOK,_CONSOLE_OS_GLOBAL_VARS 这几个变量是为了通过在沙箱开启的情况下还能以 script 的方式加载子应用,并且通过类似 amd 的方式 通过模块系统获取函数的导出。
在我们实践中发现 xhr + new Function 十分损耗内存,对在应用变多的情况下体验十分糟糕。我们这样的好处是,script 加载天然是被浏览器优化的,所以性能上肯定没有问题
对于代码复杂度高的原因是我们在里面提供了非常多的高级特性比如:
@Boelroy 那在兼容性方面呢,目前在官档没找到对应说明,尝试了下demo是无法运行的,已经做了polyfill
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: