@angular/compiler 14.0.0-next.11 → 14.0.0-next.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/esm2020/src/compiler_facade_interface.mjs +7 -1
  2. package/esm2020/src/jit_compiler_facade.mjs +61 -25
  3. package/esm2020/src/render3/partial/api.mjs +1 -1
  4. package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
  5. package/esm2020/src/render3/partial/component.mjs +27 -36
  6. package/esm2020/src/render3/partial/directive.mjs +5 -2
  7. package/esm2020/src/render3/partial/factory.mjs +1 -1
  8. package/esm2020/src/render3/partial/injectable.mjs +1 -1
  9. package/esm2020/src/render3/partial/injector.mjs +1 -1
  10. package/esm2020/src/render3/partial/ng_module.mjs +1 -1
  11. package/esm2020/src/render3/partial/pipe.mjs +5 -2
  12. package/esm2020/src/render3/r3_identifiers.mjs +2 -1
  13. package/esm2020/src/render3/r3_pipe_compiler.mjs +2 -1
  14. package/esm2020/src/render3/view/api.mjs +7 -2
  15. package/esm2020/src/render3/view/compiler.mjs +15 -15
  16. package/esm2020/src/render3/view/i18n/get_msg_utils.mjs +58 -5
  17. package/esm2020/src/render3/view/i18n/util.mjs +2 -2
  18. package/esm2020/src/render3/view/template.mjs +4 -4
  19. package/esm2020/src/render3/view/util.mjs +11 -2
  20. package/esm2020/src/version.mjs +1 -1
  21. package/fesm2015/compiler.mjs +193 -87
  22. package/fesm2015/compiler.mjs.map +1 -1
  23. package/fesm2015/testing.mjs +1 -1
  24. package/fesm2020/compiler.mjs +199 -98
  25. package/fesm2020/compiler.mjs.map +1 -1
  26. package/fesm2020/testing.mjs +1 -1
  27. package/package.json +2 -2
  28. package/src/compiler_facade_interface.d.ts +26 -11
  29. package/src/render3/partial/api.d.ts +25 -3
  30. package/src/render3/partial/component.d.ts +3 -3
  31. package/src/render3/r3_identifiers.d.ts +1 -0
  32. package/src/render3/view/api.d.ts +30 -16
  33. package/src/render3/view/compiler.d.ts +4 -4
  34. package/src/render3/view/i18n/get_msg_utils.d.ts +35 -1
  35. package/src/render3/view/i18n/util.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.11
2
+ * @license Angular v14.0.0-next.14
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.11
2
+ * @license Angular v14.0.0-next.14
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2920,6 +2920,7 @@ Identifiers.contentQuery = { name: 'ɵɵcontentQuery', moduleName: CORE };
2920
2920
  Identifiers.NgOnChangesFeature = { name: 'ɵɵNgOnChangesFeature', moduleName: CORE };
2921
2921
  Identifiers.InheritDefinitionFeature = { name: 'ɵɵInheritDefinitionFeature', moduleName: CORE };
2922
2922
  Identifiers.CopyDefinitionFeature = { name: 'ɵɵCopyDefinitionFeature', moduleName: CORE };
2923
+ Identifiers.StandaloneFeature = { name: 'ɵɵStandaloneFeature', moduleName: CORE };
2923
2924
  Identifiers.ProvidersFeature = { name: 'ɵɵProvidersFeature', moduleName: CORE };
2924
2925
  Identifiers.listener = { name: 'ɵɵlistener', moduleName: CORE };
