Skip to content

refactor(@angular/build): replace maxThreads with maxConcurrency option in i18n inliner - #33993

Open
clydin wants to merge 1 commit into
angular:mainfrom
clydin:refactor/i18n-inliner-max-concurrency
Open

refactor(@angular/build): replace maxThreads with maxConcurrency option in i18n inliner#33993
clydin wants to merge 1 commit into
angular:mainfrom
clydin:refactor/i18n-inliner-max-concurrency

Conversation

@clydin

@clydin clydin commented Sep 2, 2026

Copy link
Copy Markdown
Member

The I18nInliner constructor previously accepted an optional maxThreads parameter as a second argument, while sliding window sizing and batch sharding calculations accessed this.#workerPool.maxThreads directly. This couples the inliner concurrency planning to the worker pool construction argument and makes it awkward to configure when using or moving toward shared worker pools.

This change adds maxConcurrency to I18nInlinerOptions and removes the separate maxThreads constructor parameter. The internal #maxConcurrency getter prioritizes options.maxConcurrency before falling back to the worker pool thread count. All call sites and tests now pass maxConcurrency through the options object.

@clydin clydin added the target: minor This PR is targeted for the next minor release label Sep 2, 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 refactors the I18nInliner class to accept maxConcurrency as an option within the I18nInlinerOptions object instead of a separate constructor argument. It also adds validation to ensure maxConcurrency is an integer greater than or equal to 1, and updates the corresponding unit tests. The feedback suggests simplifying the conditional object spread when initializing the WorkerPool by passing options.maxConcurrency directly, which improves code readability.

Comment thread packages/angular/build/src/tools/esbuild/i18n-inliner.ts
…on in i18n inliner

The I18nInliner constructor previously accepted an optional maxThreads parameter as a second argument, while sliding window sizing and batch sharding calculations accessed this.#workerPool.maxThreads directly. This couples the inliner concurrency planning to the worker pool construction argument and makes it awkward to configure when using or moving toward shared worker pools.

This change adds maxConcurrency to I18nInlinerOptions and removes the separate maxThreads constructor parameter. The internal #maxConcurrency getter prioritizes options.maxConcurrency before falling back to the worker pool thread count. All call sites and tests now pass maxConcurrency through the options object.
@clydin
clydin force-pushed the refactor/i18n-inliner-max-concurrency branch from 7cc5199 to 1d48a37 Compare September 2, 2026 15:09
@clydin clydin added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 2, 2026
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