Skip to content

fix(@angular/build): miscellaneous build correctness and cache fixes - #34085

Merged
alan-agius4 merged 3 commits into
angular:mainfrom
alan-agius4:fix-build-esbuild-correctness
Sep 11, 2026
Merged

fix(@angular/build): miscellaneous build correctness and cache fixes#34085
alan-agius4 merged 3 commits into
angular:mainfrom
alan-agius4:fix-build-esbuild-correctness

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

This PR extracts several general build correctness and caching fixes that were previously included in #33909, addressing review feedback from @clydin:

  • Inline component stylesheets: Collect referenced files from inline stylesheet contexts in addition to file contexts when gathering watch files, and catch unhandled rejections when disposing an inline bundler context.
  • Polyfill bundle options: Ensure sourceFileCache.loadResultCache is forwarded when creating compiler plugin options for browser polyfills, escape the file extension regex in entryFileToWorkspaceRelative, and add a missing semicolon in SSR bundle options.
  • Bundler context caching: Introduce an invalidation epoch guard to prevent caching stale esbuild results when an invalidation occurs while bundling is in-flight, and correctly await load cache checks before falling back to alternate keys.

…ed watch files

Collect referenced files from inline stylesheet contexts in addition to
file contexts when gathering watch files, and catch unhandled rejections
when disposing an inline bundler context.
…tension regex in polyfills

Ensure sourceFileCache.loadResultCache is forwarded when creating compiler
plugin options for browser polyfills, escape the file extension regex in
entryFileToWorkspaceRelative, and add a missing semicolon in SSR bundle options.

@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 several improvements and bug fixes to the Angular build tools. Key changes include adding error handling to bundler disposal, collecting referenced files from inline contexts, fixing a regular expression to properly escape a dot, and correcting the asynchronous cache retrieval logic in BundlerContext. Additionally, an invalidation epoch mechanism was introduced to prevent caching outdated build results when invalidation occurs during an active build. Since there are no review comments, no further feedback is provided.

@alan-agius4
alan-agius4 requested a review from clydin September 11, 2026 15:09
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer target: minor This PR is targeted for the next minor release labels Sep 11, 2026
…lve load cache

Introduce an invalidation epoch guard to prevent caching stale esbuild results
when an invalidation occurs while bundling is in-flight, and correctly await load
cache checks before falling back to alternate keys.
@alan-agius4
alan-agius4 force-pushed the fix-build-esbuild-correctness branch from 8e5b7a9 to 6a0b76e Compare September 11, 2026 15:13
@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 Sep 11, 2026
@alan-agius4
alan-agius4 merged commit 31c0456 into angular:main Sep 11, 2026
40 checks passed
@alan-agius4
alan-agius4 deleted the fix-build-esbuild-correctness branch September 11, 2026 15:30
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

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