refactor(@angular/build): support supplying worker pool to i18n inliner - #34084
Draft
clydin wants to merge 1 commit into
Draft
refactor(@angular/build): support supplying worker pool to i18n inliner#34084clydin wants to merge 1 commit into
clydin wants to merge 1 commit into
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
I18nInlinerclass previously created a dedicatedWorkerPoolinstance 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
I18nInlinerconstructor to accept an optionalworkerPoolargument 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
inlineI18napplication builder helper is also updated to accept an optionalworkerPoolparameter and forward it to the inliner constructor, enabling callers and future shared build orchestration to pass through a common worker pool.