[6a3a178] | 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 | (function (factory) {
|
---|
| 9 | if (typeof module === "object" && typeof module.exports === "object") {
|
---|
| 10 | var v = factory(require, exports);
|
---|
| 11 | if (v !== undefined) module.exports = v;
|
---|
| 12 | }
|
---|
| 13 | else if (typeof define === "function" && define.amd) {
|
---|
| 14 | define("@angular/compiler/src/ng_module_compiler", ["require", "exports", "@angular/compiler/src/identifiers", "@angular/compiler/src/output/output_ast", "@angular/compiler/src/parse_util", "@angular/compiler/src/provider_analyzer", "@angular/compiler/src/view_compiler/provider_compiler"], factory);
|
---|
| 15 | }
|
---|
| 16 | })(function (require, exports) {
|
---|
| 17 | "use strict";
|
---|
| 18 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
| 19 | exports.NgModuleCompiler = exports.NgModuleCompileResult = void 0;
|
---|
| 20 | var identifiers_1 = require("@angular/compiler/src/identifiers");
|
---|
| 21 | var o = require("@angular/compiler/src/output/output_ast");
|
---|
| 22 | var parse_util_1 = require("@angular/compiler/src/parse_util");
|
---|
| 23 | var provider_analyzer_1 = require("@angular/compiler/src/provider_analyzer");
|
---|
| 24 | var provider_compiler_1 = require("@angular/compiler/src/view_compiler/provider_compiler");
|
---|
| 25 | var NgModuleCompileResult = /** @class */ (function () {
|
---|
| 26 | function NgModuleCompileResult(ngModuleFactoryVar) {
|
---|
| 27 | this.ngModuleFactoryVar = ngModuleFactoryVar;
|
---|
| 28 | }
|
---|
| 29 | return NgModuleCompileResult;
|
---|
| 30 | }());
|
---|
| 31 | exports.NgModuleCompileResult = NgModuleCompileResult;
|
---|
| 32 | var LOG_VAR = o.variable('_l');
|
---|
| 33 | var NgModuleCompiler = /** @class */ (function () {
|
---|
| 34 | function NgModuleCompiler(reflector) {
|
---|
| 35 | this.reflector = reflector;
|
---|
| 36 | }
|
---|
| 37 | NgModuleCompiler.prototype.compile = function (ctx, ngModuleMeta, extraProviders) {
|
---|
| 38 | var sourceSpan = parse_util_1.typeSourceSpan('NgModule', ngModuleMeta.type);
|
---|
| 39 | var entryComponentFactories = ngModuleMeta.transitiveModule.entryComponents;
|
---|
| 40 | var bootstrapComponents = ngModuleMeta.bootstrapComponents;
|
---|
| 41 | var providerParser = new provider_analyzer_1.NgModuleProviderAnalyzer(this.reflector, ngModuleMeta, extraProviders, sourceSpan);
|
---|
| 42 | var providerDefs = [provider_compiler_1.componentFactoryResolverProviderDef(this.reflector, ctx, 0 /* None */, entryComponentFactories)]
|
---|
| 43 | .concat(providerParser.parse().map(function (provider) { return provider_compiler_1.providerDef(ctx, provider); }))
|
---|
| 44 | .map(function (_a) {
|
---|
| 45 | var providerExpr = _a.providerExpr, depsExpr = _a.depsExpr, flags = _a.flags, tokenExpr = _a.tokenExpr;
|
---|
| 46 | return o.importExpr(identifiers_1.Identifiers.moduleProviderDef).callFn([
|
---|
| 47 | o.literal(flags), tokenExpr, providerExpr, depsExpr
|
---|
| 48 | ]);
|
---|
| 49 | });
|
---|
| 50 | var ngModuleDef = o.importExpr(identifiers_1.Identifiers.moduleDef).callFn([o.literalArr(providerDefs)]);
|
---|
| 51 | var ngModuleDefFactory = o.fn([new o.FnParam(LOG_VAR.name)], [new o.ReturnStatement(ngModuleDef)], o.INFERRED_TYPE);
|
---|
| 52 | var ngModuleFactoryVar = parse_util_1.identifierName(ngModuleMeta.type) + "NgFactory";
|
---|
| 53 | this._createNgModuleFactory(ctx, ngModuleMeta.type.reference, o.importExpr(identifiers_1.Identifiers.createModuleFactory).callFn([
|
---|
| 54 | ctx.importExpr(ngModuleMeta.type.reference),
|
---|
| 55 | o.literalArr(bootstrapComponents.map(function (id) { return ctx.importExpr(id.reference); })),
|
---|
| 56 | ngModuleDefFactory
|
---|
| 57 | ]));
|
---|
| 58 | if (ngModuleMeta.id) {
|
---|
| 59 | var id = typeof ngModuleMeta.id === 'string' ? o.literal(ngModuleMeta.id) :
|
---|
| 60 | ctx.importExpr(ngModuleMeta.id);
|
---|
| 61 | var registerFactoryStmt = o.importExpr(identifiers_1.Identifiers.RegisterModuleFactoryFn)
|
---|
| 62 | .callFn([id, o.variable(ngModuleFactoryVar)])
|
---|
| 63 | .toStmt();
|
---|
| 64 | ctx.statements.push(registerFactoryStmt);
|
---|
| 65 | }
|
---|
| 66 | return new NgModuleCompileResult(ngModuleFactoryVar);
|
---|
| 67 | };
|
---|
| 68 | NgModuleCompiler.prototype.createStub = function (ctx, ngModuleReference) {
|
---|
| 69 | this._createNgModuleFactory(ctx, ngModuleReference, o.NULL_EXPR);
|
---|
| 70 | };
|
---|
| 71 | NgModuleCompiler.prototype._createNgModuleFactory = function (ctx, reference, value) {
|
---|
| 72 | var ngModuleFactoryVar = parse_util_1.identifierName({ reference: reference }) + "NgFactory";
|
---|
| 73 | var ngModuleFactoryStmt = o.variable(ngModuleFactoryVar)
|
---|
| 74 | .set(value)
|
---|
| 75 | .toDeclStmt(o.importType(identifiers_1.Identifiers.NgModuleFactory, [o.expressionType(ctx.importExpr(reference))], [o.TypeModifier.Const]), [o.StmtModifier.Final, o.StmtModifier.Exported]);
|
---|
| 76 | ctx.statements.push(ngModuleFactoryStmt);
|
---|
| 77 | };
|
---|
| 78 | return NgModuleCompiler;
|
---|
| 79 | }());
|
---|
| 80 | exports.NgModuleCompiler = NgModuleCompiler;
|
---|
| 81 | });
|
---|
| 82 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmdfbW9kdWxlX2NvbXBpbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29tcGlsZXIvc3JjL25nX21vZHVsZV9jb21waWxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dB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