-
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
feat: defaultErrorBoundary and defaultLoader #11609
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Size Change: +30 B (0%) Total Size: 10.1 MB
ℹ️ View Unchanged
|
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #11609 +/- ##
==========================================
- Coverage 29.01% 29.00% -0.02%
==========================================
Files 484 484
Lines 14710 14716 +6
Branches 3476 3480 +4
==========================================
Hits 4268 4268
- Misses 9686 9692 +6
Partials 756 756
☔ View full report in Codecov by Sentry. |
这个 PR 里怎么都是格式化的改动啊,很难 review ,建议做最小改动,不要大面积的格式化,一点也不清真,等下个人改代码又是一种风格。 |
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.
add autoSetLoading
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.
LGTM
// defaultLoader.tsx | ||
import { Spin } from 'antd'; | ||
|
||
export default function (loading: boolean) { |
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.
匿名组件会导致 HMR 失效。
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.
20230907163235302.mp4
我验证了一下,好像并不存在你说的问题
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.
在大型应用里匿名组件一定会 HMR 失效,匿名组件是 react refresh webpack plugin 明确禁止的一种写法。
需求背景
autoSetLoading
只能加载默认的动画,通过loader
定制的话,也需要每个子应用都配置一遍,比较繁琐,用户希望可以通过统一的方式扩展子应用的加载动画。errorBoundary
也会存在类似的问题。实现与使用姿势
扩展 qiankun master 配置,传递文件路径,使用姿势如下: