Skip to content

refactor(@angular/build): implement generic persistent load result cache infrastructure for build pipeline - #33651

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:feat/persistent-load-result-cache
Aug 3, 2026
Merged

refactor(@angular/build): implement generic persistent load result cache infrastructure for build pipeline#33651
alan-agius4 merged 1 commit into
angular:mainfrom
clydin:feat/persistent-load-result-cache

Conversation

@clydin

@clydin clydin commented Jul 24, 2026

Copy link
Copy Markdown
Member

This change implements a unified, generic persistent caching system for the esbuild builder pipeline. It introduces a two-tier caching mechanism combining in-memory caching with a persistent disk store. Integration into various aspects of the build system will be performed in future changes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a persistent load result cache (PersistentLoadResultCache) for esbuild and a global stylesheet configuration hashing utility, along with their respective unit tests. The review feedback focuses on performance improvements, specifically recommending the replacement of synchronous file I/O operations with non-blocking asynchronous alternatives (fsPromises.readFile) processed in parallel. Additionally, it suggests using incremental hash updates to prevent inefficient implicit string coercion of binary buffers.

Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
@clydin
clydin force-pushed the feat/persistent-load-result-cache branch from 78e50e5 to edabae0 Compare July 24, 2026 14:10
@clydin clydin added the target: minor This PR is targeted for the next minor release label Jul 24, 2026
@clydin

clydin commented Jul 24, 2026

Copy link
Copy Markdown
Member Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a persistent caching mechanism for esbuild load results, including the PersistentLoadResultCache class and a utility to calculate global stylesheet configuration hashes. Feedback focuses on optimizing performance and avoiding event loop blocking by replacing synchronous fs.existsSync calls with asynchronous error handling during file reads. Additionally, it is recommended to use file metadata (size and modification time) instead of reading full file contents to compute cache keys, and to address potential non-deterministic serialization issues when hashing complex stylesheet options.

Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
Comment thread packages/angular/build/src/tools/esbuild/persistent-load-result-cache.ts Outdated
@clydin
clydin force-pushed the feat/persistent-load-result-cache branch 5 times, most recently from c21cc7d to d6b31a4 Compare July 24, 2026 21:22
…che infrastructure for build pipeline

This change implements a unified, generic persistent caching system for the esbuild builder pipeline. It introduces a two-tier caching mechanism combining in-memory caching with a persistent disk store.
Integration into various aspects of the build system will be performed in future changes.
@clydin
clydin force-pushed the feat/persistent-load-result-cache branch from d6b31a4 to bd1ecb1 Compare July 24, 2026 21:29
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Jul 24, 2026

@alan-agius4 alan-agius4 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Aug 3, 2026
@alan-agius4
alan-agius4 merged commit d520dca into angular:main Aug 3, 2026
41 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants