styled-components / xstyled

A utility-first CSS-in-JS framework built for React. 💅👩‍🎤⚡️
https://xstyled.dev
MIT License
2.29k stars 106 forks source link

perf: use map instead of weakmap #381

Closed mleralec closed 2 years ago

mleralec commented 2 years ago

Summary

Following this issue https://github.com/gregberge/xstyled/issues/371, use a Map instead of a WeakMap for caches (with a theme stringifed as key instead of theme object). This will prevent continued cache growth.

Test plan

Check https://github.com/gregberge/xstyled/issues/371#issuecomment-1218335972

mleralec commented 2 years ago

@jguddas Thanks for you comment, I'll close this PR. This fix looks very slow...