Repository navigation
fix(@angular/build): invalidate inline stylesheet load cache when component file changes - #34438
Draft
alan-agius4 wants to merge 2 commits into
Draft
alan-agius4 wants to merge 2 commits into
alan-agius4 wants to merge 2 commits into
Conversation
…ort persistent cache
Ensure `ComponentStylesheetBundler.invalidate()` always invalidates `#loadCache` for all modified files, including evicting `angular:styles/component:${entry}` keys when an inline stylesheet's containing component `.ts` file is invalidated. Previously, invalidating a component `.ts` file deleted the inline `BundlerContext` without invalidating `#loadCache`, leaving stale errors (such as missing `@use` partials), stale Tailwind utility CSS, and unreferenced inline stylesheet entries in memory.
Additionally, allow `ComponentStylesheetBundler` to accept an optional `LoadResultCache` and wire `PersistentLoadResultCache` in `createComponentStylesheetBundlerForLibrary` when persistent disk caching is enabled.
…nd support persistent cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When an inline stylesheet's containing
.tsfile is modified,ComponentStylesheetBundler.invalidate()previously deletedentryfrom#inlineContextsand disposed itsBundlerContextwithout invalidating#loadCache.#loadCacheforangular:styles/component:${entry}when deletingentryfrom#inlineContextsas well as for allnormalizedFiles.MemoryLoadResultCache.invalidate()to directly evict cache keys in#loadResults.@useerrors recover when a missing partial is created, inline template Tailwind utility changes invalidate cached inline styles, and obsoleteangular:styles/component:${entry}keys are evicted.