styled-components / xstyled

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

perf: use map instead of weakmap #381

Closed mleralec closed 1 year ago

mleralec commented 1 year 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 1 year ago

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