@angular/compiler 16.0.0-next.5 → 16.0.0-next.7

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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-next.5
2
+ * @license Angular v16.0.0-next.7
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -3500,7 +3500,7 @@ function compileFactoryFunction(meta) {
3500
3500
  // delegated factory (which is used to create the current type) then this is only the type-to-
3501
3501
  // create parameter (t).
3502
3502
  const typeForCtor = !isDelegatedFactoryMetadata(meta) ?
3503
- new BinaryOperatorExpr(BinaryOperator.Or, t, meta.internalType) :
3503
+ new BinaryOperatorExpr(BinaryOperator.Or, t, meta.type.value) :
3504
3504
  t;
3505
3505
  let ctorExpr = null;
3506
3506
  if (meta.deps !== null) {
@@ -3547,7 +3547,7 @@ function compileFactoryFunction(meta) {
3547
3547
  }
3548
3548
  else if (baseFactoryVar !== null) {
3549
3549
  // This factory uses a base factory, so call `ɵɵgetInheritedFactory()` to compute it.
3550
- const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.internalType]);
3550
+ const getInheritedFactoryCall = importExpr(Identifiers.getInheritedFactory).callFn([meta.type.value]);
3551
3551
  // Memoize the base factoryFn: `baseFactory || (baseFactory = ɵɵgetInheritedFactory(...))`
3552
3552
  const baseFactory = new BinaryOperatorExpr(BinaryOperator.Or, baseFactoryVar, baseFactoryVar.set(getInheritedFactoryCall));
3553
3553
  body.push(new ReturnStatement(baseFactory.callFn([typeForCtor])));
@@ -4883,7 +4883,6 @@ function compileInjectable(meta, resolveForwardRefs) {
4883
4883
  const factoryMeta = {
4884
4884
  name: meta.name,
4885
4885
  type: meta.type,
4886
- internalType: meta.internalType,
4887
4886
  typeArgumentCount: meta.typeArgumentCount,
4888
4887
  deps: [],
4889
4888
  target: FactoryTarget$1.Injectable,
@@ -4895,7 +4894,7 @@ function compileInjectable(meta, resolveForwardRefs) {
4895
4894
  //
4896
4895
  // A special case exists for useClass: Type where Type is the injectable type itself and no
4897
4896
  // deps are specified, in which case 'useClass' is effectively ignored.
4898
- const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.internalType);
4897
+ const useClassOnSelf = meta.useClass.expression.isEquivalent(meta.type.value);
4899
4898
  let deps = undefined;
4900
4899
  if (meta.deps !== undefined) {
4901
4900
  deps = meta.deps;
@@ -4954,10 +4953,10 @@ function compileInjectable(meta, resolveForwardRefs) {
4954
4953
  else {
4955
4954
  result = {
4956
4955
  statements: [],
4957
- expression: delegateToFactory(meta.type.value, meta.internalType, resolveForwardRefs)
4956
+ expression: delegateToFactory(meta.type.value, meta.type.value, resolveForwardRefs)
4958
4957
  };
4959
4958
  }
4960
- const token = meta.internalType;
4959
+ const token = meta.type.value;
4961
4960
  const injectableProps = new DefinitionMap();
4962
4961
  injectableProps.set('token', token);
4963
4962
  injectableProps.set('factory', result.expression);
@@ -4976,28 +4975,28 @@ function compileInjectable(meta, resolveForwardRefs) {
4976
4975
  function createInjectableType(meta) {
4977
4976
  return new ExpressionType(importExpr(Identifiers.InjectableDeclaration, [typeWithParameters(meta.type.type, meta.typeArgumentCount)]));
4978
4977
  }
4979
- function delegateToFactory(type, internalType, unwrapForwardRefs) {
4980
- if (type.node === internalType.node) {
4978
+ function delegateToFactory(type, useType, unwrapForwardRefs) {
4979
+ if (type.node === useType.node) {
4981
4980
  // The types are the same, so we can simply delegate directly to the type's factory.
4982
4981
  // ```
4983
4982
  // factory: type.ɵfac
4984
4983
  // ```
4985
- return internalType.prop('ɵfac');
4984
+ return useType.prop('ɵfac');
4986
4985
  }
4987
4986
  if (!unwrapForwardRefs) {
4988
4987
  // The type is not wrapped in a `forwardRef()`, so we create a simple factory function that
4989
4988
  // accepts a sub-type as an argument.
4990
4989
  // ```
4991
- // factory: function(t) { return internalType.ɵfac(t); }
4990
+ // factory: function(t) { return useType.ɵfac(t); }
4992
4991
  // ```
4993
- return createFactoryFunction(internalType);
4992
+ return createFactoryFunction(useType);
4994
4993
  }
4995
- // The internalType is actually wrapped in a `forwardRef()` so we need to resolve that before
4994
+ // The useType is actually wrapped in a `forwardRef()` so we need to resolve that before
4996
4995
  // calling its factory.
4997
4996
  // ```
4998
4997
  // factory: function(t) { return core.resolveForwardRef(type).ɵfac(t); }
4999
4998
  // ```
5000
- const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([internalType]);
4999
+ const unwrappedType = importExpr(Identifiers.resolveForwardRef).callFn([useType]);
5001
5000
  return createFactoryFunction(unwrappedType);
5002
5001
  }
5003
5002
  function createFactoryFunction(type) {
@@ -5701,10 +5700,10 @@ var R3SelectorScopeMode;
5701
5700
  * Construct an `R3NgModuleDef` for the given `R3NgModuleMetadata`.
5702
5701
  */
5703
5702
  function compileNgModule(meta) {
5704
- const { adjacentType, internalType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
5703
+ const { type: moduleType, bootstrap, declarations, imports, exports, schemas, containsForwardDecls, selectorScopeMode, id } = meta;
5705
5704
  const statements = [];
5706
5705
  const definitionMap = new DefinitionMap();
5707
- definitionMap.set('type', internalType);
5706
+ definitionMap.set('type', moduleType.value);
5708
5707
  if (bootstrap.length > 0) {
5709
5708
  definitionMap.set('bootstrap', refsToArray(bootstrap, containsForwardDecls));
5710
5709
  }
@@ -5741,7 +5740,7 @@ function compileNgModule(meta) {
5741
5740
  definitionMap.set('id', id);
5742
5741
  // Generate a side-effectful call to register this NgModule by its id, as per the semantics of
5743
5742
  // NgModule ids.
5744
- statements.push(importExpr(Identifiers.registerNgModuleType).callFn([adjacentType, id]).toStmt());
5743
+ statements.push(importExpr(Identifiers.registerNgModuleType).callFn([moduleType.value, id]).toStmt());
5745
5744
  }
5746
5745
  const expression = importExpr(Identifiers.defineNgModule).callFn([definitionMap.toLiteralMap()], undefined, true);
5747
5746
  const type = createNgModuleType(meta);
@@ -5790,7 +5789,7 @@ function createNgModuleType({ type: moduleType, declarations, exports, imports,
5790
5789
  * symbols to become tree-shakeable.
5791
5790
  */
5792
5791
  function generateSetNgModuleScopeCall(meta) {
5793
- const { adjacentType: moduleType, declarations, imports, exports, containsForwardDecls } = meta;
5792
+ const { type: moduleType, declarations, imports, exports, containsForwardDecls } = meta;
5794
5793
  const scopeMap = new DefinitionMap();
5795
5794
  if (declarations.length > 0) {
5796
5795
  scopeMap.set('declarations', refsToArray(declarations, containsForwardDecls));
@@ -5807,7 +5806,7 @@ function generateSetNgModuleScopeCall(meta) {
5807
5806
  // setNgModuleScope(...)
5808
5807
  const fnCall = new InvokeFunctionExpr(
5809
5808
  /* fn */ importExpr(Identifiers.setNgModuleScope),
5810
- /* args */ [moduleType, scopeMap.toLiteralMap()]);
5809
+ /* args */ [moduleType.value, scopeMap.toLiteralMap()]);
5811
5810
  // (ngJitMode guard) && setNgModuleScope(...)
5812
5811
  const guardedCall = jitOnlyGuardedExpression(fnCall);
5813
5812
  // function() { (ngJitMode guard) && setNgModuleScope(...); }
@@ -18654,7 +18653,7 @@ function baseDirectiveFields(meta, constantPool, bindingParser) {
18654
18653
  const definitionMap = new DefinitionMap();
18655
18654
  const selectors = parseSelectorToR3Selector(meta.selector);
18656
18655
  // e.g. `type: MyDirective`
18657
- definitionMap.set('type', meta.internalType);
18656
+ definitionMap.set('type', meta.type.value);
18658
18657
  // e.g. `selectors: [['', 'someDir', '']]`
18659
18658
  if (selectors.length > 0) {
18660
18659
  definitionMap.set('selectors', asLiteral(selectors));
@@ -19352,7 +19351,6 @@ class CompilerFacadeImpl {
19352
19351
  const metadata = {
19353
19352
  name: facade.name,
19354
19353
  type: wrapReference(facade.type),
19355
- internalType: new WrappedNodeExpr(facade.type),
19356
19354
  typeArgumentCount: 0,
19357
19355
  deps: null,
19358
19356
  pipeName: facade.pipeName,
@@ -19371,7 +19369,6 @@ class CompilerFacadeImpl {
19371
19369
  const { expression, statements } = compileInjectable({
19372
19370
  name: facade.name,
19373
19371
  type: wrapReference(facade.type),
19374
- internalType: new WrappedNodeExpr(facade.type),
19375
19372
  typeArgumentCount: facade.typeArgumentCount,
19376
19373
  providedIn: computeProvidedIn(facade.providedIn),
19377
19374
  useClass: convertToProviderExpression(facade, 'useClass'),
@@ -19387,7 +19384,6 @@ class CompilerFacadeImpl {
19387
19384
  const { expression, statements } = compileInjectable({
19388
19385
  name: facade.type.name,
19389
19386
  type: wrapReference(facade.type),
19390
- internalType: new WrappedNodeExpr(facade.type),
19391
19387
  typeArgumentCount: 0,
19392
19388
  providedIn: computeProvidedIn(facade.providedIn),
19393
19389
  useClass: convertToProviderExpression(facade, 'useClass'),
@@ -19403,7 +19399,6 @@ class CompilerFacadeImpl {
19403
19399
  const meta = {
19404
19400
  name: facade.name,
19405
19401
  type: wrapReference(facade.type),
19406
- internalType: new WrappedNodeExpr(facade.type),
19407
19402
  providers: facade.providers && facade.providers.length > 0 ?
19408
19403
  new WrappedNodeExpr(facade.providers) :
19409
19404
  null,
@@ -19420,8 +19415,6 @@ class CompilerFacadeImpl {
19420
19415
  compileNgModule(angularCoreEnv, sourceMapUrl, facade) {
19421
19416
  const meta = {
19422
19417
  type: wrapReference(facade.type),
19423
- internalType: new WrappedNodeExpr(facade.type),
19424
- adjacentType: new WrappedNodeExpr(facade.type),
19425
19418
  bootstrap: facade.bootstrap.map(wrapReference),
19426
19419
  declarations: facade.declarations.map(wrapReference),
19427
19420
  publicDeclarationTypes: null,
@@ -19494,7 +19487,6 @@ class CompilerFacadeImpl {
19494
19487
  const factoryRes = compileFactoryFunction({
19495
19488
  name: meta.name,
19496
19489
  type: wrapReference(meta.type),
19497
- internalType: new WrappedNodeExpr(meta.type),
19498
19490
  typeArgumentCount: meta.typeArgumentCount,
19499
19491
  deps: convertR3DependencyMetadataArray(meta.deps),
19500
19492
  target: meta.target,
@@ -19505,7 +19497,6 @@ class CompilerFacadeImpl {
19505
19497
  const factoryRes = compileFactoryFunction({
19506
19498
  name: meta.type.name,
19507
19499
  type: wrapReference(meta.type),
19508
- internalType: new WrappedNodeExpr(meta.type),
19509
19500
  typeArgumentCount: 0,
19510
19501
  deps: Array.isArray(meta.deps) ? meta.deps.map(convertR3DeclareDependencyMetadata) :
19511
19502
  meta.deps,
@@ -19591,7 +19582,6 @@ function convertDirectiveFacadeToMetadata(facade) {
19591
19582
  typeArgumentCount: 0,
19592
19583
  typeSourceSpan: facade.typeSourceSpan,
19593
19584
  type: wrapReference(facade.type),
19594
- internalType: new WrappedNodeExpr(facade.type),
19595
19585
  deps: null,
19596
19586
  host: extractHostBindings(facade.propMetadata, facade.typeSourceSpan, facade.host),
19597
19587
  inputs: { ...inputsFromMetadata, ...inputsFromType },
@@ -19608,7 +19598,6 @@ function convertDeclareDirectiveFacadeToMetadata(declaration, typeSourceSpan) {
19608
19598
  name: declaration.type.name,
19609
19599
  type: wrapReference(declaration.type),
19610
19600
  typeSourceSpan,
19611
- internalType: new WrappedNodeExpr(declaration.type),
19612
19601
  selector: declaration.selector ?? null,
19613
19602
  inputs: declaration.inputs ? inputsMappingToInputMetadata(declaration.inputs) : {},
19614
19603
  outputs: declaration.outputs ?? {},
@@ -19886,7 +19875,6 @@ function convertDeclarePipeFacadeToMetadata(declaration) {
19886
19875
  return {
19887
19876
  name: declaration.type.name,
19888
19877
  type: wrapReference(declaration.type),
19889
- internalType: new WrappedNodeExpr(declaration.type),
19890
19878
  typeArgumentCount: 0,
19891
19879
  pipeName: declaration.name,
19892
19880
  deps: null,
@@ -19898,7 +19886,6 @@ function convertDeclareInjectorFacadeToMetadata(declaration) {
19898
19886
  return {
19899
19887
  name: declaration.type.name,
19900
19888
  type: wrapReference(declaration.type),
19901
- internalType: new WrappedNodeExpr(declaration.type),
19902
19889
  providers: declaration.providers !== undefined && declaration.providers.length > 0 ?
19903
19890
  new WrappedNodeExpr(declaration.providers) :
19904
19891
  null,
@@ -19917,7 +19904,7 @@ function publishFacade(global) {
19917
19904
  * @description
19918
19905
  * Entry point for all public APIs of the compiler package.
19919
19906
  */
19920
- const VERSION = new Version('16.0.0-next.5');
19907
+ const VERSION = new Version('16.0.0-next.7');
19921
19908
 
19922
19909
  class CompilerConfig {
19923
19910
  constructor({ defaultEncapsulation = ViewEncapsulation.Emulated, useJit = true, missingTranslation = null, preserveWhitespaces, strictInjectionParameters } = {}) {
@@ -21841,7 +21828,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
21841
21828
  function compileDeclareClassMetadata(metadata) {
21842
21829
  const definitionMap = new DefinitionMap();
21843
21830
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
21844
- definitionMap.set('version', literal('16.0.0-next.5'));
21831
+ definitionMap.set('version', literal('16.0.0-next.7'));
21845
21832
  definitionMap.set('ngImport', importExpr(Identifiers.core));
21846
21833
  definitionMap.set('type', metadata.type);
21847
21834
  definitionMap.set('decorators', metadata.decorators);
@@ -21944,9 +21931,9 @@ function compileDeclareDirectiveFromMetadata(meta) {
21944
21931
  function createDirectiveDefinitionMap(meta) {
21945
21932
  const definitionMap = new DefinitionMap();
21946
21933
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
21947
- definitionMap.set('version', literal('16.0.0-next.5'));
21934
+ definitionMap.set('version', literal('16.0.0-next.7'));
21948
21935
  // e.g. `type: MyDirective`
21949
- definitionMap.set('type', meta.internalType);
21936
+ definitionMap.set('type', meta.type.value);
21950
21937
  if (meta.isStandalone) {
21951
21938
  definitionMap.set('isStandalone', literal(meta.isStandalone));
21952
21939
  }
@@ -22169,9 +22156,9 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
22169
22156
  function compileDeclareFactoryFunction(meta) {
22170
22157
  const definitionMap = new DefinitionMap();
22171
22158
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
22172
- definitionMap.set('version', literal('16.0.0-next.5'));
22159
+ definitionMap.set('version', literal('16.0.0-next.7'));
22173
22160
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22174
- definitionMap.set('type', meta.internalType);
22161
+ definitionMap.set('type', meta.type.value);
22175
22162
  definitionMap.set('deps', compileDependencies(meta.deps));
22176
22163
  definitionMap.set('target', importExpr(Identifiers.FactoryTarget).prop(FactoryTarget$1[meta.target]));
22177
22164
  return {
@@ -22204,9 +22191,9 @@ function compileDeclareInjectableFromMetadata(meta) {
22204
22191
  function createInjectableDefinitionMap(meta) {
22205
22192
  const definitionMap = new DefinitionMap();
22206
22193
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
22207
- definitionMap.set('version', literal('16.0.0-next.5'));
22194
+ definitionMap.set('version', literal('16.0.0-next.7'));
22208
22195
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22209
- definitionMap.set('type', meta.internalType);
22196
+ definitionMap.set('type', meta.type.value);
22210
22197
  // Only generate providedIn property if it has a non-null value
22211
22198
  if (meta.providedIn !== undefined) {
22212
22199
  const providedIn = convertFromMaybeForwardRefExpression(meta.providedIn);
@@ -22255,9 +22242,9 @@ function compileDeclareInjectorFromMetadata(meta) {
22255
22242
  function createInjectorDefinitionMap(meta) {
22256
22243
  const definitionMap = new DefinitionMap();
22257
22244
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
22258
- definitionMap.set('version', literal('16.0.0-next.5'));
22245
+ definitionMap.set('version', literal('16.0.0-next.7'));
22259
22246
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22260
- definitionMap.set('type', meta.internalType);
22247
+ definitionMap.set('type', meta.type.value);
22261
22248
  definitionMap.set('providers', meta.providers);
22262
22249
  if (meta.imports.length > 0) {
22263
22250
  definitionMap.set('imports', literalArr(meta.imports));
@@ -22285,9 +22272,9 @@ function compileDeclareNgModuleFromMetadata(meta) {
22285
22272
  function createNgModuleDefinitionMap(meta) {
22286
22273
  const definitionMap = new DefinitionMap();
22287
22274
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
22288
- definitionMap.set('version', literal('16.0.0-next.5'));
22275
+ definitionMap.set('version', literal('16.0.0-next.7'));
22289
22276
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22290
- definitionMap.set('type', meta.internalType);
22277
+ definitionMap.set('type', meta.type.value);
22291
22278
  // We only generate the keys in the metadata if the arrays contain values.
22292
22279
  // We must wrap the arrays inside a function if any of the values are a forward reference to a
22293
22280
  // not-yet-declared class. This is to support JIT execution of the `ɵɵngDeclareNgModule()` call.
@@ -22336,10 +22323,10 @@ function compileDeclarePipeFromMetadata(meta) {
22336
22323
  function createPipeDefinitionMap(meta) {
22337
22324
  const definitionMap = new DefinitionMap();
22338
22325
  definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
22339
- definitionMap.set('version', literal('16.0.0-next.5'));
22326
+ definitionMap.set('version', literal('16.0.0-next.7'));
22340
22327
  definitionMap.set('ngImport', importExpr(Identifiers.core));
22341
22328
  // e.g. `type: MyPipe`
22342
- definitionMap.set('type', meta.internalType);
22329
+ definitionMap.set('type', meta.type.value);
22343
22330
  if (meta.isStandalone) {
22344
22331
  definitionMap.set('isStandalone', literal(meta.isStandalone));
22345
22332
  }