-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
fix(bundler-webpack): Fix hmr failure caused by exporting clientLoader or routeProps from routing components #11611
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
@pmmmwh/react-refresh-webpack-plugin 直接依赖在 dependencies 是不是不用在声明 @pmmmwh/react-refresh-webpack-plugin 依赖的依赖 在 pnpm 下我不是很确认 @fz6m 求助 |
@PeachScript 发现 client-loader 示例 多刷几次会有 mfsu 的报错 我私聊你了 感觉应该不是 我这次变更导致的 辛苦关注下 |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #11611 +/- ##
=======================================
Coverage 29.01% 29.01%
=======================================
Files 484 484
Lines 14710 14710
Branches 3476 3476
=======================================
Hits 4268 4268
Misses 9686 9686
Partials 756 756
☔ View full report in Codecov by Sentry. |
Size Change: +37.8 kB (0%) Total Size: 10.1 MB
ℹ️ View Unchanged
|
"jest-worker": "29.4.3", | ||
"lightningcss": "1.19.0", | ||
"loader-utils": "2.0.4", |
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.
把这个 react refresh webpack plugin fork 一份出去管理吧,这也太恶心了,多这么多不明不白的依赖,还多一堆构建脚本,心智太重,fork 出去管理更清真一些。
if ( | ||
isReactRefreshBoundary(prevExports) && | ||
shouldInvalidateReactRefreshBoundary(prevExports, moduleExports) | ||
) { |
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.
if ( | |
isReactRefreshBoundary(prevExports) && | |
shouldInvalidateReactRefreshBoundary(prevExports, moduleExports) | |
) { | |
if ( | |
prevExports && | |
isReactRefreshBoundary(prevExports) && | |
shouldInvalidateReactRefreshBoundary(prevExports, moduleExports) | |
) { |
另外 routeProps 有一个 PR #10593 比较重要,是很久之前没合入的,希望能迁移过来一并合入。 |
MFSU 报错是因为刷新太快,没有 disable cache 的情况下,导致脚本加载失败;建议 dev 状态下始终开启 disable cache 功能 |
新的 pr 实现这个关了 |
参考 ice 的实现 alibaba/ice#6442 修复路由组件导出
clientLoader
或者routeProps
时 react 组件热更新失效导致的应用级别刷新