Skip to content

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

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:feat/persistent-load-result-cache
Open

refactor(@angular/build): implement generic persistent load result cache infrastructure for build pipeline#33651
clydin wants to merge 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 from edabae0 to 4c6e41c Compare July 24, 2026 18:23
…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 4c6e41c to 6b0bc31 Compare July 24, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

1 participant