refactor(@angular/build): add typed helper for worker pool execution in i18n inliner - #33985
Merged
clydin merged 3 commits intoSep 2, 2026
Merged
Conversation
There was a problem hiding this comment.
Code Review
This pull request improves type safety and readability in the i18n inliner tool by exporting worker-related interfaces and introducing a typed #runWorkerTask helper method in I18nInliner. The reviewer suggested adding an explicit type assertion to the return value of #runWorkerTask to prevent potential compilation errors under strict TypeScript configurations, as the underlying worker pool run method returns Promise<unknown>.
clydin
force-pushed
the
refactor/i18n-inliner-worker-task-helper
branch
from
September 1, 2026 16:02
a88038f to
7ecc61b
Compare
…in i18n inliner
Add a strongly-typed private helper method #runWorkerTask to I18nInliner to encapsulate worker pool execution.
The helper maps worker task names ('inlineFileBatch' and 'inlineCode') to their exact request and result types exported from the worker module. This eliminates manual type assertions and untyped return values while centralizing worker pool task dispatch.
… inliner Remove workerData from the i18n inliner worker pool initialization and pass missingTranslation per task in the request payload. This decouples the worker pool from inliner-specific options, allowing worker threads to be safely shared without hardcoding the missingTranslation handling behavior at pool creation time.
clydin
force-pushed
the
refactor/i18n-inliner-worker-task-helper
branch
from
September 1, 2026 22:08
7ecc61b to
e9baeb7
Compare
…iner task execution Specify the worker target file directly in each task run option via #runWorkerTask rather than hardcoding a default filename during WorkerPool instantiation. To prepare for ESM transition and avoid reliance on ambient require, createRequire is used to resolve the inliner worker script path. Explicitly specifying the worker file per task enables the inliner to run against general-purpose or shared worker pools that do not have a preconfigured default script.
alan-agius4
approved these changes
Sep 2, 2026
Member
Author
|
This PR was merged into the repository. The changes were merged into the following branches:
|
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.
Add a strongly-typed private helper method #runWorkerTask to I18nInliner to encapsulate worker pool execution.
The helper maps worker task names ('inlineFileBatch' and 'inlineCode') to their exact request and result types exported from the worker module. This eliminates manual type assertions and untyped return values while centralizing worker pool task dispatch.