Skip to content

feat(qiankun): 支持一屏展示多个 umi 应用渲染实例#418

Merged
kuitos merged 1 commit into
masterfrom
feat/support-multiple-instance
Oct 23, 2020
Merged

feat(qiankun): 支持一屏展示多个 umi 应用渲染实例#418
kuitos merged 1 commit into
masterfrom
feat/support-multiple-instance

Conversation

@kuitos
Copy link
Copy Markdown
Member

@kuitos kuitos commented Oct 23, 2020

This change is Reviewable

@kuitos kuitos requested a review from PeachScript October 23, 2020 07:19
@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 23, 2020

Codecov Report

Merging #418 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #418   +/-   ##
=======================================
  Coverage   43.40%   43.40%           
=======================================
  Files          69       69           
  Lines        1631     1631           
  Branches      432      432           
=======================================
  Hits          708      708           
  Misses        922      922           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b6b4d1...25fe426. Read the comment docs.

Copy link
Copy Markdown
Member

@PeachScript PeachScript left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@kuitos kuitos merged commit 67a82e0 into master Oct 23, 2020
@delete-merged-branch delete-merged-branch Bot deleted the feat/support-multiple-instance branch October 23, 2020 07:47
fxxjdedd pushed a commit to fxxjdedd/plugins that referenced this pull request Jun 7, 2021
当前问题在于, 在 [umijs#418](umijs#418) 中, 将clientRenderOpts改为clientRenderOptsStack, 并以pop的方式获取, 这样有两个问题:

1. 当热更新时, 由于已经pop过, 此时clientRenderOptsStack为空, 那么src中生成的`.umi/umi.ts`的modifyClientRenderOpts操作将无法修改rootElement为dom, 而是保持为string.
   这就导致热更新时, 直接把子应用挂载到了string类型的rootElement对应的dom上, 也就是最外层的那个root, 就相当于子应用把主应用覆盖了.

2. 在 [umijs#423](umijs#423) 讲到, mount顺序是一定的, 但是render不是. 又因为上述pop过程是在render过程中进行的, 那么这个pop的顺序也不一定是安全的.
   这里使用appId的方式来保证render和clientRenderOpts的一致性.
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

Successfully merging this pull request may close these issues.

2 participants