Replies: 5 comments
-
you could brew your own, or use /universal, which is pretty slim (and it doesn't include colors).
the full export from this will be 6.9KB, but that's without tree shaking. if you use only useSpring for instance, you'll end up with 4.7kb. |
Beta Was this translation helpful? Give feedback.
-
I did some looking in the styled-components repo because I figured there is some overlap in some constant arrays, and see that you've already suggested some sharing in styled-components/styled-components#1688 but it seems like they plan to solve it with a babel transform instead. Splitting those constants out to separate packages would make it simpler for really size-concious users to alias them to empty arrays in their build systems though, in case they still want to use the other features from the web target. |
Beta Was this translation helpful? Give feedback.
-
having a babel plug would be fantastic, not only for colors but also animated.div, etc. there's some weight it has to drag along for the dom stuff. |
Beta Was this translation helpful? Give feedback.
-
I just recently made a inhouse Babel plugin so the API is still fresh in my memory. @drcmda If you could give me few pointers or compile a list of links to variables/code that is safe to remove, I could give it a shot sometimes soon. |
Beta Was this translation helpful? Give feedback.
-
Basically all colors and native elements (animated.xxxx) could be white listed by Babel. Though colors for sure would be harder to implement. |
Beta Was this translation helpful? Give feedback.
-
Do you see this library ever getting a lite bundle with few sacrifices here and there?
For example I got almost 20% size reduction by simply commenting out named colors map and replacing it with empty map
8.44Kb -> 6.87Kb (gzip)
. It means I can't use named colors likelemonchiffon
but seriously, does anyone even use them?Beta Was this translation helpful? Give feedback.
All reactions