1 | /**
|
---|
2 | * @license
|
---|
3 | * Copyright Google LLC All Rights Reserved.
|
---|
4 | *
|
---|
5 | * Use of this source code is governed by an MIT-style license that can be
|
---|
6 | * found in the LICENSE file at https://angular.io/license
|
---|
7 | */
|
---|
8 | import { Identifiers } from './identifiers';
|
---|
9 | import * as o from './output/output_ast';
|
---|
10 | import { identifierName, typeSourceSpan } from './parse_util';
|
---|
11 | import { NgModuleProviderAnalyzer } from './provider_analyzer';
|
---|
12 | import { componentFactoryResolverProviderDef, providerDef } from './view_compiler/provider_compiler';
|
---|
13 | export class NgModuleCompileResult {
|
---|
14 | constructor(ngModuleFactoryVar) {
|
---|
15 | this.ngModuleFactoryVar = ngModuleFactoryVar;
|
---|
16 | }
|
---|
17 | }
|
---|
18 | const LOG_VAR = o.variable('_l');
|
---|
19 | export class NgModuleCompiler {
|
---|
20 | constructor(reflector) {
|
---|
21 | this.reflector = reflector;
|
---|
22 | }
|
---|
23 | compile(ctx, ngModuleMeta, extraProviders) {
|
---|
24 | const sourceSpan = typeSourceSpan('NgModule', ngModuleMeta.type);
|
---|
25 | const entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;
|
---|
26 | const bootstrapComponents = ngModuleMeta.bootstrapComponents;
|
---|
27 | const providerParser = new NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);
|
---|
28 | const providerDefs = [componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]
|
---|
29 | .concat(providerParser.parse().map((provider) => providerDef(ctx, provider)))
|
---|
30 | .map(({ providerExpr, depsExpr, flags, tokenExpr }) => {
|
---|
31 | return o.importExpr(Identifiers.moduleProviderDef).callFn([
|
---|
32 | o.literal(flags), tokenExpr, providerExpr, depsExpr
|
---|
33 | ]);
|
---|
34 | });
|
---|
35 | const ngModuleDef = o.importExpr(Identifiers.moduleDef).callFn([o.literalArr(providerDefs)]);
|
---|
36 | const ngModuleDefFactory = o.fn([new o.FnParam(LOG_VAR.name)], [new o.ReturnStatement(ngModuleDef)], o.INFERRED_TYPE);
|
---|
37 | const ngModuleFactoryVar = `${identifierName(ngModuleMeta.type)}NgFactory`;
|
---|
38 | this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, o.importExpr(Identifiers.createModuleFactory).callFn([
|
---|
39 | ctx.importExpr(ngModuleMeta.type.reference),
|
---|
40 | o.literalArr(bootstrapComponents.map(id => ctx.importExpr(id.reference))),
|
---|
41 | ngModuleDefFactory
|
---|
42 | ]));
|
---|
43 | if (ngModuleMeta.id) {
|
---|
44 | const id = typeof ngModuleMeta.id === 'string' ? o.literal(ngModuleMeta.id) :
|
---|
45 | ctx.importExpr(ngModuleMeta.id);
|
---|
46 | const registerFactoryStmt = o.importExpr(Identifiers.RegisterModuleFactoryFn)
|
---|
47 | .callFn([id, o.variable(ngModuleFactoryVar)])
|
---|
48 | .toStmt();
|
---|
49 | ctx.statements.push(registerFactoryStmt);
|
---|
50 | }
|
---|
51 | return new NgModuleCompileResult(ngModuleFactoryVar);
|
---|
52 | }
|
---|
53 | createStub(ctx, ngModuleReference) {
|
---|
54 | this._createNgModuleFactory(ctx, ngModuleReference, o.NULL_EXPR);
|
---|
55 | }
|
---|
56 | _createNgModuleFactory(ctx, reference, value) {
|
---|
57 | const ngModuleFactoryVar = `${identifierName({ reference: reference })}NgFactory`;
|
---|
58 | const ngModuleFactoryStmt = o.variable(ngModuleFactoryVar)
|
---|
59 | .set(value)
|
---|
60 | .toDeclStmt(o.importType(Identifiers.NgModuleFactory, [o.expressionType(ctx.importExpr(reference))], [o.TypeModifier.Const]), [o.StmtModifier.Final, o.StmtModifier.Exported]);
|
---|
61 | ctx.statements.push(ngModuleFactoryStmt);
|
---|
62 | }
|
---|
63 | }
|
---|
64 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdfbW9kdWxlX2NvbXBpbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4v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