You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit af5be90
Browse filesBrowse the repository at this point in the historyBrowse files
refactor(@angular/build): avoid loading localize tools and babel in i18n inliner worker
Previously, `i18n-inliner-worker.ts` dynamically loaded `@angular/localize/tools`
to invoke its `translate()` function and `Diagnostics` class. Importing
`@angular/localize/tools` eagerly pulls in `@babel/core`, `@angular/compiler-cli`,
and `@angular/compiler`, consuming ~180 ms of CPU latency and ~32 MB of heap per
worker thread upon first translation.
Since the inliner only performs string translation replacements using AST locations
already discovered via OXC, the full Babel transformation and compiler tooling
bundle is unnecessary.
This updates `i18n-inliner-worker.ts` to directly import low-level runtime functions
(`ɵtranslate`, `ɵisMissingTranslationError`, `ɵmakeTemplateObject`) from
`@angular/localize` and manage diagnostics via a direct message array. This completely
avoids loading `@angular/localize/tools` and its heavy transitive dependencies.
0 commit comments