fix(qiankun): remount 时 import 的 history 为旧的 history#423
Merged
Conversation
Codecov Report
@@ 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.
|
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的一致性.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change is