2925
2926
  Identifiers.getInheritedFactory = {
@@ -4791,7 +4792,7 @@ function assembleBoundTextPlaceholders(meta, bindingStartIndex = 0, contextId =
4791
4792
  * @param useCamelCase whether to camelCase the placeholder name when formatting.
4792
4793
  * @returns A new map of formatted placeholder names to expressions.
4793
4794
  */
4794
- function i18nFormatPlaceholderNames(params = {}, useCamelCase) {
4795
+ function formatI18nPlaceholderNamesInMap(params = {}, useCamelCase) {
4795
4796
  const _params = {};
4796
4797
  if (params && Object.keys(params).length) {
4797
4798
  Object.keys(params).forEach(key => _params[formatI18nPlaceholderName(key, useCamelCase)] = params[key]);
@@ -4874,6 +4875,12 @@ const IMPLICIT_REFERENCE = '$implicit';
4874
4875
  const NON_BINDABLE_ATTR = 'ngNonBindable';
4875
4876
  /** Name for the variable keeping track of the context returned by `ɵɵrestoreView`. */
4876
4877
  const RESTORED_VIEW_CONTEXT_NAME = 'restoredCtx';
4878
+ /**
4879
+ * Maximum length of a single instruction chain. Because our output AST uses recursion, we're
4880
+ * limited in how many expressions we can nest before we reach the call stack limit. This
4881
+ * length is set very conservatively in order to reduce the chance of problems.
4882
+ */
4883
+ const MAX_CHAIN_LENGTH = 500;
4877
4884
  /** Instructions that support chaining. */
4878
4885
  const CHAINABLE_INSTRUCTIONS = new Set([
4879
4886
  Identifiers.element,
@@ -5099,16 +5106,18 @@ function getInstructionStatements(instructions) {
5099
5106
  const statements = [];
5100
5107
  let pendingExpression = null;
5101
5108
  let pendingExpressionType = null;
5109
+ let chainLength = 0;
5102
5110
  for (const current of instructions) {
5103
5111
  const resolvedParams = (typeof current.paramsOrFn === 'function' ? current.paramsOrFn() : current.paramsOrFn) ??
5104
5112
  [];
5105
5113
  const params = Array.isArray(resolvedParams) ? resolvedParams : [resolvedParams];
5106
5114
  // If the current instruction is the same as the previous one
5107
5115
  // and it can be chained, add another call to the chain.
5108
- if (pendingExpressionType === current.reference &&
5116
+ if (chainLength < MAX_CHAIN_LENGTH && pendingExpressionType === current.reference &&
5109
5117
  CHAINABLE_INSTRUCTIONS.has(pendingExpressionType)) {
5110
5118
  // We'll always have a pending expression when there's a pending expression type.
5111
5119
  pendingExpression = pendingExpression.callFn(params, pendingExpression.sourceSpan);
5120
+ chainLength++;
5112
5121
  }
5113
5122
  else {
5114
5123
  if (pendingExpression !== null) {
@@ -5116,6 +5125,7 @@ function getInstructionStatements(instructions) {
5116
5125
  }
5117
5126
  pendingExpression = invokeInstruction(current.span, current.reference, params);
5118
5127
  pendingExpressionType = current.reference;
5128
+ chainLength = 0;
5119
5129
  }
5120
5130
  }
5121
5131
  // Since the current instruction adds the previous one to the statements,
@@ -6164,9 +6174,24 @@ function createPipeType(metadata) {
6164
6174
  return new ExpressionType(importExpr(Identifiers.PipeDeclaration, [
6165
6175
  typeWithParameters(metadata.type.type, metadata.typeArgumentCount),
6166
6176
  new ExpressionType(new LiteralExpr(metadata.pipeName)),
6177
+ new ExpressionType(new LiteralExpr(metadata.isStandalone)),
6167
6178
  ]));
6168
6179
  }
6169
6180
 
6181
+ /**
6182
+ * @license
6183
+ * Copyright Google LLC All Rights Reserved.
6184
+ *
6185
+ * Use of this source code is governed by an MIT-style license that can be
6186
+ * found in the LICENSE file at https://angular.io/license
6187
+ */
6188
+ var R3TemplateDependencyKind;
6189
+ (function (R3TemplateDependencyKind) {
6190
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Directive"] = 0] = "Directive";
6191
+ R3TemplateDependencyKind[R3TemplateDependencyKind["Pipe"] = 1] = "Pipe";
6192
+ R3TemplateDependencyKind[R3TemplateDependencyKind["NgModule"] = 2] = "NgModule";
6193
+ })(R3TemplateDependencyKind || (R3TemplateDependencyKind = {}));
6194
+
6170
6195
  /**
6171
6196
  * @license
6172
6197
  * Copyright Google LLC All Rights Reserved.
@@ -16766,11 +16791,64 @@ function i18nMetaToJSDoc(meta) {
16766
16791
 
16767
16792
  /** Closure uses `goog.getMsg(message)` to lookup translations */
16768
16793
  const GOOG_GET_MSG = 'goog.getMsg';
16769
- function createGoogleGetMsgStatements(variable$1, message, closureVar, params) {
16794
+ /**
16795
+ * Generates a `goog.getMsg()` statement and reassignment. The template:
16796
+ *
16797
+ * ```html
16798
+ * <div i18n>Sent from {{ sender }} to <span class="receiver">{{ receiver }}</span></div>
16799
+ * ```
16800
+ *
16801
+ * Generates:
16802
+ *
16803
+ * ```typescript
16804
+ * const MSG_FOO = goog.getMsg(
16805
+ * // Message template.
16806
+ * 'Sent from {$interpolation} to {$startTagSpan}{$interpolation_1}{$closeTagSpan}.',
16807
+ * // Placeholder values, set to magic strings which get replaced by the Angular runtime.
16808
+ * {
16809
+ * 'interpolation': '\uFFFD0\uFFFD',
16810
+ * 'startTagSpan': '\uFFFD1\uFFFD',
16811
+ * 'interpolation_1': '\uFFFD2\uFFFD',
16812
+ * 'closeTagSpan': '\uFFFD3\uFFFD',
16813
+ * },
16814
+ * // Options bag.
16815
+ * {
16816
+ * // Maps each placeholder to the original Angular source code which generates it's value.
16817
+ * original_code: {
16818
+ * 'interpolation': '{{ sender }}',
16819
+ * 'startTagSpan': '<span class="receiver">',
16820
+ * 'interploation_1': '{{ receiver }}',
16821
+ * 'closeTagSpan': '</span>',
16822
+ * },
16823
+ * },
16824
+ * );
16825
+ * const I18N_0 = MSG_FOO;
16826
+ * ```
16827
+ */
16828
+ function createGoogleGetMsgStatements(variable$1, message, closureVar, placeholderValues) {
16770
16829
  const messageString = serializeI18nMessageForGetMsg(message);
16771
16830
  const args = [literal(messageString)];
16772
- if (Object.keys(params).length) {
16773
- args.push(mapLiteral(params, true));
16831
+ if (Object.keys(placeholderValues).length) {
16832
+ // Message template parameters containing the magic strings replaced by the Angular runtime with
16833
+ // real data, e.g. `{'interpolation': '\uFFFD0\uFFFD'}`.
16834
+ args.push(mapLiteral(formatI18nPlaceholderNamesInMap(placeholderValues, true /* useCamelCase */), true /* quoted */));
16835
+ // Message options object, which contains original source code for placeholders (as they are
16836
+ // present in a template, e.g.
16837
+ // `{original_code: {'interpolation': '{{ name }}', 'startTagSpan': '<span>'}}`.
16838
+ args.push(mapLiteral({
16839
+ original_code: literalMap(Object.keys(placeholderValues)
16840
+ .map((param) => ({
16841
+ key: formatI18nPlaceholderName(param),
16842
+ quoted: true,
16843
+ value: message.placeholders[param] ?
16844
+ // Get source span for typical placeholder if it exists.
16845
+ literal(message.placeholders[param].sourceSpan.toString()) :
16846
+ // Otherwise must be an ICU expression, get it's source span.
16847
+ literal(message.placeholderToMessage[param]
16848
+ .nodes.map((node) => node.sourceSpan.toString())
16849
+ .join('')),
16850
+ }))),
16851
+ }));
16774
16852
  }
16775
16853
  // /**
16776
16854
  // * @desc description of message
@@ -17721,7 +17799,7 @@ class TemplateDefinitionBuilder {
17721
17799
  // - all ICU vars (such as `VAR_SELECT` or `VAR_PLURAL`) are replaced with correct values
17722
17800
  const transformFn = (raw) => {
17723
17801
  const params = { ...vars, ...placeholders };
17724
- const formatted = i18nFormatPlaceholderNames(params, /* useCamelCase */ false);
17802
+ const formatted = formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false);
17725
17803
  return invokeInstruction(null, Identifiers.i18nPostprocess, [raw, mapLiteral(formatted, true)]);
17726
17804
  };
17727
17805
  // in case the whole i18n message is a single ICU - we do not need to
@@ -18642,7 +18720,7 @@ const NG_I18N_CLOSURE_MODE = 'ngI18nClosureMode';
18642
18720
  function getTranslationDeclStmts(message, variable, closureVar, params = {}, transformFn) {
18643
18721
  const statements = [
18644
18722
  declareI18nVariable(variable),
18645
- ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, i18nFormatPlaceholderNames(params, /* useCamelCase */ true)), createLocalizeStatements(variable, message, i18nFormatPlaceholderNames(params, /* useCamelCase */ false))),
18723
+ ifStmt(createClosureModeGuard(), createGoogleGetMsgStatements(variable, message, closureVar, params), createLocalizeStatements(variable, message, formatI18nPlaceholderNamesInMap(params, /* useCamelCase */ false))),
18646
18724
  ];
18647
18725
  if (transformFn) {
18648
18726
  statements.push(new ExpressionStatement(variable.set(transformFn(variable))));
@@ -18736,6 +18814,10 @@ function addFeatures(definitionMap, meta) {
18736
18814
  if (meta.lifecycle.usesOnChanges) {
18737
18815
  features.push(importExpr(Identifiers.NgOnChangesFeature));
18738
18816
  }
18817
+ // TODO: better way of differentiating component vs directive metadata.
18818
+ if (meta.hasOwnProperty('template') && meta.isStandalone) {
18819
+ features.push(importExpr(Identifiers.StandaloneFeature));
18820
+ }
18739
18821
  if (features.length) {
18740
18822
  definitionMap.set('features', literalArr(features));
18741
18823
  }
@@ -18799,17 +18881,8 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18799
18881
  definitionMap.set('consts', constsExpr);
18800
18882
  }
18801
18883
  definitionMap.set('template', templateFunctionExpression);
18802
- // e.g. `directives: [MyDirective]`
18803
- if (meta.directives.length > 0) {
18804
- const directivesList = literalArr(meta.directives.map(dir => dir.type));
18805
- const directivesExpr = compileDeclarationList(directivesList, meta.declarationListEmitMode);
18806
- definitionMap.set('directives', directivesExpr);
18807
- }
18808
- // e.g. `pipes: [MyPipe]`
18809
- if (meta.pipes.size > 0) {
18810
- const pipesList = literalArr(Array.from(meta.pipes.values()));
18811
- const pipesExpr = compileDeclarationList(pipesList, meta.declarationListEmitMode);
18812
- definitionMap.set('pipes', pipesExpr);
18884
+ if (meta.declarations.length > 0) {
18885
+ definitionMap.set('dependencies', compileDeclarationList(literalArr(meta.declarations.map(decl => decl.type)), meta.declarationListEmitMode));
18813
18886
  }
18814
18887
  if (meta.encapsulation === null) {
18815
18888
  meta.encapsulation = ViewEncapsulation.Emulated;
@@ -18847,8 +18920,9 @@ function compileComponentFromMetadata(meta, constantPool, bindingParser) {
18847
18920
  * to be consumed by upstream compilations.
18848
18921
  */
18849
18922
  function createComponentType(meta) {
18850
- const typeParams = createDirectiveTypeParams(meta);
18923
+ const typeParams = createBaseDirectiveTypeParams(meta);
18851
18924
  typeParams.push(stringArrayAsType(meta.template.ngContentSelectors));
18925
+ typeParams.push(expressionType(literal(meta.isStandalone)));
18852
18926
  return expressionType(importExpr(Identifiers.ComponentDeclaration, typeParams));
18853
18927
  }
18854
18928
  /**
@@ -18939,7 +19013,7 @@ function stringArrayAsType(arr) {
18939
19013
  return arr.length > 0 ? expressionType(literalArr(arr.map(value => literal(value)))) :
18940
19014
  NONE_TYPE;
18941
19015
  }
18942
- function createDirectiveTypeParams(meta) {
19016
+ function createBaseDirectiveTypeParams(meta) {
18943
19017
  // On the type side, remove newlines from the selector as it will need to fit into a TypeScript
18944
19018
  // string literal, which must be on one line.
18945
19019
  const selectorForType = meta.selector !== null ? meta.selector.replace(/\n/g, '') : null;
@@ -18957,7 +19031,11 @@ function createDirectiveTypeParams(meta) {
18957
19031
  * to be consumed by upstream compilations.
18958
19032
  */
18959
19033
  function createDirectiveType(meta) {
18960
- const typeParams = createDirectiveTypeParams(meta);
19034
+ const typeParams = createBaseDirectiveTypeParams(meta);
19035
+ // Directives have no NgContentSelectors slot, but instead express a `never` type
19036
+ // so that future fields align.
19037
+ typeParams.push(NONE_TYPE);
19038
+ typeParams.push(expressionType(literal(meta.isStandalone)));
18961
19039
  return expressionType(importExpr(Identifiers.DirectiveDeclaration, typeParams));
18962
19040
  }
18963
19041
  // Define and update any view queries
@@ -19405,6 +19483,7 @@ class CompilerFacadeImpl {
19405
19483
  ...convertDirectiveFacadeToMetadata(facade),
19406
19484
  selector: facade.selector || this.elementSchemaRegistry.getDefaultComponentElementName(),
19407
19485
  template,
19486
+ declarations: facade.declarations.map(convertDeclarationFacadeToMetadata),
19408
19487
  declarationListEmitMode: 0 /* Direct */,
19409
19488
  styles: [...facade.styles, ...template.styles],
19410
19489
  encapsulation: facade.encapsulation,
@@ -19584,31 +19663,57 @@ function convertOpaqueValuesToExpressions(obj) {
19584
19663
  }
19585
19664
  return result;
19586
19665
  }
19587
- function convertDeclareComponentFacadeToMetadata(declaration, typeSourceSpan, sourceMapUrl) {
19588
- const { template, interpolation } = parseJitTemplate(declaration.template, declaration.type.name, sourceMapUrl, declaration.preserveWhitespaces ?? false, declaration.interpolation);
19666
+ function convertDeclareComponentFacadeToMetadata(decl, typeSourceSpan, sourceMapUrl) {
19667
+ const { template, interpolation } = parseJitTemplate(decl.template, decl.type.name, sourceMapUrl, decl.preserveWhitespaces ?? false, decl.interpolation);
19668
+ const declarations = [];
19669
+ if (decl.dependencies) {
19670
+ for (const innerDep of decl.dependencies) {
19671
+ switch (innerDep.kind) {
19672
+ case 'directive':
19673
+ case 'component':
19674
+ declarations.push(convertDirectiveDeclarationToMetadata(innerDep));
19675
+ break;
19676
+ case 'pipe':
19677
+ declarations.push(convertPipeDeclarationToMetadata(innerDep));
19678
+ break;
19679
+ }
19680
+ }
19681
+ }
19682
+ else if (decl.components || decl.directives || decl.pipes) {
19683
+ // Existing declarations on NPM may not be using the new `dependencies` merged field, and may
19684
+ // have separate fields for dependencies instead. Unify them for JIT compilation.
19685
+ decl.components &&
19686
+ declarations.push(...decl.components.map(dir => convertDirectiveDeclarationToMetadata(dir, /* isComponent */ true)));
19687
+ decl.directives &&
19688
+ declarations.push(...decl.directives.map(dir => convertDirectiveDeclarationToMetadata(dir)));
19689
+ decl.pipes && declarations.push(...convertPipeMapToMetadata(decl.pipes));
19690
+ }
19589
19691
  return {
19590
- ...convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan),
19692
+ ...convertDeclareDirectiveFacadeToMetadata(decl, typeSourceSpan),
19591
19693
  template,
19592
- styles: declaration.styles ?? [],
19593
- directives: (declaration.components ?? [])
19594
- .concat(declaration.directives ?? [])
19595
- .map(convertUsedDirectiveDeclarationToMetadata),
19596
- pipes: convertUsedPipesToMetadata(declaration.pipes),
19597
- viewProviders: declaration.viewProviders !== undefined ?
19598
- new WrappedNodeExpr(declaration.viewProviders) :
19694
+ styles: decl.styles ?? [],
19695
+ declarations,
19696
+ viewProviders: decl.viewProviders !== undefined ? new WrappedNodeExpr(decl.viewProviders) :
19599
19697
  null,
19600
- animations: declaration.animations !== undefined ? new WrappedNodeExpr(declaration.animations) :
19601
- null,
19602
- changeDetection: declaration.changeDetection ?? ChangeDetectionStrategy.Default,
19603
- encapsulation: declaration.encapsulation ?? ViewEncapsulation.Emulated,
19698
+ animations: decl.animations !== undefined ? new WrappedNodeExpr(decl.animations) : null,
19699
+ changeDetection: decl.changeDetection ?? ChangeDetectionStrategy.Default,
19700
+ encapsulation: decl.encapsulation ?? ViewEncapsulation.Emulated,
19604
19701
  interpolation,
19605
19702
  declarationListEmitMode: 2 /* ClosureResolved */,
19606
19703
  relativeContextFilePath: '',
19607
19704
  i18nUseExternalIds: true,
19608
19705
  };
19609
19706
  }
19610
- function convertUsedDirectiveDeclarationToMetadata(declaration) {
19707
+ function convertDeclarationFacadeToMetadata(declaration) {
19708
+ return {
19709
+ ...declaration,
19710
+ type: new WrappedNodeExpr(declaration.type),
19711
+ };
19712
+ }
19713
+ function convertDirectiveDeclarationToMetadata(declaration, isComponent = null) {
19611
19714
  return {
19715
+ kind: R3TemplateDependencyKind.Directive,
19716
+ isComponent: isComponent || declaration.kind === 'component',
19612
19717
  selector: declaration.selector,
19613
19718
  type: new WrappedNodeExpr(declaration.type),
19614
19719
  inputs: declaration.inputs ?? [],
@@ -19616,16 +19721,24 @@ function convertUsedDirectiveDeclarationToMetadata(declaration) {
19616
19721
  exportAs: declaration.exportAs ?? null,
19617
19722
  };
19618
19723
  }
19619
- function convertUsedPipesToMetadata(declaredPipes) {
19620
- const pipes = new Map();
19621
- if (declaredPipes === undefined) {
19622
- return pipes;
19623
- }
19624
- for (const pipeName of Object.keys(declaredPipes)) {
19625
- const pipeType = declaredPipes[pipeName];
19626
- pipes.set(pipeName, new WrappedNodeExpr(pipeType));
19724
+ function convertPipeMapToMetadata(pipes) {
19725
+ if (!pipes) {
19726
+ return [];
19627
19727
  }
19628
- return pipes;
19728
+ return Object.keys(pipes).map(name => {
19729
+ return {
19730
+ kind: R3TemplateDependencyKind.Pipe,
19731
+ name,
19732
+ type: new WrappedNodeExpr(pipes[name]),
19733
+ };
19734
+ });
19735
+ }
19736
+ function convertPipeDeclarationToMetadata(pipe) {
19737
+ return {
19738
+ kind: R3TemplateDependencyKind.Pipe,
19739
+ name: pipe.name,
19740
+ type: new WrappedNodeExpr(pipe.type),
19741
+ };
19629
19742
  }
19630
19743
  function parseJitTemplate(template, typeName, sourceMapUrl, preserveWhitespaces, interpolation) {
19631
19744
  const interpolationConfig = interpolation ? InterpolationConfig.fromArray(interpolation) : DEFAULT_INTERPOLATION_CONFIG;
@@ -19772,7 +19885,7 @@ function publishFacade(global) {
19772
19885
  * Use of this source code is governed by an MIT-style license that can be
19773
19886
  * found in the LICENSE file at https://angular.io/license
19774
19887
  */
19775
- const VERSION = new Version('14.0.0-next.11');
19888
+ const VERSION = new Version('14.0.0-next.14');
19776
19889
 
19777
19890
  /**
19778
19891
  * @license
@@ -21269,14 +21382,6 @@ var FactoryTarget;
21269
21382
  * found in the LICENSE file at https://angular.io/license
21270
21383
  */
21271
21384
 
21272
- /**
21273
- * @license
21274
- * Copyright Google LLC All Rights Reserved.
21275
- *
21276
- * Use of this source code is governed by an MIT-style license that can be
21277
- * found in the LICENSE file at https://angular.io/license
21278
- */
21279
-
21280
21385
  /**
21281
21386
  * @license
21282
21387
  * Copyright Google LLC All Rights Reserved.
@@ -21813,7 +21918,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21813
21918
  function compileDeclareClassMetadata(metadata) {
21814
21919
  const definitionMap = new DefinitionMap();
21815
21920
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21816
- definitionMap.set('version', literal('14.0.0-next.11'));
21921
+ definitionMap.set('version', literal('14.0.0-next.14'));
21817
21922
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21818
21923
  definitionMap.set('type', metadata.type);
21819
21924
  definitionMap.set('decorators', metadata.decorators);
@@ -21930,9 +22035,12 @@ function compileDeclareDirectiveFromMetadata(meta) {
21930
22035
  function createDirectiveDefinitionMap(meta) {
21931
22036
  const definitionMap = new DefinitionMap();
21932
22037
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21933
- definitionMap.set('version', literal('14.0.0-next.11'));
22038
+ definitionMap.set('version', literal('14.0.0-next.14'));
21934
22039
  // e.g. `type: MyDirective`
21935
22040
  definitionMap.set('type', meta.internalType);
22041
+ if (meta.isStandalone) {
22042
+ definitionMap.set('isStandalone', literal(meta.isStandalone));
22043
+ }
21936
22044
  // e.g. `selector: 'some-dir'`
21937
22045
  if (meta.selector !== null) {
21938
22046
  definitionMap.set('selector', literal(meta.selector));
@@ -22037,9 +22145,7 @@ function createComponentDefinitionMap(meta, template, templateInfo) {
22037
22145
  definitionMap.set('isInline', literal(true));
22038
22146
  }
22039
22147
  definitionMap.set('styles', toOptionalLiteralArray(meta.styles, literal));
22040
- definitionMap.set('components', compileUsedDirectiveMetadata(meta, directive => directive.isComponent === true));
22041
- definitionMap.set('directives', compileUsedDirectiveMetadata(meta, directive => directive.isComponent !== true));
22042
- definitionMap.set('pipes', compileUsedPipeMetadata(meta));
22148
+ definitionMap.set('dependencies', compileUsedDependenciesMetadata(meta));
22043
22149
  definitionMap.set('viewProviders', meta.viewProviders);
22044
22150
  definitionMap.set('animations', meta.animations);
22045
22151
  if (meta.changeDetection !== undefined) {
@@ -22095,43 +22201,35 @@ function computeEndLocation(file, contents) {
22095
22201
  } while (lineStart !== -1);
22096
22202
  return new ParseLocation(file, length, line, length - lastLineStart);
22097
22203
  }
22098
- /**
22099
- * Compiles the directives as registered in the component metadata into an array literal of the
22100
- * individual directives. If the component does not use any directives, then null is returned.
22101
- */
22102
- function compileUsedDirectiveMetadata(meta, predicate) {
22204
+ function compileUsedDependenciesMetadata(meta) {
22103
22205
  const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
22104
22206
  generateForwardRef :
22105
22207
  (expr) => expr;
22106
- const directives = meta.directives.filter(predicate);
22107
- return toOptionalLiteralArray(directives, directive => {
22108
- const dirMeta = new DefinitionMap();
22109
- dirMeta.set('type', wrapType(directive.type));
22110
- dirMeta.set('selector', literal(directive.selector));
22111
- dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));
22112
- dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));
22113
- dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));
22114
- return dirMeta.toLiteralMap();
22208
+ return toOptionalLiteralArray(meta.declarations, decl => {
22209
+ switch (decl.kind) {
22210
+ case R3TemplateDependencyKind.Directive:
22211
+ const dirMeta = new DefinitionMap();
22212
+ dirMeta.set('kind', literal(decl.isComponent ? 'component' : 'directive'));
22213
+ dirMeta.set('type', wrapType(decl.type));
22214
+ dirMeta.set('selector', literal(decl.selector));
22215
+ dirMeta.set('inputs', toOptionalLiteralArray(decl.inputs, literal));
22216
+ dirMeta.set('outputs', toOptionalLiteralArray(decl.outputs, literal));
22217
+ dirMeta.set('exportAs', toOptionalLiteralArray(decl.exportAs, literal));
22218
+ return dirMeta.toLiteralMap();
22219
+ case R3TemplateDependencyKind.Pipe:
22220
+ const pipeMeta = new DefinitionMap();
22221
+ pipeMeta.set('kind', literal('pipe'));
22222
+ pipeMeta.set('type', wrapType(decl.type));
22223
+ pipeMeta.set('name', literal(decl.name));
22224
+ return pipeMeta.toLiteralMap();
22225
+ case R3TemplateDependencyKind.NgModule:
22226
+ const ngModuleMeta = new DefinitionMap();
22227
+ ngModuleMeta.set('kind', literal('ngmodule'));
22228
+ ngModuleMeta.set('type', wrapType(decl.type));
22229
+ return ngModuleMeta.toLiteralMap();
22230
+ }
22115
22231
  });
22116
22232
  }
22117
- /**
22118
- * Compiles the pipes as registered in the component metadata into an object literal, where the
22119
- * pipe's name is used as key and a reference to its type as value. If the component does not use
22120
- * any pipes, then null is returned.
22121
- */
22122
- function compileUsedPipeMetadata(meta) {
22123
- if (meta.pipes.size === 0) {
22124
- return null;
22125
- }
22126
- const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?
22127
- generateForwardRef :
22128
- (expr) => expr;
22129
- const entries = [];
22130
- for (const [name, pipe] of meta.pipes) {
22131
- entries.push({ key: name, value: wrapType(pipe), quoted: true });
22132
- }
22133
- return literalMap(entries);
22134
- }
22135
22233
 
22136
22234
  /**
22137
22235
  * @license
@@ -22151,7 +22249,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22151
22249
  function compileDeclareFactoryFunction(meta) {
22152
22250
  const definitionMap = new DefinitionMap();
22153
22251
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22154
- definitionMap.set('version', literal('14.0.0-next.11'));
22252
+ definitionMap.set('version', literal('14.0.0-next.14'));
22155
22253
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22156
22254
  definitionMap.set('type', meta.internalType);
22157
22255
  definitionMap.set('deps', compileDependencies(meta.deps));
@@ -22193,7 +22291,7 @@ function compileDeclareInjectableFromMetadata(meta) {
22193
22291
  function createInjectableDefinitionMap(meta) {
22194
22292
  const definitionMap = new DefinitionMap();
22195
22293
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22196
- definitionMap.set('version', literal('14.0.0-next.11'));
22294
+ definitionMap.set('version', literal('14.0.0-next.14'));
22197
22295
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22198
22296
  definitionMap.set('type', meta.internalType);
22199
22297
  // Only generate providedIn property if it has a non-null value
@@ -22251,7 +22349,7 @@ function compileDeclareInjectorFromMetadata(meta) {
22251
22349
  function createInjectorDefinitionMap(meta) {
22252
22350
  const definitionMap = new DefinitionMap();
22253
22351
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22254
- definitionMap.set('version', literal('14.0.0-next.11'));
22352
+ definitionMap.set('version', literal('14.0.0-next.14'));
22255
22353
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22256
22354
  definitionMap.set('type', meta.internalType);
22257
22355
  definitionMap.set('providers', meta.providers);
@@ -22288,7 +22386,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
22288
22386
  function createNgModuleDefinitionMap(meta) {
22289
22387
  const definitionMap = new DefinitionMap();
22290
22388
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22291
- definitionMap.set('version', literal('14.0.0-next.11'));
22389
+ definitionMap.set('version', literal('14.0.0-next.14'));
22292
22390
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22293
22391
  definitionMap.set('type', meta.internalType);
22294
22392
  // We only generate the keys in the metadata if the arrays contain values.
@@ -22346,10 +22444,13 @@ function compileDeclarePipeFromMetadata(meta) {
22346
22444
  function createPipeDefinitionMap(meta) {
22347
22445
  const definitionMap = new DefinitionMap();
22348
22446
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22349
- definitionMap.set('version', literal('14.0.0-next.11'));
22447
+ definitionMap.set('version', literal('14.0.0-next.14'));
22350
22448
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22351
22449
  // e.g. `type: MyPipe`
22352
22450
  definitionMap.set('type', meta.internalType);
22451
+ if (meta.isStandalone) {
22452
+ definitionMap.set('isStandalone', literal(meta.isStandalone));
22453
+ }
22353
22454
  // e.g. `name: "myPipe"`
22354
22455
  definitionMap.set('name', literal(meta.pipeName));
22355
22456
  if (meta.pure === false) {
@@ -22396,5 +22497,5 @@ publishFacade(_global);
22396
22497
  * found in the LICENSE file at https://angular.io/license
22397
22498
  */
22398
22499
 
22399
- export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3SelectorScopeMode, R3TargetBinder, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
22500
+ export { AST, ASTWithName, ASTWithSource, AbsoluteSourceSpan, ArrayType, AstMemoryEfficientTransformer, AstTransformer, Attribute, Binary, BinaryOperator, BinaryOperatorExpr, BindingPipe, BoundElementProperty, BuiltinType, BuiltinTypeName, CUSTOM_ELEMENTS_SCHEMA, Call, Chain, ChangeDetectionStrategy, CommaExpr, Comment, CompilerConfig, Conditional, ConditionalExpr, ConstantPool, CssSelector, DEFAULT_INTERPOLATION_CONFIG, DYNAMIC_TYPE, DeclareFunctionStmt, DeclareVarStmt, DomElementSchemaRegistry, EOF, Element, ElementSchemaRegistry, EmitterVisitorContext, EmptyExpr, Expansion, ExpansionCase, Expression, ExpressionBinding, ExpressionStatement, ExpressionType, ExternalExpr, ExternalReference, FactoryTarget$1 as FactoryTarget, FunctionExpr, HtmlParser, HtmlTagDefinition, I18NHtmlParser, IfStmt, ImplicitReceiver, InstantiateExpr, Interpolation, InterpolationConfig, InvokeFunctionExpr, JSDocComment, JitEvaluator, KeyedRead, KeyedWrite, LeadingComment, Lexer, LiteralArray, LiteralArrayExpr, LiteralExpr, LiteralMap, LiteralMapExpr, LiteralPrimitive, LocalizedString, MapType, MessageBundle, NONE_TYPE, NO_ERRORS_SCHEMA, NodeWithI18n, NonNullAssert, NotExpr, ParseError, ParseErrorLevel, ParseLocation, ParseSourceFile, ParseSourceSpan, ParseSpan, ParseTreeResult, ParsedEvent, ParsedProperty, ParsedPropertyType, ParsedVariable, Parser$1 as Parser, ParserError, PrefixNot, PropertyRead, PropertyWrite, R3BoundTarget, Identifiers as R3Identifiers, R3SelectorScopeMode, R3TargetBinder, R3TemplateDependencyKind, ReadKeyExpr, ReadPropExpr, ReadVarExpr, RecursiveAstVisitor, RecursiveVisitor, ResourceLoader, ReturnStatement, STRING_TYPE, SafeCall, SafeKeyedRead, SafePropertyRead, SelectorContext, SelectorListContext, SelectorMatcher, Serializer, SplitInterpolation, Statement, StmtModifier, TagContentType, TaggedTemplateExpr, TemplateBindingParseResult, TemplateLiteral, TemplateLiteralElement, Text, ThisReceiver, BoundAttribute as TmplAstBoundAttribute, BoundEvent as TmplAstBoundEvent, BoundText as TmplAstBoundText, Content as TmplAstContent, Element$1 as TmplAstElement, Icu$1 as TmplAstIcu, RecursiveVisitor$1 as TmplAstRecursiveVisitor, Reference as TmplAstReference, Template as TmplAstTemplate, Text$3 as TmplAstText, TextAttribute as TmplAstTextAttribute, Variable as TmplAstVariable, Token, TokenType, TreeError, Type, TypeModifier, TypeofExpr, Unary, UnaryOperator, UnaryOperatorExpr, VERSION, VariableBinding, Version, ViewEncapsulation, WrappedNodeExpr, WriteKeyExpr, WritePropExpr, WriteVarExpr, Xliff, Xliff2, Xmb, XmlParser, Xtb, _ParseAST, compileClassMetadata, compileComponentFromMetadata, compileDeclareClassMetadata, compileDeclareComponentFromMetadata, compileDeclareDirectiveFromMetadata, compileDeclareFactoryFunction, compileDeclareInjectableFromMetadata, compileDeclareInjectorFromMetadata, compileDeclareNgModuleFromMetadata, compileDeclarePipeFromMetadata, compileDirectiveFromMetadata, compileFactoryFunction, compileInjectable, compileInjector, compileNgModule, compilePipeFromMetadata, computeMsgId, core, createInjectableType, createMayBeForwardRefExpression, devOnlyGuardedExpression, emitDistinctChangesOnlyDefaultValue, getHtmlTagDefinition, getNsPrefix, getSafePropertyAccessString, identifierName, isIdentifier, isNgContainer, isNgContent, isNgTemplate, jsDocComment, leadingComment, literalMap, makeBindingParser, mergeNsAndName, output_ast as outputAst, parseHostBindings, parseTemplate, preserveWhitespacesDefault, publishFacade, r3JitTypeSourceSpan, sanitizeIdentifier, splitNsName, verifyHostBindings, visitAll };
22400
22501
  //# sourceMappingURL=compiler.mjs.map