feat(ivy): ngtsc compiles @Component, @Directive, @NgModule (#24427)

This change supports compilation of components, directives, and modules
within ngtsc. Support is not complete, but is enough to compile and test
//packages/core/test/bundling/todo in full AOT mode. Code size benefits
are not yet achieved as //packages/core itself does not get compiled, and
some decorators (e.g. @Input) are not stripped, leading to unwanted code
being retained by the tree-shaker. This will be improved in future commits.

PR Close #24427
This commit is contained in:
Alex Rickabaugh
2018-05-31 15:50:02 -07:00
committed by Miško Hevery
parent 0f7e4fae20
commit 27bc7dcb43
69 changed files with 1884 additions and 607 deletions

View File

@ -389,6 +389,7 @@ export class TestBed implements Injector {
providers: [
...rootProviderOverrides,
],
jit: true,
})
class RootScopeModule {
}
@ -399,7 +400,7 @@ export class TestBed implements Injector {
const imports = [rootScopeImports, this.ngModule, this._imports];
const schemas = this._schemas;
@NgModule({providers, declarations, imports, schemas})
@NgModule({providers, declarations, imports, schemas, jit: true})
class DynamicTestModule {
}
@ -540,7 +541,7 @@ export class TestBed implements Injector {
overrideTemplateUsingTestingModule(component: Type<any>, template: string) {
this._assertNotInstantiated('overrideTemplateUsingTestingModule', 'override template');
@Component({selector: 'empty', template})
@Component({selector: 'empty', template, jit: true})
class OverrideComponent {
}