vite-plugin-stylex icon indicating copy to clipboard operation
vite-plugin-stylex copied to clipboard

Improve Caching

Open hipstersmoothie opened this issue 1 year ago • 2 comments

I noticed that when I restart my app none of the styles have been loaded/generated. Every time I restart the app I see the whole app unstyled.

I was talking with @nmn and he said that stylex relies heavily on caching. To me it seems like there is something that could be improved here.

Here is me restarting the dev server and all the styles getting blown away

https://github.com/nonzzz/vite-plugin-stylex/assets/1192452/00123141-c379-4a78-9792-8a4069783319

Here is an example of styles flashing on refresh

https://github.com/nonzzz/vite-plugin-stylex/assets/1192452/16fbd7e0-c4c9-4496-9516-5c481619082e

hipstersmoothie avatar Jun 19 '24 18:06 hipstersmoothie

I think the challenge is that both file transformation and the metadata for each file needs to be cached. This has been challenging with most bundlers, but there should be some APIs to do so.

nmn avatar Jun 30 '24 15:06 nmn

I've been busy at this month. I'll take some time at next week to find a way.

nonzzz avatar Jun 30 '24 15:06 nonzzz