Skip to content

refactor(@angular/build): collect and log build errors in library builder - #34328

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix/library-error-logging
Oct 14, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:fix/library-error-logging

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Instead of throwing errors inside buildAction and compileLibrary during progress spinner execution, collect formatted diagnostic errors, warnings, and informational logs into BuildActionResult and log them via context.logger after withProgress completes, matching the behavior of the application builder.

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

Instead of throwing errors inside `buildAction` and `compileLibrary` during progress spinner execution, collect formatted diagnostic errors, warnings, and informational logs into `BuildActionResult` and log them via `context.logger` after `withProgress` completes, matching the behavior of the `application` builder.
@alan-agius4
alan-agius4 force-pushed the fix/library-error-logging branch from 2973f1f to c22b3bf Compare October 13, 2026 14:55
@alan-agius4
alan-agius4 requested a review from clydin October 13, 2026 16:05
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Oct 13, 2026
@alan-agius4
alan-agius4 marked this pull request as ready for review October 13, 2026 16:05

@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 refactors the library builder pipeline to aggregate and log build diagnostics (errors, warnings, and informational logs) as structured results (BuildActionResult) rather than throwing exceptions immediately. Key changes include updating buildAction, compileLibrary, and dependency verification to return diagnostic messages, introducing helper functions like logMessages and collectEntryPointsToBundle, and updating corresponding unit tests to assert on the logged output. I have no feedback to provide as there are no review comments.

@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 Oct 13, 2026
@alan-agius4
alan-agius4 merged commit 1e97eff into angular:main Oct 14, 2026
42 checks passed
@alan-agius4
alan-agius4 deleted the fix/library-error-logging branch October 14, 2026 06: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