Open
Conversation
added 2 commits
June 7, 2021 18:28
当前问题在于, 在 [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的一致性.
Author
|
需要配合 umijs/umi#6702, 必须先等这个合并。 |
4 tasks
added 3 commits
June 7, 2021 19:19
如果umijs没有升级到这次提交[#6702](umijs/umi#6702), 则使用原来的处理方式
Author
|
related issues: |
Author
|
当前pr还在进行中,过程如下:
|
Closed
4 tasks
…OptsMap[appId]` is undefined
Author
|
应该没什么要改的了 @kuitos 能帮忙审查一下吗? |
Author
|
fixed umijs/umi#6521 |
|
请问更新了吗 |
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.
当前问题在于, 在 #418 中, 将clientRenderOpts改为clientRenderOptsStack, 并以pop的方式获取, 这样有两个问题:
当热更新时, 由于已经pop过, 此时clientRenderOptsStack为空, 那么src中生成的
.umi/umi.ts的modifyClientRenderOpts操作将无法修改rootElement为dom, 而是保持为string.这就导致热更新时, 直接把子应用挂载到了string类型的rootElement对应的dom上, 也就是最外层的那个root, 就相当于子应用把主应用覆盖了.
在 #423 讲到, mount顺序是一定的, 但是render不是. 又因为上述pop过程是在render过程中进行的, 那么这个pop的顺序也不一定是安全的.
这里使用appId的方式来保证render和clientRenderOpts的一致性.