forked from angular/angular
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(compiler-cli): use correct symbol name for default imported symbo…
…ls in defer blocks This commit addresses a problem with PR angular#53695 that introduced support for default imports, where the actual dynamic import used in the defer loading function continued to use the symbol name, instead of `.default` for the dynamic import. This issue went unnoticed in the testcase because a proper instance was being generated for the `ɵsetClassMetadataAsync` function, but not the generated dependency loader function. Fixes angular#54491
- Loading branch information
Showing
6 changed files
with
72 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
25 changes: 25 additions & 0 deletions
25
...s/compiler-cli/test/compliance/test_cases/r3_view_compiler_deferred/defer_default_deps.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
import CmpA from './defer_default_deps_ext'; | ||
|
||
@Component({ | ||
selector: 'local-dep', | ||
standalone: true, | ||
template: 'Local dependency', | ||
}) | ||
export class LocalDep { | ||
} | ||
|
||
@Component({ | ||
selector: 'test-cmp', | ||
standalone: true, | ||
imports: [CmpA, LocalDep], | ||
template: ` | ||
@defer { | ||
<cmp-a /> | ||
<local-dep /> | ||
} | ||
`, | ||
}) | ||
export class TestCmp { | ||
} |
5 changes: 5 additions & 0 deletions
5
...mpiler-cli/test/compliance/test_cases/r3_view_compiler_deferred/defer_default_deps_ext.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import {Component} from '@angular/core'; | ||
|
||
@Component({standalone: true, selector: 'cmp-a', template: 'CmpA!'}) | ||
export default class CmpA { | ||
} |
18 changes: 18 additions & 0 deletions
18
...r-cli/test/compliance/test_cases/r3_view_compiler_deferred/defer_default_deps_template.js
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const $TestCmp_Defer_1_DepsFn$ = () => [import("./defer_default_deps_ext").then(m => m.default), LocalDep]; | ||
|
||
function TestCmp_Defer_0_Template(rf, ctx) { | ||
if (rf & 1) { | ||
i0.ɵɵelement(0, "cmp-a")(1, "local-dep"); | ||
} | ||
} | ||
|
||
export class LocalDep { | ||
} | ||
|
||
… | ||
|
||
function TestCmp_Template(rf, ctx) { if (rf & 1) { | ||
i0.ɵɵtemplate(0, TestCmp_Defer_0_Template, 2, 0); | ||
i0.ɵɵdefer(1, 0, $TestCmp_Defer_1_DepsFn$); | ||
i0.ɵɵdeferOnIdle(); | ||
} } |
This file contains 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