Esbuild Web Worker Type Safety and Redundant tsconfig.worker.json
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 35/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- angular, typescript
- 領域
- build-system, cli
研究方向
首先重現所描述的 Angular CLI esbuild 工作流程:產生一個 web worker,加入型別錯誤,然後執行 ng build。檢查產生的 tsconfig.worker.json,以及 builder schema 中的 webWorkerTsConfig 選項。當 worker 的型別檢查行為獲得修正或清楚記錄,且誤導性的設定已獲處理時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
Command
build
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
No response
Description
When using esbuild as the bundler for Angular projects, the support for web workers appears misleading in terms of type safety:
-
In the previous webpack-based build setup, web workers had proper TypeScript type checking at build time.
-
Currently, esbuild does not type-check web workers during build time. This is not documented or clearly communicated, leading to a false sense of correctness.
-
Additionally, creating a project with a web worker generates a
tsconfig.worker.json, which seems redundant because esbuild doesn't use it for type-checking. Alsobuildercontains thewebWorkerTsConfigoption in the schema, as I understand it, this doesn't affect anything. This can confuse developers into thinking their web worker code is properly validated.
Expected Behavior
Either esbuild-based builder should perform type checking on web worker files, or there should be clear documentation and/or warnings that type-checking is not performed on workers.
Current Behavior
-
No build-time type checking for worker code.
-
Misleading tsconfig.worker.json is generated, giving false confidence in type safety.
Minimal Reproduction
- Generate a new Angular project with esbuild (Angular CLI 18+).
- Add a web worker via ng generate web-worker.
- Introduce a type error in the worker file.
- Run ng build – no type error is reported.
Exception or Error
Your Environment
Any version with esbuild bundler.
Anything else relevant?
No response
- 主要語言
- TypeScript
- 星號
- 27k
- 分支
- 11.8k
- 平均合併
- 17 小時 21 分鐘
- 30 天內合併 PR
- 181
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
angular/angular-cli 的其他 Issue
-
area: @angular/build gemini-triaged
難度 2/5 1-3 小時 新手友好度 74/100
angular/angular-cli#33955 ·
-
area: @angular/cli gemini-triaged
難度 2/5 1-3 小時 新手友好度 72/100
angular/angular-cli#33055 · 1 則留言 · 3 個 reaction ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34131 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34130 · 已指派 1 人 ·
-
angular/build:library area: @angular/build gemini-triaged
angular/angular-cli#34128 · 已指派 1 人 ·
查看 angular/angular-cli 的全部 Issue
相似的 Issue
-
bug(cli): hapi doctor inline-media prints a fabricated B:\ helper-script path in packaged installs 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
-
Crush 未關閉
難度 1/5 1 小時以內 新手友好度 85/100
catppuccin/catppuccin#3125 ·
-
難度 1/5 1 小時以內 新手友好度 90/100
ElementsProject/cln-application#167 · 1 則留言 · 1 個 reaction ·
-
難度 2/5 1-3 小時 新手友好度 75/100
Quantco/pnpm-licenses#17 ·
-
難度 2/5 1-3 小時 新手友好度 75/100