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

perf: cache postcss processor by compiler.modifiedFiles #33

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

colinaaa
Copy link
Collaborator

@colinaaa colinaaa commented Jan 4, 2025

Summary

Add caches to avoid re-creating postcss processor in development.

In the previous version, Tailwind CSS is re-created in every compilation.

image

Details

There are two cases we want to cache:

  1. Modifying existing module(s).
    • We use isSubsetOf(compiler.modifiedFiles, cachedEntryModules) to test if the cache hit
  2. Modifying module(s) that do not belong to this entry.
    • We use isSubsetOf(entryModules, cachedEntryModules) to test if the cache hit

@colinaaa colinaaa marked this pull request as ready for review January 6, 2025 03:00
@colinaaa colinaaa added this pull request to the merge queue Jan 6, 2025
Merged via the queue into main with commit e5e65bd Jan 6, 2025
4 checks passed
@colinaaa colinaaa deleted the colin/0104/cache branch January 6, 2025 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants