source: trip-planner-front/node_modules/@angular/compiler/src/jit/compiler.js@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 56.0 KB
Line 
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/jit/compiler", ["require", "exports", "@angular/compiler/src/compile_metadata", "@angular/compiler/src/constant_pool", "@angular/compiler/src/output/output_ast", "@angular/compiler/src/output/output_interpreter", "@angular/compiler/src/parse_util", "@angular/compiler/src/util"], factory);
15 }
16})(function (require, exports) {
17 "use strict";
18 Object.defineProperty(exports, "__esModule", { value: true });
19 exports.JitCompiler = void 0;
20 var compile_metadata_1 = require("@angular/compiler/src/compile_metadata");
21 var constant_pool_1 = require("@angular/compiler/src/constant_pool");
22 var ir = require("@angular/compiler/src/output/output_ast");
23 var output_interpreter_1 = require("@angular/compiler/src/output/output_interpreter");
24 var parse_util_1 = require("@angular/compiler/src/parse_util");
25 var util_1 = require("@angular/compiler/src/util");
26 /**
27 * An internal module of the Angular compiler that begins with component types,
28 * extracts templates, and eventually produces a compiled version of the component
29 * ready for linking into an application.
30 *
31 * @security When compiling templates at runtime, you must ensure that the entire template comes
32 * from a trusted source. Attacker-controlled data introduced by a template could expose your
33 * application to XSS risks. For more detail, see the [Security Guide](https://g.co/ng/security).
34 */
35 var JitCompiler = /** @class */ (function () {
36 function JitCompiler(_metadataResolver, _templateParser, _styleCompiler, _viewCompiler, _ngModuleCompiler, _summaryResolver, _reflector, _jitEvaluator, _compilerConfig, _console, getExtraNgModuleProviders) {
37 this._metadataResolver = _metadataResolver;
38 this._templateParser = _templateParser;
39 this._styleCompiler = _styleCompiler;
40 this._viewCompiler = _viewCompiler;
41 this._ngModuleCompiler = _ngModuleCompiler;
42 this._summaryResolver = _summaryResolver;
43 this._reflector = _reflector;
44 this._jitEvaluator = _jitEvaluator;
45 this._compilerConfig = _compilerConfig;
46 this._console = _console;
47 this.getExtraNgModuleProviders = getExtraNgModuleProviders;
48 this._compiledTemplateCache = new Map();
49 this._compiledHostTemplateCache = new Map();
50 this._compiledDirectiveWrapperCache = new Map();
51 this._compiledNgModuleCache = new Map();
52 this._sharedStylesheetCount = 0;
53 this._addedAotSummaries = new Set();
54 }
55 JitCompiler.prototype.compileModuleSync = function (moduleType) {
56 return util_1.SyncAsync.assertSync(this._compileModuleAndComponents(moduleType, true));
57 };
58 JitCompiler.prototype.compileModuleAsync = function (moduleType) {
59 return Promise.resolve(this._compileModuleAndComponents(moduleType, false));
60 };
61 JitCompiler.prototype.compileModuleAndAllComponentsSync = function (moduleType) {
62 return util_1.SyncAsync.assertSync(this._compileModuleAndAllComponents(moduleType, true));
63 };
64 JitCompiler.prototype.compileModuleAndAllComponentsAsync = function (moduleType) {
65 return Promise.resolve(this._compileModuleAndAllComponents(moduleType, false));
66 };
67 JitCompiler.prototype.getComponentFactory = function (component) {
68 var summary = this._metadataResolver.getDirectiveSummary(component);
69 return summary.componentFactory;
70 };
71 JitCompiler.prototype.loadAotSummaries = function (summaries) {
72 this.clearCache();
73 this._addAotSummaries(summaries);
74 };
75 JitCompiler.prototype._addAotSummaries = function (fn) {
76 if (this._addedAotSummaries.has(fn)) {
77 return;
78 }
79 this._addedAotSummaries.add(fn);
80 var summaries = fn();
81 for (var i = 0; i < summaries.length; i++) {
82 var entry = summaries[i];
83 if (typeof entry === 'function') {
84 this._addAotSummaries(entry);
85 }
86 else {
87 var summary = entry;
88 this._summaryResolver.addSummary({ symbol: summary.type.reference, metadata: null, type: summary });
89 }
90 }
91 };
92 JitCompiler.prototype.hasAotSummary = function (ref) {
93 return !!this._summaryResolver.resolveSummary(ref);
94 };
95 JitCompiler.prototype._filterJitIdentifiers = function (ids) {
96 var _this = this;
97 return ids.map(function (mod) { return mod.reference; }).filter(function (ref) { return !_this.hasAotSummary(ref); });
98 };
99 JitCompiler.prototype._compileModuleAndComponents = function (moduleType, isSync) {
100 var _this = this;
101 return util_1.SyncAsync.then(this._loadModules(moduleType, isSync), function () {
102 _this._compileComponents(moduleType, null);
103 return _this._compileModule(moduleType);
104 });
105 };
106 JitCompiler.prototype._compileModuleAndAllComponents = function (moduleType, isSync) {
107 var _this = this;
108 return util_1.SyncAsync.then(this._loadModules(moduleType, isSync), function () {
109 var componentFactories = [];
110 _this._compileComponents(moduleType, componentFactories);
111 return {
112 ngModuleFactory: _this._compileModule(moduleType),
113 componentFactories: componentFactories
114 };
115 });
116 };
117 JitCompiler.prototype._loadModules = function (mainModule, isSync) {
118 var _this = this;
119 var loading = [];
120 var mainNgModule = this._metadataResolver.getNgModuleMetadata(mainModule);
121 // Note: for runtime compilation, we want to transitively compile all modules,
122 // so we also need to load the declared directives / pipes for all nested modules.
123 this._filterJitIdentifiers(mainNgModule.transitiveModule.modules).forEach(function (nestedNgModule) {
124 // getNgModuleMetadata only returns null if the value passed in is not an NgModule
125 var moduleMeta = _this._metadataResolver.getNgModuleMetadata(nestedNgModule);
126 _this._filterJitIdentifiers(moduleMeta.declaredDirectives).forEach(function (ref) {
127 var promise = _this._metadataResolver.loadDirectiveMetadata(moduleMeta.type.reference, ref, isSync);
128 if (promise) {
129 loading.push(promise);
130 }
131 });
132 _this._filterJitIdentifiers(moduleMeta.declaredPipes)
133 .forEach(function (ref) { return _this._metadataResolver.getOrLoadPipeMetadata(ref); });
134 });
135 return util_1.SyncAsync.all(loading);
136 };
137 JitCompiler.prototype._compileModule = function (moduleType) {
138 var ngModuleFactory = this._compiledNgModuleCache.get(moduleType);
139 if (!ngModuleFactory) {
140 var moduleMeta = this._metadataResolver.getNgModuleMetadata(moduleType);
141 // Always provide a bound Compiler
142 var extraProviders = this.getExtraNgModuleProviders(moduleMeta.type.reference);
143 var outputCtx = createOutputContext();
144 var compileResult = this._ngModuleCompiler.compile(outputCtx, moduleMeta, extraProviders);
145 ngModuleFactory = this._interpretOrJit(compile_metadata_1.ngModuleJitUrl(moduleMeta), outputCtx.statements)[compileResult.ngModuleFactoryVar];
146 this._compiledNgModuleCache.set(moduleMeta.type.reference, ngModuleFactory);
147 }
148 return ngModuleFactory;
149 };
150 /**
151 * @internal
152 */
153 JitCompiler.prototype._compileComponents = function (mainModule, allComponentFactories) {
154 var _this = this;
155 var ngModule = this._metadataResolver.getNgModuleMetadata(mainModule);
156 var moduleByJitDirective = new Map();
157 var templates = new Set();
158 var transJitModules = this._filterJitIdentifiers(ngModule.transitiveModule.modules);
159 transJitModules.forEach(function (localMod) {
160 var localModuleMeta = _this._metadataResolver.getNgModuleMetadata(localMod);
161 _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {
162 moduleByJitDirective.set(dirRef, localModuleMeta);
163 var dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);
164 if (dirMeta.isComponent) {
165 templates.add(_this._createCompiledTemplate(dirMeta, localModuleMeta));
166 if (allComponentFactories) {
167 var template = _this._createCompiledHostTemplate(dirMeta.type.reference, localModuleMeta);
168 templates.add(template);
169 allComponentFactories.push(dirMeta.componentFactory);
170 }
171 }
172 });
173 });
174 transJitModules.forEach(function (localMod) {
175 var localModuleMeta = _this._metadataResolver.getNgModuleMetadata(localMod);
176 _this._filterJitIdentifiers(localModuleMeta.declaredDirectives).forEach(function (dirRef) {
177 var dirMeta = _this._metadataResolver.getDirectiveMetadata(dirRef);
178 if (dirMeta.isComponent) {
179 dirMeta.entryComponents.forEach(function (entryComponentType) {
180 var moduleMeta = moduleByJitDirective.get(entryComponentType.componentType);
181 templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));
182 });
183 }
184 });
185 localModuleMeta.entryComponents.forEach(function (entryComponentType) {
186 if (!_this.hasAotSummary(entryComponentType.componentType)) {
187 var moduleMeta = moduleByJitDirective.get(entryComponentType.componentType);
188 templates.add(_this._createCompiledHostTemplate(entryComponentType.componentType, moduleMeta));
189 }
190 });
191 });
192 templates.forEach(function (template) { return _this._compileTemplate(template); });
193 };
194 JitCompiler.prototype.clearCacheFor = function (type) {
195 this._compiledNgModuleCache.delete(type);
196 this._metadataResolver.clearCacheFor(type);
197 this._compiledHostTemplateCache.delete(type);
198 var compiledTemplate = this._compiledTemplateCache.get(type);
199 if (compiledTemplate) {
200 this._compiledTemplateCache.delete(type);
201 }
202 };
203 JitCompiler.prototype.clearCache = function () {
204 // Note: don't clear the _addedAotSummaries, as they don't change!
205 this._metadataResolver.clearCache();
206 this._compiledTemplateCache.clear();
207 this._compiledHostTemplateCache.clear();
208 this._compiledNgModuleCache.clear();
209 };
210 JitCompiler.prototype._createCompiledHostTemplate = function (compType, ngModule) {
211 if (!ngModule) {
212 throw new Error("Component " + util_1.stringify(compType) + " is not part of any NgModule or the module has not been imported into your module.");
213 }
214 var compiledTemplate = this._compiledHostTemplateCache.get(compType);
215 if (!compiledTemplate) {
216 var compMeta = this._metadataResolver.getDirectiveMetadata(compType);
217 assertComponent(compMeta);
218 var hostMeta = this._metadataResolver.getHostComponentMetadata(compMeta, compMeta.componentFactory.viewDefFactory);
219 compiledTemplate =
220 new CompiledTemplate(true, compMeta.type, hostMeta, ngModule, [compMeta.type]);
221 this._compiledHostTemplateCache.set(compType, compiledTemplate);
222 }
223 return compiledTemplate;
224 };
225 JitCompiler.prototype._createCompiledTemplate = function (compMeta, ngModule) {
226 var compiledTemplate = this._compiledTemplateCache.get(compMeta.type.reference);
227 if (!compiledTemplate) {
228 assertComponent(compMeta);
229 compiledTemplate = new CompiledTemplate(false, compMeta.type, compMeta, ngModule, ngModule.transitiveModule.directives);
230 this._compiledTemplateCache.set(compMeta.type.reference, compiledTemplate);
231 }
232 return compiledTemplate;
233 };
234 JitCompiler.prototype._compileTemplate = function (template) {
235 var _this = this;
236 if (template.isCompiled) {
237 return;
238 }
239 var compMeta = template.compMeta;
240 var externalStylesheetsByModuleUrl = new Map();
241 var outputContext = createOutputContext();
242 var componentStylesheet = this._styleCompiler.compileComponent(outputContext, compMeta);
243 compMeta.template.externalStylesheets.forEach(function (stylesheetMeta) {
244 var compiledStylesheet = _this._styleCompiler.compileStyles(createOutputContext(), compMeta, stylesheetMeta);
245 externalStylesheetsByModuleUrl.set(stylesheetMeta.moduleUrl, compiledStylesheet);
246 });
247 this._resolveStylesCompileResult(componentStylesheet, externalStylesheetsByModuleUrl);
248 var pipes = template.ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
249 var _a = this._parseTemplate(compMeta, template.ngModule, template.directives), parsedTemplate = _a.template, usedPipes = _a.pipes;
250 var compileResult = this._viewCompiler.compileComponent(outputContext, compMeta, parsedTemplate, ir.variable(componentStylesheet.stylesVar), usedPipes);
251 var evalResult = this._interpretOrJit(compile_metadata_1.templateJitUrl(template.ngModule.type, template.compMeta), outputContext.statements);
252 var viewClass = evalResult[compileResult.viewClassVar];
253 var rendererType = evalResult[compileResult.rendererTypeVar];
254 template.compiled(viewClass, rendererType);
255 };
256 JitCompiler.prototype._parseTemplate = function (compMeta, ngModule, directiveIdentifiers) {
257 var _this = this;
258 // Note: ! is ok here as components always have a template.
259 var preserveWhitespaces = compMeta.template.preserveWhitespaces;
260 var directives = directiveIdentifiers.map(function (dir) { return _this._metadataResolver.getDirectiveSummary(dir.reference); });
261 var pipes = ngModule.transitiveModule.pipes.map(function (pipe) { return _this._metadataResolver.getPipeSummary(pipe.reference); });
262 return this._templateParser.parse(compMeta, compMeta.template.htmlAst, directives, pipes, ngModule.schemas, compile_metadata_1.templateSourceUrl(ngModule.type, compMeta, compMeta.template), preserveWhitespaces);
263 };
264 JitCompiler.prototype._resolveStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {
265 var _this = this;
266 result.dependencies.forEach(function (dep, i) {
267 var nestedCompileResult = externalStylesheetsByModuleUrl.get(dep.moduleUrl);
268 var nestedStylesArr = _this._resolveAndEvalStylesCompileResult(nestedCompileResult, externalStylesheetsByModuleUrl);
269 dep.setValue(nestedStylesArr);
270 });
271 };
272 JitCompiler.prototype._resolveAndEvalStylesCompileResult = function (result, externalStylesheetsByModuleUrl) {
273 this._resolveStylesCompileResult(result, externalStylesheetsByModuleUrl);
274 return this._interpretOrJit(compile_metadata_1.sharedStylesheetJitUrl(result.meta, this._sharedStylesheetCount++), result.outputCtx.statements)[result.stylesVar];
275 };
276 JitCompiler.prototype._interpretOrJit = function (sourceUrl, statements) {
277 if (!this._compilerConfig.useJit) {
278 return output_interpreter_1.interpretStatements(statements, this._reflector);
279 }
280 else {
281 return this._jitEvaluator.evaluateStatements(sourceUrl, statements, this._reflector, this._compilerConfig.jitDevMode);
282 }
283 };
284 return JitCompiler;
285 }());
286 exports.JitCompiler = JitCompiler;
287 var CompiledTemplate = /** @class */ (function () {
288 function CompiledTemplate(isHost, compType, compMeta, ngModule, directives) {
289 this.isHost = isHost;
290 this.compType = compType;
291 this.compMeta = compMeta;
292 this.ngModule = ngModule;
293 this.directives = directives;
294 this._viewClass = null;
295 this.isCompiled = false;
296 }
297 CompiledTemplate.prototype.compiled = function (viewClass, rendererType) {
298 this._viewClass = viewClass;
299 this.compMeta.componentViewType.setDelegate(viewClass);
300 for (var prop in rendererType) {
301 this.compMeta.rendererType[prop] = rendererType[prop];
302 }
303 this.isCompiled = true;
304 };
305 return CompiledTemplate;
306 }());
307 function assertComponent(meta) {
308 if (!meta.isComponent) {
309 throw new Error("Could not compile '" + parse_util_1.identifierName(meta.type) + "' because it is not a component.");
310 }
311 }
312 function createOutputContext() {
313 var importExpr = function (symbol) {
314 return ir.importExpr({ name: parse_util_1.identifierName(symbol), moduleName: null, runtime: symbol });
315 };
316 return { statements: [], genFilePath: '', importExpr: importExpr, constantPool: new constant_pool_1.ConstantPool() };
317 }
318});
319//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcGlsZX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4dCB7XG4gIGNvbnN0IGltcG9ydEV4cHIgPSAoc3ltYm9sOiBhbnkpID0+XG4gICAgICBpci5pbXBvcnRFeHByKHtuYW1lOiBpZGVudGlmaWVyTmFtZShzeW1ib2wpLCBtb2R1bGVOYW1lOiBudWxsLCBydW50aW1lOiBzeW1ib2x9KTtcbiAgcmV0dXJuIHtzdGF0ZW1lbnRzOiBbXSwgZ2VuRmlsZVBhdGg6ICcnLCBpbXBvcnRFeHByLCBjb25zdGFudFBvb2w6IG5ldyBDb25zdGFudFBvb2woKX07XG59XG4iXX0=
Note: See TracBrowser for help on using the repository browser.