Skip to content
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: global loading is obtained from appData #10638

Merged
merged 3 commits into from
Mar 2, 2023

Conversation

Wxh16144
Copy link
Member

background: umijs/dumi#1463

@vercel
Copy link

vercel bot commented Feb 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated
umi ⬜️ Ignored (Inspect) Mar 1, 2023 at 9:06PM (UTC)

@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.01 ⚠️

Comparison is base (eef65ee) 28.79% compared to head (e85258b) 28.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #10638      +/-   ##
==========================================
- Coverage   28.79%   28.79%   -0.01%     
==========================================
  Files         455      455              
  Lines       13567    13577      +10     
  Branches     3182     3178       -4     
==========================================
+ Hits         3907     3909       +2     
- Misses       8981     8989       +8     
  Partials      679      679              
Impacted Files Coverage Δ
...ackages/preset-umi/src/features/appData/appData.ts 0.00% <0.00%> (ø)
...kages/preset-umi/src/features/tmpFiles/tmpFiles.ts 0.00% <ø> (ø)
packages/utils/src/updatePackageJSON.ts 40.00% <0.00%> (-5.46%) ⬇️
packages/utils/src/index.ts 100.00% <0.00%> (ø)
packages/plugins/src/layout.ts 0.00% <0.00%> (ø)
packages/bundler-utils/src/index.ts 0.00% <0.00%> (ø)
packages/bundler-webpack/src/dev.ts 0.00% <0.00%> (ø)
packages/plugins/src/tailwindcss.ts 0.00% <0.00%> (ø)
packages/bundler-webpack/src/build.ts 50.00% <0.00%> (ø)
packages/preset-umi/src/registerMethods.ts 0.00% <0.00%> (ø)
... and 11 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@PeachScript PeachScript requested a review from sorrycc March 1, 2023 11:10
Copy link
Member

@PeachScript PeachScript left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sorrycc 我刚刚和 @Wxh16144 聊了下,umi.tpl 里还是需要改成 import Loading from '{{loadingComponent}}'; 的,只是不提供 specifier 的用法,不然插件还是不能定制 Loading 组件,现在 dumi 为了支持 .dumi/loading 做法比较黑:https://github.com/umijs/dumi/blob/50135656d13c4e529d27c5f3553fecccc1c3a136/src/features/derivative.ts#L210

改完模板相当于 Umi 层的默认值是 loadingComponent = null | '@/loading',但允许插件通过 appData 修改这个值,比如变成 dumi/dist/client/loading

@Wxh16144

This comment was marked as outdated.

@PeachScript
Copy link
Member

我的想法是直接这样把 umi.tpl 变量 rename 掉。

rename 会有 Breaking Change,因为 loadingComponent 是运行时参数的一部分,可以被运行时插件修改

@Wxh16144
Copy link
Member Author

Wxh16144 commented Mar 1, 2023

rename 会有 Breaking Change,因为 loadingComponent 是运行时参数的一部分,可以被运行时插件修改

抱歉,我截图有点问题, 我是想语义化一些:

image

@sorrycc sorrycc merged commit ed0af4e into umijs:master Mar 2, 2023
@github-actions
Copy link

github-actions bot commented Mar 2, 2023

感谢 PR!如果有兴趣一起参与维护 Umi,可加入我们的 Umi Contributor 群。加入方式是先用钉钉扫下方二维码加我钉钉,记得注明 github id,然后我会拉你到群里。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants