Skip to content

refactor(@angular/build): relocate non-esbuild utilities out of tools/esbuild - #34132

Merged
alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:refactor/relocate-non-esbuild-utils
Sep 21, 2026
Merged

alan-agius4 merged 1 commit into
angular:mainfrom
alan-agius4:refactor/relocate-non-esbuild-utils

Conversation

@alan-agius4

Copy link
Copy Markdown
Collaborator

Relocate several utilities from packages/angular/build/src/tools/esbuild to more appropriate locations, as they are not specific to esbuild:

  • File Watcher: Moved watcher.ts and watcher_spec.ts to src/utils/watcher.ts.
  • Profiling: Moved profiling.ts to src/utils/profiling.ts.
  • Caching Infrastructure: Moved cache.ts, sqlite-cache-store.ts, and lmdb-cache-store.ts (along with tests) to src/utils/cache/.
  • JavaScript Transformer: Moved javascript-transformer.ts, javascript-transformer-worker.ts, and spec to src/tools/javascript-transformer/.
  • i18n Inlining & Translation Handling: Moved i18n-inliner.ts, i18n-inliner-worker.ts, i18n-translation-reader.ts, and i18n-translation-encoder.ts to src/tools/i18n/. Extracted locale data resolution/loading into src/tools/i18n/locale-data.ts.
  • Application Index HTML Generation: Moved index-html-generator.ts to src/builders/application/index-html-generator.ts.

@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 reorganizes and refactors several internal build utilities and tools, moving modules like the watcher, profiling, cache, i18n inliner, and JavaScript transformer to more appropriate or generic directories (such as utils/ or dedicated tool directories) and updating their import paths across the codebase. Feedback on these changes highlights a potential issue in packages/angular/build/src/tools/i18n/locale-data.ts, where a rejected promise in loadLocaleData could be permanently cached in localeDataCache. It is recommended to add a .catch() handler to evict the rejected promise from the cache to allow recovery or retries.

Comment thread packages/angular/build/src/tools/i18n/locale-data.ts
…/esbuild

Relocate several utilities from `src/tools/esbuild` to more appropriate locations, as they are not specific to esbuild:
- `watcher.ts`: moved to `src/utils/watcher.ts`.
- `profiling.ts`: moved to `src/utils/profiling.ts`.
- `cache.ts`, `sqlite-cache-store.ts`, `lmdb-cache-store.ts`: moved to `src/utils/cache/`.
- `javascript-transformer.ts`, `javascript-transformer-worker.ts`: moved to `src/tools/javascript-transformer/`.
- `i18n-inliner.ts`, `i18n-inliner-worker.ts`, `i18n-translation-*`: moved to `src/tools/i18n/`, with locale data helpers in `src/tools/i18n/locale-data.ts`.
- `index-html-generator.ts`: moved to `src/builders/application/index-html-generator.ts`.
@alan-agius4
alan-agius4 force-pushed the refactor/relocate-non-esbuild-utils branch from 8812237 to 9fd8753 Compare September 21, 2026 10:47
@alan-agius4 alan-agius4 added the target: rc This PR is targeted for the next release-candidate label Sep 21, 2026
@alan-agius4
alan-agius4 requested a review from clydin September 21, 2026 11:05
@alan-agius4 alan-agius4 added the action: review The PR is still awaiting reviews from at least one requested reviewer label Sep 21, 2026
@alan-agius4 alan-agius4 added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Sep 21, 2026
@alan-agius4
alan-agius4 merged commit eb1edeb into angular:main Sep 21, 2026
41 of 42 checks passed
@alan-agius4
alan-agius4 deleted the refactor/relocate-non-esbuild-utils branch September 21, 2026 13:37
@alan-agius4

Copy link
Copy Markdown
Collaborator Author

This PR was merged into the repository. The changes were merged into the following branches:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: merge The PR is ready for merge by the caretaker area: @angular/build target: rc This PR is targeted for the next release-candidate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants