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

refactor: Table to CSS-IN-JS #35584

Merged
merged 57 commits into from
May 31, 2022
Merged

refactor: Table to CSS-IN-JS #35584

merged 57 commits into from
May 31, 2022

Conversation

afc163
Copy link
Member

@afc163 afc163 commented May 16, 2022

[中文版模板 / 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
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • 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

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

@github-actions
Copy link
Contributor

  • 🚨 Please fill changelog in the PR

    • Write with a developer-oriented perspective and narrative method, without describing the details of the repair
    • Describing the problem and the impact on the developer
    • describing the user-first site problem, not your solution
    • Refer: https://ant.design/changelog#4.9.0
  • 🚨 请填写 PR 中的 changelog

    • 请用面向开发者的角度叙述方式撰写,不描述修复细节
    • 描述问题和对开发者的影响
    • 描述用户第一现场的问题,而非你的解决方式
    • 参考:https://ant.design/changelog-cn#4.9.0

@github-actions
Copy link
Contributor

github-actions bot commented May 16, 2022

Size Change: -4.36 kB (0%)

Total Size: 889 kB

Filename Size Change
./dist/antd-with-locales.min.js 463 kB +3.67 kB (+1%)
./dist/antd.compact.min.css 4.4 kB -2.92 kB (-40%) 🎉
./dist/antd.dark.min.css 4.41 kB -2.95 kB (-40%) 🎉
./dist/antd.min.css 4.4 kB -2.94 kB (-40%) 🎉
./dist/antd.min.js 409 kB +3.73 kB (+1%)
./dist/antd.variable.min.css 4.79 kB -2.95 kB (-38%) 🎉

compressed-size-action

@codecov
Copy link

codecov bot commented May 29, 2022

Codecov Report

Merging #35584 (6226151) into next (47493c0) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              next    #35584   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          475       489   +14     
  Lines         8508      8567   +59     
  Branches      2413      2413           
=========================================
+ Hits          8508      8567   +59     
Impacted Files Coverage Δ
components/_util/theme/util/alias.ts 100.00% <ø> (ø)
...omponents/table/hooks/useFilter/FilterDropdown.tsx 100.00% <ø> (ø)
components/table/Table.tsx 100.00% <100.00%> (ø)
components/table/style/bordered.tsx 100.00% <100.00%> (ø)
components/table/style/ellipsis.tsx 100.00% <100.00%> (ø)
components/table/style/empty.tsx 100.00% <100.00%> (ø)
components/table/style/expand.tsx 100.00% <100.00%> (ø)
components/table/style/filter.tsx 100.00% <100.00%> (ø)
components/table/style/fixed.tsx 100.00% <100.00%> (ø)
components/table/style/pagination.tsx 100.00% <100.00%> (ø)
... and 7 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 47493c0...6226151. Read the comment docs.

@afc163
Copy link
Member Author

afc163 commented May 29, 2022

还有一个问题,筛选菜单本地和线上样式完全不一样

本地 线上
截屏2022-05-29 下午7 32 00 图片

不知道本地表格筛选菜单为啥会被 Menu 的样式污染,然而本地的 Dropdown 演示又没有问题。

@afc163 afc163 marked this pull request as ready for review May 29, 2022 12:22
@zombieJ
Copy link
Member

zombieJ commented May 29, 2022

哎,和 Dropdown 当时遇到的同一个问题:https://github.com/react-component/dropdown/blob/master/src/Dropdown.tsx#L122

rc-dropdown 里 clone 了 element 加属性。Table 这边没有直接包 Menu 所以导致跳过 Menu 样式注入的代码就失效了。

@afc163
Copy link
Member Author

afc163 commented May 30, 2022

rc-dropdown 里 clone 了 element 加属性。Table 这边没有直接包 Menu 所以导致跳过 Menu 样式注入的代码就失效了。

有啥解法?

@zombieJ
Copy link
Member

zombieJ commented May 30, 2022

rc-dropdown 里 clone 了 element 加属性。Table 这边没有直接包 Menu 所以导致跳过 Menu 样式注入的代码就失效了。

有啥解法?

rc-dropdown 里的注入属性拆掉,onClick 部分移至 rc-trigger。其余部分通过 Context 在 antd 侧传递。

@zombieJ
Copy link
Member

zombieJ commented May 30, 2022

@afc163
Copy link
Member Author

afc163 commented May 30, 2022

666

@zombieJ zombieJ merged commit 9b95a30 into next May 31, 2022
@zombieJ zombieJ deleted the refactor/table-css-in-js branch May 31, 2022 02:10
@zombieJ zombieJ mentioned this pull request May 31, 2022
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

2 participants