refactor(@angular/build): support direct builds and shared load cache in BundlerContext - #33914
Merged
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates BundlerContext to support a shared load cache (sharedLoadCache) and introduces an optional invalidate method to the LoadResultCache interface. The feedback highlights two key issues: first, making invalidate optional in LoadResultCache could lead to stale cached results during rebuilds if a custom cache doesn't implement it, so it should be made required; second, sharing a single cache across multiple contexts can cause cross-contamination of watch files, triggering unnecessary rebuilds and degrading performance.
clydin
force-pushed
the
bundler-context-shared-cache
branch
2 times, most recently
from
August 24, 2026 23:59
098dc50 to
36c71cb
Compare
clydin
force-pushed
the
bundler-context-shared-cache
branch
3 times, most recently
from
August 25, 2026 01:15
46cfeb0 to
ceef82e
Compare
… in BundlerContext Enhance BundlerContext to allow incremental result caching without requiring a persistent esbuild context instance. The useContext constructor parameter defaults to incremental for backward compatibility while allowing callers to disable persistent contexts. Also support passing an external LoadResultCache instance to share load caches across contexts, and add an optional invalidate method to the LoadResultCache interface.
clydin
force-pushed
the
bundler-context-shared-cache
branch
2 times, most recently
from
August 25, 2026 04:49
faa8b1d to
58095a9
Compare
…undler contexts Update setupBundlerContexts to instantiate a single MemoryLoadResultCache and share it across initial and non-initial global stylesheet BundlerContext instances. This allows global stylesheet contexts to share load cache state without instantiating multiple separate cache instances.
clydin
force-pushed
the
bundler-context-shared-cache
branch
from
August 25, 2026 04:59
58095a9 to
c3293d7
Compare
alan-agius4
approved these changes
Aug 25, 2026
Collaborator
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
Enhance BundlerContext to allow incremental result caching without requiring a persistent esbuild context instance. The useContext constructor parameter defaults to incremental for backward compatibility while allowing callers to disable persistent contexts. Also support passing an external LoadResultCache instance to share load caches across contexts, and add an optional invalidate method to the LoadResultCache interface.