ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
235 stars 57 forks source link

refactor: flattenToken use WeakMap #143

Closed zombieJ closed 10 months ago

zombieJ commented 10 months ago

For large app, flatten token for each component will repeat called multiple times. Use WeakMap to cache the result:

截屏2023-08-27 19 40 03
github-actions[bot] commented 10 months ago

😭 Deploy PR Preview ab8fc3dc36bb9d0a5d929ef450c1476bd7dd8353 failed. Build logs

🤖 By surge-preview

codecov-commenter commented 10 months ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02% :tada:

Comparison is base (eeb7455) 94.51% compared to head (3015ed5) 94.53%.

:exclamation: Current head 3015ed5 differs from pull request most recent head ab8fc3d. Consider uploading reports for the commit ab8fc3d to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #143 +/- ## ========================================== + Coverage 94.51% 94.53% +0.02% ========================================== Files 25 25 Lines 2170 2179 +9 Branches 342 344 +2 ========================================== + Hits 2051 2060 +9 Misses 119 119 ``` | [Files Changed](https://app.codecov.io/gh/ant-design/cssinjs/pull/143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design) | Coverage Δ | | |---|---|---| | [src/util.ts](https://app.codecov.io/gh/ant-design/cssinjs/pull/143?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL3V0aWwudHM=) | `45.00% <100.00%> (+4.45%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.