Skip to content

fix(@angular/build): support incremental asset updates and output cleanup in library watch mode - #34357

Open
alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:library-watch-cleanup
Open

alan-agius4 wants to merge 1 commit into
angular:mainfrom
alan-agius4:library-watch-cleanup

Conversation

@alan-agius4

@alan-agius4 alan-agius4 commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Ensure the library builder properly handles created, modified, and deleted assets during watch mode rebuilds, and removes stale bundle, sourcemap, and manifest output files from disk when entry points or exports are removed.

@alan-agius4 alan-agius4 added the target: minor This PR is targeted for the next minor release label Oct 15, 2026
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

/gemini review

@alan-agius4
alan-agius4 force-pushed the library-watch-cleanup branch from 55a2618 to 33a6418 Compare October 15, 2026 11:06

@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 new BuilderState class to manage incremental compilation state, transitive resource reference tracking, and output file cleanup across watch-mode rebuilds in the Angular library builder. It refactors the builder pipeline to utilize this state, improving watch-mode asset collection and output pruning. The review feedback suggests importing and using posix.join instead of the platform-specific join in entry-points_spec.ts to ensure platform-independent path joining and prevent test failures on Windows.

@alan-agius4
alan-agius4 force-pushed the library-watch-cleanup branch 6 times, most recently from 95027d8 to 3d8bea0 Compare October 15, 2026 17:44
…anup in library watch mode

Ensure the library builder properly handles created, modified, and deleted assets during watch mode rebuilds, and removes stale bundle, sourcemap, and manifest output files from disk when entry points or exports are removed.
@alan-agius4
alan-agius4 force-pushed the library-watch-cleanup branch from 3d8bea0 to 365b651 Compare October 15, 2026 18:03
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 15, 2026
@alan-agius4
alan-agius4 marked this pull request as ready for review October 15, 2026 18:04

@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 output tracking and cleanup capabilities for the Angular library builder in watch mode. It updates BuilderState to track emitted bundle files, manifest files, and assets across rebuilds, allowing it to identify and queue stale or deleted files for removal from disk. The asset collection pipeline and bundler have been updated to support this tracking, and a disk deletion step has been integrated into the build action. Additionally, comprehensive unit and integration tests have been added to verify watch-mode asset and output cleanup. No review comments were provided, so there is no feedback to address.

@alan-agius4
alan-agius4 requested a review from clydin October 15, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: review The PR is still awaiting reviews from at least one requested reviewer 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