Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🗺️ Add caching to Vanilla Extract plugin #5524

Closed
markdalgleish opened this issue Feb 21, 2023 · 1 comment
Closed

🗺️ Add caching to Vanilla Extract plugin #5524

markdalgleish opened this issue Feb 21, 2023 · 1 comment
Assignees

Comments

@markdalgleish
Copy link
Member

markdalgleish commented Feb 21, 2023

PR: #5735

The build can get quite slow if there are a lot of .css.ts files, even on rebuilds, and even when changing non-VE files. We need to add caching to address this.

Vanilla Extract core currently compiles each .css.ts file using esbuild before evaluating it. Other bundlers in watch mode don't recompile the file if it or any of its affected files haven't changed. However, esbuild is different in that it leaves caching entirely up to plugins and re-runs everything on each rebuild which is why perf issues are more pronounced for us.

We want to cache the results of each .css.ts file but there's no way to generate a cache key just by looking at the .css.ts entry point since it imports other modules. To fix this the Vanilla Extract compile + eval step needs to migrate from esbuild + eval to vite-node so that Vite can cache the module graph for us as part of its eval step. We can even share the cache between server and client builds which is really nice.

@markdalgleish markdalgleish self-assigned this Feb 21, 2023
@markdalgleish markdalgleish converted this from a draft issue Feb 21, 2023
@markdalgleish markdalgleish moved this from In Progress to Merged in Roadmap Mar 14, 2023
@github-actions
Copy link
Contributor

🤖 Hello there,

We just published version v0.0.0-nightly-bf9d0a9-20230314 which involves this issue. If you'd like to take it for a test run please try it out and let us know what you think!

Thanks!

@ryanflorence ryanflorence moved this from Merged to Released in Roadmap Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants