Skip to content

Conversation

@kuitos
Copy link
Member

@kuitos kuitos commented Oct 27, 2020

This change is Reviewable

@kuitos kuitos changed the title fix(qiankun): remount 时 import 的 history fix(qiankun): remount 时 import 的 history 为旧的 history Oct 27, 2020
@codecov
Copy link

codecov bot commented Oct 27, 2020

Codecov Report

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

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #423   +/-   ##
=======================================
  Coverage   43.65%   43.65%           
=======================================
  Files          69       69           
  Lines        1638     1638           
  Branches      435      454   +19     
=======================================
  Hits          715      715           
  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 1b7d6f8...4cd37a8. Read the comment docs.

@kuitos kuitos merged commit 1801b4d into master Oct 27, 2020
@delete-merged-branch delete-merged-branch bot deleted the fix/multiply-history branch October 27, 2020 08:32
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