Application with multiple iframes performances problems on hot reload
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript, webpack
调研方向
使用 webpack.config.js 和三个入口文件 src/index.js、src/index-frame1.js 以及 src/index-frame2.js 重现 hot-reload 行为。首先,使用所示配置在 webpack-dev-server 中运行 multi-iframe 应用,并观察每个 frame 中的 reload 事件和日志。完成的标准是:更改只 reload 预期的 window,或在不产生重复 reload 和过多日志的情况下协调各个 frame。
由索引模型根据 Issue 内容生成。
描述
- Operating System: MacOS BigSur
- Node Version: 14.15
- NPM Version: 6.14.8
- webpack Version: 4.44.2
- webpack-dev-server Version: 3.11.1
- Browser: chrome 88.0.4324.87
- This is a bug
- This is a modification request
Code
// webpack.config.js
{
output: {
library: 'viewDesignerApp',
path: 'dist',
publicPath: '/my-app/',
libraryTarget: 'umd'
},
entry: {
'index': 'src/index',
'index-frame1': 'src/index-frame1',
'index-frame2': 'src/index-frame2'
},
plugins: [
new HtmlWebpackPlugin({
filename: 'index.html',
chunks: ['index']
}),
new HtmlWebpackPlugin({
filename: 'index-frame1.html',
chunks: ['index-frame1']
}),
new HtmlWebpackPlugin({
filename: 'index-frame2.html',
chunks: ['index-frame2']
}),
],
optimization: {
splitChunks: {
chunks: 'all'
}
},
devServer: {
contentBase: ['dist'],
contentBasePublicPath: '/my-app/',
compress: true,
publicPath: '/my-app/',
port: 3001
}
}
src/index.js
import {render} from 'react-dom';
const rootNode = document.getElementById('root');
render(
<div>
<iframe src="./index-frame1.html" />
<iframe src="./index-frame2.html" />
</div>,
rootNode
);
src/index-frame1.js
import {render} from 'react-dom';
const rootNode = document.getElementById('root');
render(
<div>SUB FRAME 1</div>,
rootNode
);
src/index-frame2.js
import {render} from 'react-dom';
const rootNode = document.getElementById('root');
render(
<div>SUB FRAME 2</div>,
rootNode
);
Expected Behavior
I've an application that contains 2 sub iframes
Webpack generates 3 html files for the application
In dev mode, in case of code change, only the top level window might listne the events / try to refresh the page
or the main window need a way to advert the subframes to avoid listening
Actual Behavior
in dev mode, all the frames + root window are listening the hot reload changes.
In case of code change, the frames + root window tries to reload the page in same time
Chrome devTools frequently crashes because of to many logs (3x the progress logs) + interrupted sourcemaps decoding
For Bugs; How can we reproduce the behavior?
create an app with an iframe, both pointing to html pages managed by webpack
For Features; What is the motivation and/or use-case for the feature?
- 主要语言
- JavaScript
- 星标
- 7.9k
- 派生
- 1.5k
- 平均合并
- 2 天 12 小时
- 30 天内合并 PR
- 8
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
webpack/webpack-dev-server 的其他 Issue
-
Add support for Chrome DevTools Workspaces可能重新可做 @AnumanyaJaiswal 于 35 天前认领,目前没有进行中的 PR。 未关闭
难度 4/5 3-5 天 新手友好度 45/100
webpack/webpack-dev-server#5716 · 2 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
webpack/webpack-dev-server#5679 · 3 条评论 ·
维护者通常 1 天内回复
-
CORS localhost requests are considered invalid host and get blocked可能重新可做 @Jeston10 于 310 天前认领,目前没有进行中的 PR。 未关闭
难度 3/5 1-2 天 新手友好度 52/100
webpack/webpack-dev-server#5603 · 5 条评论 ·
维护者通常 1 天内回复
-
Webpack dev server URL should be displayed more prominently可能已有人在做 @snitin315 于 805 天前认领。 未关闭
webpack/webpack-dev-server#4907 · 7 条评论 · 已指派 1 人 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 35/100
webpack/webpack-dev-server#4540 · 9 条评论 ·
维护者通常 1 天内回复
查看 webpack/webpack-dev-server 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 64/100
babalae/bettergi-scripts-list#3905 · 1 条评论 ·
维护者通常 1 天内回复
-
[Bug] "Configure Colota" opens Colota with "Invalid configuration: No configuration data in URL"未关闭
难度 1/5 1-3 小时 新手友好度 87/100
dedicatedcode/reitti#1445 ·
维护者通常 1 天内回复
-
New tool: Uncle Desk可能已有人在做 @github-actions 今天认领。 未关闭submission triage
难度 1/5 1 小时以内 新手友好度 85/100
kausalflow/tools#384 · 1 条评论 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1-3 小时 新手友好度 67/100
-
area: css
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复