Repository navigation
fix(@angular/build): restore font stylesheet caching - #34720
Open
nagahara-naoki wants to merge 2 commits into
Open
nagahara-naoki wants to merge 2 commits into
nagahara-naoki wants to merge 2 commits into
Conversation
Create the font cache directory before writing and validate cached stylesheets using the same hexadecimal hash format used when saving them. Add regression tests for cache reuse and failure handling. Fixes angular#34719
There was a problem hiding this comment.
Code Review
This pull request ensures that the font cache directory is created recursively before writing cached stylesheets, updates the content hash validation to use hex encoding, and adds a comprehensive test suite for the disk cache functionality. The review feedback suggests optimizing the directory creation by using the cache path directly instead of computing dirname(cacheFile), which also allows removing the unused dirname import.
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.
Hi! This fixes the font stylesheet disk cache so builds can save downloaded CSS and reuse it on later runs.
PR Checklist
PR Type
What is the current behavior?
The font cache directory is not created automatically, so saving the stylesheet fails silently. Even when the directory exists, cache reads compare a Base64 hash against the hexadecimal hash stored by cache writes. Valid cache files are consequently deleted and downloaded again.
Fixes #34719.
What is the new behavior?
Add regression coverage for directory creation, reuse across processor instances, corrupted cache entries, disabled caching, and cache write failures.
Does this PR introduce a breaking change?
Other information
This fixes the existing font stylesheet cache path. No documentation update is needed for this internal correction.
The reproduction in #34719 was verified with actual CLI 22.2.6 builds: the initial build did not create the cache directory; after creating it manually, the next build discarded the saved file and failed when the font request was unavailable.
Validation: repository formatting, targeted ESLint, and
git diff --check. The added regression tests have not been executed locally.