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: config support holderRender #46596

Merged
merged 42 commits into from
Jan 2, 2024
Merged

feat: config support holderRender #46596

merged 42 commits into from
Jan 2, 2024

Conversation

crazyair
Copy link
Member

@crazyair crazyair commented Dec 23, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

RFC #46615

静态组件 message Modal notification 无法设置 hashPriority="high":where 降级等,增加 holderRender 方法,让用户自定义包裹

ConfigProvider.config({
  holderRender: (children) => <StyleProvider hashPriority="high">{children}</StyleProvider>,
});
image
  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English ConfigProvider.config support holderRender
🇨🇳 Chinese ConfigProvider.config 支持 holderRender

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

stackblitz bot commented Dec 23, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

github-actions bot commented Dec 23, 2023

Preview Is ready

Copy link
Contributor

github-actions bot commented Dec 23, 2023

Visual Regression Report for PR #46596 Passed ✅

Target branch: feature (bfda8ce)


Congrats! No visual-regression diff found

Copy link
Contributor

github-actions bot commented Dec 23, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 330.38 KB (+66 B 🔺)
./dist/antd-with-locales.min.js 376.21 KB (+45 B 🔺)

Copy link

codesandbox-ci bot commented Dec 23, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5e44757:

Sandbox Source
antd reproduction template (forked) Configuration

Copy link

codecov bot commented Dec 23, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (bfda8ce) 100.00% compared to head (5e44757) 100.00%.

Additional details and impacted files
@@            Coverage Diff            @@
##           feature    #46596   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          718       718           
  Lines        12214     12241   +27     
  Branches      3229      3236    +7     
=========================================
+ Hits         12214     12241   +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MadCcc
Copy link
Member

MadCcc commented Dec 25, 2023

测试没过

@zombieJ
Copy link
Member

zombieJ commented Dec 25, 2023

语义有点过于模糊。。。

我感觉业务里自己封装静态方法反而自由度会更高一些?

@crazyair
Copy link
Member Author

语义有点过于模糊。。。

我感觉业务里自己封装静态方法反而自由度会更高一些?

api 名可以再讨论

目前 config 有 prefixCls theme 等,也为此做了许多维护,增加一个 wrapper 可以让用户自己配置,antd 就可以不用再维护了

@zombieJ
Copy link
Member

zombieJ commented Dec 25, 2023

目前 config 有 prefixCls theme 等,也为此做了许多维护,增加一个 wrapper 可以让用户自己配置,antd 就可以不用再维护了

也有道理

@crazyair crazyair closed this Dec 26, 2023
@crazyair crazyair reopened this Dec 26, 2023
@crazyair crazyair requested review from zombieJ and MadCcc December 26, 2023 06:20
@crazyair
Copy link
Member Author

crazyair commented Dec 27, 2023

2 个 todo

  • Static function can not consume context like dynamic theme. Please use 'App' component instead. 需要加上使用了 container 则不提示
  • message、modal、notification 的静态方法 demo 需要改成用 container 方式吗(因为静态配置会有被覆盖的风险,config 是配置在每个 demo 外面,还是每个 demo 的组件里,还是提出去一个 config,然后 demo 去引用)

components/config-provider/index.tsx Outdated Show resolved Hide resolved
components/message/demo/info.tsx Outdated Show resolved Hide resolved
@crazyair crazyair removed the request for review from zombieJ December 27, 2023 13:13
@crazyair crazyair requested a review from MadCcc December 28, 2023 02:46
.dumi/theme/SiteThemeProvider.tsx Show resolved Hide resolved
@crazyair crazyair requested a review from MadCcc January 2, 2024 09:41
@crazyair crazyair merged commit 8950642 into feature Jan 2, 2024
105 checks passed
@crazyair crazyair deleted the config branch January 2, 2024 09:43
Copy link
Contributor

github-actions bot commented Jan 2, 2024

🎉 Thank you for your contribution! If you have not yet joined our DingTalk community group, please feel free to join us (when joining, please provide the link to this PR).

🎉 感谢您的贡献!如果您还没有加入钉钉社区群,请扫描下方二维码加入我们(加群时请提供此 PR 链接)。

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