deferredImports: partial output never loads the block, and the Angular 22.2 named form does not compile
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start with component/decorator.rs, transform/control_flow.rs, and partial/component.rs, which the issue identifies as the parsing, trigger, and partial emit paths. Compare the array and named forms against the reproduction and the ngtsc 22.2 behavior described in the issue. The work is done when the intended array-form behavior is decided and both forms compile and emit deferred dependencies correctly in full and partial modes.
由索引模型根據 Issue 內容生成。
描述
Summary
Two problems with @Component.deferredImports:
- With the array form, partial compilation emits no
deferBlockDependenciesand nodependencies. After linking, the block isɵɵdefer(1, 0), and the deferred component never loads or renders. - The Angular 22.2 named form (
deferredImports: {blk: [ChildCmp]}with@defer (name blk)) does not compile at all. It fails withUnrecognized trigger.
Found while re-checking #623.
Reproduction
// (i) array form. ngtsc 22.2 rejects it in full and partial mode.
@Component({
selector: 'app',
// @ts-ignore
deferredImports: [ChildCmp],
template: '@defer { <child-cmp /> }',
})
export class App {}
// (ii) named form, Angular 22.2
@Component({
selector: 'app',
deferredImports: {blk: [ChildCmp]},
template: '@defer (name blk) { <child-cmp /> }',
})
export class App {}
ChildCmp is imported from ./child.
| ngtsc 22.2.3 | oxc (main 5780233) | |
|---|---|---|
| (i) full | error: 'deferredImports' must be an object mapping block names to dependency arrays. |
accepted. The deps fn is inline, but import {ChildCmp} is kept, so the code is not split |
| (i) partial | same error | no deferBlockDependencies. After linking: ɵɵdefer(1, 0), and <child-cmp> never renders |
| (ii) full | const App_Defer_1_DepsFn = () => [import("./child").then(m => m.ChildCmp)], and the import is removed |
Unrecognized trigger. The source is returned untouched |
| (ii) partial | deferBlockDependencies: [() => [import("./child")…]] and ngDeclareClassMetadataAsync |
Unrecognized trigger |
Where
- The object form is not parsed:
component/decorator.rs(extract_identifier_array). nameis rejected as a trigger:transform/control_flow.rs.- Partial emit skips
deferBlockDependencies:partial/component.rs.
One question is a product call: should oxc keep accepting the array form, which ngtsc 22.2 rejects?
- 主要語言
- Rust
- 星號
- 245
- 分支
- 26
- 平均合併
- 22 小時 27 分鐘
- 30 天內合併 PR
- 106
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
voidzero-dev/oxc-angular-compiler 的其他 Issue
-
難度 5/5 一週以上 新手友好度 28/100
voidzero-dev/oxc-angular-compiler#623 · 2 則留言 ·
維護者通常 1 天內回覆
-
Support useDefineForClassFields: false (Class Field Lowering)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 5/5 一週以上 新手友好度 35/100
voidzero-dev/oxc-angular-compiler#73 · 11 則留言 ·
維護者通常 1 天內回覆
-
Angular 21.2.0 + @oxc-angular/vite 0.0.7 SSR runtime parity regressions (RouterLinkActive, Forms DI, Apollo DI) require app-level shims可能重新可做 @Brooooooklyn 於 243 天前認領,目前沒有進行中的 PR。 未關閉
voidzero-dev/oxc-angular-compiler#61 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
Angular 21.2.0 + @oxc-angular/vite 0.0.7 SSR: AngularNodeAppEngine is unusable (missing app-engine manifest)可能重新可做 @Brooooooklyn 於 243 天前認領,目前沒有進行中的 PR。 未關閉
voidzero-dev/oxc-angular-compiler#60 · 4 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
查看 voidzero-dev/oxc-angular-compiler 的全部 Issue
相似的 Issue
-
question
難度 1/5 1 小時以內 新手友好度 72/100
維護者通常 1 天內回覆
-
field-report
難度 2/5 1-3 小時 新手友好度 70/100
維護者通常 1 天內回覆
-
area:core
難度 2/5 1-3 小時 新手友好度 85/100
julian-hemmer/ypass#4 ·
-
難度 1/5 1 小時以內 新手友好度 70/100
-
難度 2/5 1-3 小時 新手友好度 62/100
davidkodar/klipp#3426 ·
維護者通常 1 天內回覆