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.
refactor(compiler-cli): ng module injector compilation in local mode
In local mode the compiler combines the raw imports and exports and pass them to the injector definition as the imports field. It is not possible to filter out ng modules at compile time though, and it will be done in runtime.
- Loading branch information
Showing
3 changed files
with
48 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,10 @@ | |
"imports_exports.js" | ||
] | ||
} | ||
], | ||
"compilationModeFilter": [ | ||
"full compile", | ||
"local compile" | ||
] | ||
}, | ||
{ | ||
|
31 changes: 31 additions & 0 deletions
31
...cli/test/compliance/test_cases/r3_compiler_compliance/ng_modules/imports_exports.local.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,31 @@ | ||
export class AModule {} | ||
AModule.ɵfac = function AModule_Factory(t) { return new (t || AModule)(); }; | ||
AModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AModule }); | ||
AModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [A1Component, A2Component] }); | ||
… | ||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AModule, [{ | ||
type: NgModule, | ||
args: [{ declarations: [A1Component, A2Component], exports: [A1Component, A2Component] }] | ||
}], null, null); })(); | ||
… | ||
|
||
export class BModule {} | ||
BModule.ɵfac = function BModule_Factory(t) { return new (t || BModule)(); }; | ||
BModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: BModule }); | ||
BModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [AModule] }); | ||
… | ||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BModule, [{ | ||
type: NgModule, | ||
args: [{ declarations: [B1Component, B2Component], exports: [AModule] }] | ||
}], null, null); })(); | ||
… | ||
|
||
export class AppModule {} | ||
AppModule.ɵfac = function AppModule_Factory(t) { return new (t || AppModule)(); }; | ||
AppModule.ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: AppModule }); | ||
AppModule.ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [BModule] }); | ||
… | ||
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AppModule, [{ | ||
type: NgModule, | ||
args: [{ imports: [BModule] }] | ||
}], null, null); })(); |