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

docs: migrate to antd-style #43623

Merged
merged 8 commits into from
Jul 20, 2023
Merged

docs: migrate to antd-style #43623

merged 8 commits into from
Jul 20, 2023

Conversation

MadCcc
Copy link
Member

@MadCcc MadCcc commented Jul 18, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • 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

#40235

💡 Background and solution

去除 @emotion/react 和 css prop 的写法,全量用 antd-style
全局样式的写法比较怪,去 antd-style 加个工厂方法再来
https://ant-design.github.io/antd-style/api/global-styles#%E7%BB%93%E5%90%88-antd-%E7%9A%84-token-%E4%BD%BF%E7%94%A8

📝 Changelog

Language Changelog
🇺🇸 English -
🇨🇳 Chinese -

☑️ 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

🚀 Summary

🤖 Generated by Copilot at 5247fb2

The pull request migrates the dumi pages and theme components from @emotion/react to antd-style for styling and theming. This improves the performance, compatibility, and consistency of the project and simplifies the code. It also fixes some minor issues with indentation, naming, and props. The unused useSiteToken hook and the RecommendsOld component were removed.

🔍 Walkthrough

🤖 Generated by Copilot at 5247fb2

  • Replace @emotion/react with antd-style in all import statements to use the wrapper package that provides additional features for styling components (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Remove useSiteToken hook from all components and functions and replace it with useTheme hook from antd-style to access the theme token object consistently and support custom token types (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Wrap useStyle function with createStyles function from antd-style in all components to create style objects with the theme token object and the css function as arguments, and return an object with the styles and cx properties (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Replace css prop with className prop in all React elements and components to apply class names in a standard way, and use classNames function from classnames package to combine multiple class names from the styles object (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Rename RecommendsOld component to Banner and change the file name and path accordingly to use a more concise and descriptive name for the component that displays the banner section of the landing page (link, link)
  • Add NewToken interface to declare a custom token type that extends the default token type from antd-style and defines some additional properties for the site theme, and use it to augment the CustomToken interface from antd-style and specify the generic type parameter for the ThemeProvider component (link, link)
  • Remove some properties from the Menu and Card component themes that override the default theme values and could cause inconsistency or unexpected appearance of the components (link, link)
  • Rename colorActiveBarWidth property to activeBarBorderWidth in the Menu component theme to match the correct property name for the component theme (link)
  • Replace overlay prop with menu prop in the Breadcrumb.Item component to use a more concise and consistent way to pass a menu object to the component (link)
  • Rename useCarouselStyle function to getCarouselStyle function to avoid using the use prefix for a function that is not a custom hook (link)
  • Change size prop from 'large' to "large" in the Input component to use double quotes instead of single quotes for string literals, which is the preferred style for TypeScript code (link)
  • Delete file .dumi/hooks/useSiteToken.ts as it is no longer needed (link)

@stackblitz
Copy link

stackblitz bot commented Jul 18, 2023

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

@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2023

@socket-security
Copy link

socket-security bot commented Jul 18, 2023

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
crypto 1.0.1 None +0 778 B ehsalazar

🚮 Removed packages: @emotion/babel-preset-css-prop@11.11.0, @emotion/css@11.11.2, antd-style@3.4.1

@github-actions
Copy link
Contributor

github-actions bot commented Jul 18, 2023

size-limit report 📦

Path Size
./dist/antd.min.js 381.75 KB
./dist/antd-with-locales.min.js 441.37 KB

@argos-ci
Copy link

argos-ci bot commented Jul 18, 2023

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 1 change Jul 20, 2023, 8:40 AM

@codecov
Copy link

codecov bot commented Jul 18, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (f438c13) 100.00% compared to head (d58237a) 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##            master    #43623    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          657       657            
  Lines        11064     11180   +116     
  Branches      2999      3051    +52     
==========================================
+ Hits         11064     11180   +116     

see 8 files with indirect coverage changes

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

@afc163
Copy link
Member

afc163 commented Jul 18, 2023

antd-style 之前有 SSR 过程的中的样式丢失问题,还特别改回 emotion,要注意一下:#43158

@MadCcc
Copy link
Member Author

MadCcc commented Jul 18, 2023

antd-style 之前有 SSR 过程的中的样式丢失问题,还特别改回 emotion,要注意一下:#43158

可能是导出方式问题

@MadCcc MadCcc changed the title docs: migrate to antd-style [WIP]docs: migrate to antd-style Jul 18, 2023
@MadCcc MadCcc changed the title [WIP]docs: migrate to antd-style [WIP] docs: migrate to antd-style Jul 18, 2023
@MadCcc MadCcc changed the title [WIP] docs: migrate to antd-style docs: migrate to antd-style Jul 20, 2023
@MadCcc MadCcc mentioned this pull request Jul 20, 2023
20 tasks
@MadCcc MadCcc merged commit e96059c into master Jul 20, 2023
94 checks passed
@MadCcc MadCcc deleted the docs/rm-emotion-react branch July 20, 2023 11:27
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.

None yet

5 participants