Repository navigation
fix(@angular/build): scope BundlerContext invalidation and error watch files - #34429
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
…shot bundle results Ensure `BundlerContext.invalidate()` only clears `#esbuildResult` when a changed file is in `this.watchFiles` while still invalidating `#loadCache`, preventing edits to one component stylesheet from invalidating all other components sharing the same `MemoryLoadResultCache`. Also scope `#addLoadCacheFilesToWatch()` to the load cache keys accessed by the current `BundlerContext`, retain `watchFiles` across failed rebuilds while tracking entry points and unresolved relative imports on build failures, and cache `#esbuildResult` in non-incremental builds so multiple components sharing the same `styleUrl` do not re-run esbuild.
…he one-shot bundle results
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
BundlerContext.invalidate()tothis.watchFiles:BundlerContextinstances share aMemoryLoadResultCache(such as all component stylesheet contexts inComponentStylesheetBundler),this.#loadCache.invalidate(file)returnstruefor any file present in the shared cache regardless of whether the currentBundlerContextever loaded it.this.#loadCache.invalidate(file)is still invoked for changed files, but only mark theBundlerContextas invalid (and clearthis.#esbuildResult) when a changed file is present inthis.watchFiles.watchFilestracking and preserve transitive CSS error recovery:this.#loadCacheper incrementalBundlerContext(this.#loadCacheKeys) so#addLoadCacheFilesToWatch()only adds watch files for keys loaded by that context rather than copying all components' watch files from the shared cache.this.watchFilesacross failed rebuilds (only clearing on successful builds) and ensure non-internal entry points, error/note locations, and unresolved relative imports are added tothis.watchFilesonBuildFailure.ngwrBenchmark Resultsmain