Skip to content

perf(@angular/build): enable TypeScript incremental build cache in library builder - #34316

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:feat/library-persistent-cache
Oct 15, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:feat/library-persistent-cache

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Pass the normalized cacheOptions.path to compilationInstance.initialize when persistent disk caching is enabled so TypeScript writes and reuses .tsbuildinfo across builds.

@angular-robot angular-robot Bot added area: performance Issues related to performance area: @angular/build labels Oct 12, 2026

@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 enables persistent caching for the library builder by extracting cacheOptions and passing cachePath to the compilation options when caching is enabled. It also adds an integration test to verify that .tsbuildinfo is correctly written and reused. The review feedback recommends using optional chaining when accessing cacheOptions to prevent potential runtime TypeErrors if cacheOptions is undefined.

Comment thread packages/angular/build/src/builders/library/pipeline/compilation.ts
@alan-agius4
alan-agius4 requested a review from clydin October 12, 2026 13:17
@alan-agius4 alan-agius4 added target: minor This PR is targeted for the next minor release action: review The PR is still awaiting reviews from at least one requested reviewer labels Oct 12, 2026
@alan-agius4
alan-agius4 force-pushed the feat/library-persistent-cache branch 2 times, most recently from 133ef72 to c5703f5 Compare October 13, 2026 07:29
@alan-agius4
alan-agius4 requested review from clydin and removed request for clydin October 13, 2026 12:08
…brary builder

Pass the normalized `cacheOptions.path` to `compilationInstance.initialize` when persistent disk caching is enabled so TypeScript writes and reuses `.tsbuildinfo` across builds.
@alan-agius4
alan-agius4 force-pushed the feat/library-persistent-cache branch from c5703f5 to 93fef8b Compare October 13, 2026 13:57
@alan-agius4
alan-agius4 requested review from clydin and dgp1130 and removed request for clydin and dgp1130 October 13, 2026 16:03
@alan-agius4
alan-agius4 removed the request for review from dgp1130 October 15, 2026 05:25
@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 15, 2026
@alan-agius4
alan-agius4 merged commit 2b5a9a6 into angular:main Oct 15, 2026
40 checks passed
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

@alan-agius4
alan-agius4 deleted the feat/library-persistent-cache branch October 15, 2026 06:15
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 area: performance Issues related to performance 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