Skip to content

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

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 14, 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 and manifest output files when entry points or exports change.

@alan-agius4

Copy link
Copy Markdown
Collaborator 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 updates the Angular library builder to normalize all file and directory paths to POSIX format, and introduces robust watch-mode cleanup for deleted assets, manifest files, and bundle files. Feedback on these changes highlights that the rm call used for cleanup should include recursive: true so that maxRetries is not ignored, and any deletion failures should be logged as warnings rather than silently ignored.

Comment thread packages/angular/build/src/builders/library/pipeline/build-action.ts Outdated
@alan-agius4
alan-agius4 force-pushed the library-watch-cleanup branch from 13b80df to 78c5a6a Compare October 14, 2026 09:16
@alan-agius4 alan-agius4 reopened this Oct 14, 2026
@alan-agius4 alan-agius4 added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews state: blocked target: minor This PR is targeted for the next minor release and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Oct 14, 2026
@alan-agius4
alan-agius4 force-pushed the library-watch-cleanup branch 2 times, most recently from c126333 to 638cdb6 Compare October 14, 2026 15:41
@alan-agius4 alan-agius4 added action: review The PR is still awaiting reviews from at least one requested reviewer and removed state: blocked labels Oct 14, 2026
@alan-agius4
alan-agius4 requested a review from clydin October 14, 2026 16:59
@alan-agius4
alan-agius4 marked this pull request as ready for review October 14, 2026 16:59
…anup in library watch mode

Ensure the library builder properly handles created, modified, and deleted assets during watch mode rebuilds, and removes stale bundle and manifest output files when entry points or exports change.
@alan-agius4
alan-agius4 force-pushed the library-watch-cleanup branch from 638cdb6 to 202d2f0 Compare October 14, 2026 17:01

@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 implements asset and output cleanup in watch mode for the library builder. It introduces tracking for emitted bundle files, manifest files, and assets, ensuring that files are correctly removed from the output directory when their source files are deleted or when entry points are removed. My review highlights a potential issue where source files matching multiple asset patterns might not be fully cleaned up due to the current emittedAssets map structure, and suggests using path.posix.join for consistency when handling output paths.

Comment thread packages/angular/build/src/builders/library/types.ts
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