-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: hot-update 文件生成放到 node_modules 下 #424
Open
HiLanXiao
wants to merge
20
commits into
master
Choose a base branch
from
feat/0906_CY
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
2c1cc45
feat: hot-update 文件生成放到 node_modules 下
8e4c23b
Merge branch 'master' of https://github.com/umijs/mako into feat/0906_CY
caf9838
Merge branch 'master' of https://github.com/umijs/mako into feat/0906_CY
0bea63d
Merge branch 'master' of https://github.com/umijs/mako into feat/0906_CY
b79b5ca
feat: hot-update 文件生成放到 node_modules 下
9840c18
feat: hot-update 文件生成放到 node_modules 下
583d3e0
test: 更新单测快照
7d5f0b3
merge: 合并master
HiLanXiao ae9e4fb
Merge branch 'master' of https://github.com/umijs/mako into feat/0906_CY
2befd13
test: 更新单测快照
8f097f7
test: 更新单测快照
5d1e91e
feat: 优化下hmr server 的匹配逻辑
HiLanXiao 7bca4dc
feat: 去除hmr req的hot_update前缀
39ac097
test: 更新单测快照
0a84860
feat: dev server 优化
b70b89a
feat: 更新单测快照
859e09f
feat: 更新单测快照
1f17c10
feat: 回退运行时变更,禁止用户配置不以 / 开头的 publicPath
edea548
test: 更新单测和快照
001c95f
feat: 回退禁止用户配置不以 / 开头的 publicPath的变更
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -150,7 +150,7 @@ function createRuntime(makoModules, entryModuleId) { | |
invalidate () {}, | ||
check () { | ||
const current_hash = requireModule.currentHash(); | ||
return fetch(`${requireModule.publicPath}${current_hash}.hot-update.json`).then((res)=>{ | ||
return fetch(`/hot_update/${current_hash}.hot-update.json`).then((res)=>{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里写死 会不会和用户的路由有冲突。业务有一个 hot_update/:id 的路由。这里可以参考下 umi 在 配置了 publicPath 这些资源是怎么 serve 的
|
||
return res.json(); | ||
}).then((update)=>{ | ||
return Promise.all(update.c.map((chunk)=>{ | ||
|
@@ -165,7 +165,7 @@ function createRuntime(makoModules, entryModuleId) { | |
ext | ||
].join('.'); | ||
return new Promise((done)=>{ | ||
const url = `${requireModule.publicPath}${hotChunkName}`; | ||
const url = `hot_update/${hotChunkName}`; | ||
requireModule.loadScript(url, done); | ||
}); | ||
})); | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里用 node_modules/.mako,是不是 runtime 就不需要调整了,改动可以小一点。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好像是可以的,我再调整下
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.