Skip to content
New issue

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

微前端 #88

Open
zhangyanan0525 opened this issue Jul 22, 2021 · 0 comments
Open

微前端 #88

zhangyanan0525 opened this issue Jul 22, 2021 · 0 comments

Comments

@zhangyanan0525
Copy link
Owner

zhangyanan0525 commented Jul 22, 2021

好处

  1. 增量升级(Incremental upgrades)
  2. 简单、解耦的代码库(Simple, decoupled codebases)
  3. 独立部署(Independent deployment)
  4. 自治团队(Autonomous teams)

方案

  1. 服务端模板组合
  2. 构建时集成(将每个微前端作为一个包发布)
  3. 通过 iframe 进行运行时集成(Why Not Iframe
  4. 通过 JavaScript 进行运行时集成(每个微前端都使用<script>标签包含在页面上,并在加载时公开一个全局函数作为其入口点。然后容器应用程序确定应该挂载哪个微前端,并调用相关函数来告诉微前端何时何地渲染自己。)
  5. 通过 Web Components 的运行时集成

思考(以qiankun为例

  1. 应用接入
    qiankun
  2. 应用如何隔离
    解密微前端:从qiankun看沙箱隔离
    30分钟快速掌握微前端qiankun的所有核心技术
  3. 如何通信
    基于 qiankun 的微前端最佳实践(图文并茂) - 应用间通信篇
  4. 样式如何隔离
  5. 卸载后清除副作用

single-spa

【带着问题阅读源码】解析 SingleSpa 5.X 是如何管理微前端应用、处理路由的
微应用乾坤路由原理简析

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant