Skip to content

refactor(@angular/build): support supplying worker pool to i18n inliner - #34084

Draft
clydin wants to merge 1 commit into
angular:mainfrom
clydin:refactor/i18n-inliner-worker-pool
Draft

refactor(@angular/build): support supplying worker pool to i18n inliner#34084
clydin wants to merge 1 commit into
angular:mainfrom
clydin:refactor/i18n-inliner-worker-pool

Conversation

@clydin

@clydin clydin commented Sep 11, 2026

Copy link
Copy Markdown
Member

The I18nInliner class previously created a dedicated WorkerPool instance on every construction and unconditionally destroyed it when closed. In watch mode and across build executions, this led to unnecessary worker thread lifecycle overhead and prevented reusing existing thread pools across post-bundle phases.

This change updates the I18nInliner constructor to accept an optional workerPool argument directly as a second parameter. When provided, the supplied worker pool is used for all transformation task executions and is treated as an external borrowed dependency that is not destroyed when close is invoked. When omitted, the inliner continues to create and manage its own dedicated worker pool as before.

The inlineI18n application builder helper is also updated to accept an optional workerPool parameter and forward it to the inliner constructor, enabling callers and future shared build orchestration to pass through a common worker pool.

The I18nInliner class previously created a dedicated WorkerPool instance on every construction and unconditionally destroyed it when closed. In watch mode and across build executions, this led to unnecessary worker thread lifecycle overhead and prevented reusing existing thread pools across post-bundle phases.

This change updates the I18nInliner constructor to accept an optional workerPool argument directly as a second parameter. When provided, the supplied worker pool is used for all transformation task executions and is treated as an external borrowed dependency that is not destroyed when close is invoked. When omitted, the inliner continues to create and manage its own dedicated worker pool as before.

The inlineI18n application builder helper is also updated to accept an optional workerPool parameter and forward it to the inliner constructor, enabling callers and future shared build orchestration to pass through a common worker pool.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant