@angular/core 14.0.0-next.10 → 14.0.0-next.13

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 (39) hide show
  1. package/core.d.ts +1 -2
  2. package/esm2020/src/application_ref.mjs +10 -11
  3. package/esm2020/src/application_tokens.mjs +5 -2
  4. package/esm2020/src/change_detection/change_detection.mjs +2 -2
  5. package/esm2020/src/change_detection/differs/default_iterable_differ.mjs +2 -2
  6. package/esm2020/src/change_detection/differs/default_keyvalue_differ.mjs +2 -2
  7. package/esm2020/src/console.mjs +4 -3
  8. package/esm2020/src/core_private_export.mjs +3 -2
  9. package/esm2020/src/platform_core_providers.mjs +3 -14
  10. package/esm2020/src/render3/bindings.mjs +2 -2
  11. package/esm2020/src/render3/instructions/element.mjs +22 -7
  12. package/esm2020/src/render3/instructions/shared.mjs +35 -15
  13. package/esm2020/src/testability/testability.mjs +4 -3
  14. package/esm2020/src/version.mjs +1 -1
  15. package/esm2020/testing/src/logger.mjs +3 -3
  16. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  17. package/esm2020/testing/src/r3_test_bed.mjs +5 -8
  18. package/esm2020/testing/src/test_bed.mjs +1 -1
  19. package/esm2020/testing/src/test_bed_common.mjs +1 -1
  20. package/fesm2015/core.mjs +103 -59
  21. package/fesm2015/core.mjs.map +1 -1
  22. package/fesm2015/testing.mjs +5 -8
  23. package/fesm2015/testing.mjs.map +1 -1
  24. package/fesm2020/core.mjs +103 -59
  25. package/fesm2020/core.mjs.map +1 -1
  26. package/fesm2020/testing.mjs +5 -8
  27. package/fesm2020/testing.mjs.map +1 -1
  28. package/package.json +1 -1
  29. package/schematics/migrations/path-match-type/index.d.ts +11 -0
  30. package/schematics/migrations/path-match-type/index.js +95 -0
  31. package/schematics/migrations/path-match-type/transform.d.ts +19 -0
  32. package/schematics/migrations/path-match-type/transform.js +48 -0
  33. package/schematics/migrations/path-match-type/update_recorder.d.ts +18 -0
  34. package/schematics/migrations/path-match-type/update_recorder.js +20 -0
  35. package/schematics/migrations/path-match-type/util.d.ts +11 -0
  36. package/schematics/migrations/path-match-type/util.js +106 -0
  37. package/schematics/migrations.json +8 -3
  38. package/testing/testing.d.ts +1 -42
  39. package/esm2020/src/change_detection/change_detection_util.mjs +0 -64
package/fesm2020/core.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v14.0.0-next.10
2
+ * @license Angular v14.0.0-next.13
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -10252,9 +10252,9 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
10252
10252
  propName = mapPropName(propName);
10253
10253
  if (ngDevMode) {
10254
10254
  validateAgainstEventProperties(propName);
10255
- if (!validateProperty(tView, element, propName, tNode)) {
10255
+ if (!validateProperty(element, tNode.value, propName, tView.schemas)) {
10256
10256
  // Return here since we only log warnings for unknown properties.
10257
- logUnknownPropertyError(propName, tNode);
10257
+ logUnknownPropertyError(propName, tNode.value);
10258
10258
  return;
10259
10259
  }
10260
10260
  ngDevMode.rendererSetProperty++;
@@ -10273,8 +10273,8 @@ function elementPropertyInternal(tView, tNode, lView, propName, value, renderer,
10273
10273
  else if (tNode.type & 12 /* AnyContainer */) {
10274
10274
  // If the node is a container and the property didn't
10275
10275
  // match any of the inputs or schemas we should throw.
10276
- if (ngDevMode && !matchingSchemas(tView, tNode.value)) {
10277
- logUnknownPropertyError(propName, tNode);
10276
+ if (ngDevMode && !matchingSchemas(tView.schemas, tNode.value)) {
10277
+ logUnknownPropertyError(propName, tNode.value);
10278
10278
  }
10279
10279
  }
10280
10280
  }
@@ -10326,24 +10326,44 @@ function setNgReflectProperties(lView, element, type, dataValue, value) {
10326
10326
  }
10327
10327
  }
10328
10328
  }
10329
- function validateProperty(tView, element, propName, tNode) {
10329
+ /**
10330
+ * Validates that the property of the element is known at runtime and returns
10331
+ * false if it's not the case.
10332
+ * This check is relevant for JIT-compiled components (for AOT-compiled
10333
+ * ones this check happens at build time).
10334
+ *
10335
+ * The property is considered known if either:
10336
+ * - it's a known property of the element
10337
+ * - the element is allowed by one of the schemas
10338
+ * - the property is used for animations
10339
+ *
10340
+ * @param element Element to validate
10341
+ * @param tagName Name of the tag to check
10342
+ * @param propName Name of the property to check
10343
+ * @param schemas Array of schemas
10344
+ */
10345
+ function validateProperty(element, tagName, propName, schemas) {
10330
10346
  // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
10331
10347
  // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
10332
10348
  // defined as an array (as an empty array in case `schemas` field is not defined) and we should
10333
10349
  // execute the check below.
10334
- if (tView.schemas === null)
10350
+ if (schemas === null)
10335
10351
  return true;
10336
- // The property is considered valid if the element matches the schema, it exists on the element
10352
+ // The property is considered valid if the element matches the schema, it exists on the element,
10337
10353
  // or it is synthetic, and we are in a browser context (web worker nodes should be skipped).
10338
- if (matchingSchemas(tView, tNode.value) || propName in element || isAnimationProp(propName)) {
10354
+ if (matchingSchemas(schemas, tagName) || propName in element || isAnimationProp(propName)) {
10339
10355
  return true;
10340
10356
  }
10341
10357
  // Note: `typeof Node` returns 'function' in most browsers, but on IE it is 'object' so we
10342
- // need to account for both here, while being careful for `typeof null` also returning 'object'.
10358
+ // need to account for both here, while being careful with `typeof null` also returning 'object'.
10343
10359
  return typeof Node === 'undefined' || Node === null || !(element instanceof Node);
10344
10360
  }
10345
- function matchingSchemas(tView, tagName) {
10346
- const schemas = tView.schemas;
10361
+ /**
10362
+ * Returns true if the tag name is allowed by specified schemas.
10363
+ * @param schemas Array of schemas
10364
+ * @param tagName Name of the tag
10365
+ */
10366
+ function matchingSchemas(schemas, tagName) {
10347
10367
  if (schemas !== null) {
10348
10368
  for (let i = 0; i < schemas.length; i++) {
10349
10369
  const schema = schemas[i];
@@ -10358,10 +10378,10 @@ function matchingSchemas(tView, tagName) {
10358
10378
  /**
10359
10379
  * Logs an error that a property is not supported on an element.
10360
10380
  * @param propName Name of the invalid property.
10361
- * @param tNode Node on which we encountered the property.
10381
+ * @param tagName Name of the node on which we encountered the property.
10362
10382
  */
10363
- function logUnknownPropertyError(propName, tNode) {
10364
- let message = `Can't bind to '${propName}' since it isn't a known property of '${tNode.value}'.`;
10383
+ function logUnknownPropertyError(propName, tagName) {
10384
+ const message = `Can't bind to '${propName}' since it isn't a known property of '${tagName}'.`;
10365
10385
  console.error(formatRuntimeError(303 /* UNKNOWN_BINDING */, message));
10366
10386
  }
10367
10387
  /**
@@ -12837,22 +12857,8 @@ function getSymbolIterator() {
12837
12857
  * Use of this source code is governed by an MIT-style license that can be
12838
12858
  * found in the LICENSE file at https://angular.io/license
12839
12859
  */
12840
- function devModeEqual(a, b) {
12841
- const isListLikeIterableA = isListLikeIterable(a);
12842
- const isListLikeIterableB = isListLikeIterable(b);
12843
- if (isListLikeIterableA && isListLikeIterableB) {
12844
- return areIterablesEqual(a, b, devModeEqual);
12845
- }
12846
- else {
12847
- const isAObject = a && (typeof a === 'object' || typeof a === 'function');
12848
- const isBObject = b && (typeof b === 'object' || typeof b === 'function');
12849
- if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
12850
- return true;
12851
- }
12852
- else {
12853
- return Object.is(a, b);
12854
- }
12855
- }
12860
+ function isIterable(obj) {
12861
+ return obj !== null && typeof obj === 'object' && obj[getSymbolIterator()] !== undefined;
12856
12862
  }
12857
12863
  function isListLikeIterable(obj) {
12858
12864
  if (!isJsObject(obj))
@@ -12893,6 +12899,31 @@ function isJsObject(o) {
12893
12899
  return o !== null && (typeof o === 'function' || typeof o === 'object');
12894
12900
  }
12895
12901
 
12902
+ /**
12903
+ * @license
12904
+ * Copyright Google LLC All Rights Reserved.
12905
+ *
12906
+ * Use of this source code is governed by an MIT-style license that can be
12907
+ * found in the LICENSE file at https://angular.io/license
12908
+ */
12909
+ function devModeEqual(a, b) {
12910
+ const isListLikeIterableA = isListLikeIterable(a);
12911
+ const isListLikeIterableB = isListLikeIterable(b);
12912
+ if (isListLikeIterableA && isListLikeIterableB) {
12913
+ return areIterablesEqual(a, b, devModeEqual);
12914
+ }
12915
+ else {
12916
+ const isAObject = a && (typeof a === 'object' || typeof a === 'function');
12917
+ const isBObject = b && (typeof b === 'object' || typeof b === 'function');
12918
+ if (!isListLikeIterableA && isAObject && !isListLikeIterableB && isBObject) {
12919
+ return true;
12920
+ }
12921
+ else {
12922
+ return Object.is(a, b);
12923
+ }
12924
+ }
12925
+ }
12926
+
12896
12927
  /**
12897
12928
  * @license
12898
12929
  * Copyright Google LLC All Rights Reserved.
@@ -14637,7 +14668,7 @@ function elementStartFirstCreatePass(index, tView, lView, native, name, attrsInd
14637
14668
  const attrs = getConstant(tViewConsts, attrsIndex);
14638
14669
  const tNode = getOrCreateTNode(tView, index, 2 /* Element */, name, attrs);
14639
14670
  const hasDirectives = resolveDirectives(tView, lView, tNode, getConstant(tViewConsts, localRefsIndex));
14640
- ngDevMode && logUnknownElementError(tView, native, tNode, hasDirectives);
14671
+ ngDevMode && validateElementIsKnown(native, tNode.value, tView.schemas, hasDirectives);
14641
14672
  if (tNode.attrs !== null) {
14642
14673
  computeStaticStyling(tNode, tNode.attrs, false);
14643
14674
  }
@@ -14761,18 +14792,33 @@ function ɵɵelement(index, name, attrsIndex, localRefsIndex) {
14761
14792
  ɵɵelementEnd();
14762
14793
  return ɵɵelement;
14763
14794
  }
14764
- function logUnknownElementError(tView, element, tNode, hasDirectives) {
14765
- const schemas = tView.schemas;
14795
+ /**
14796
+ * Validates that the element is known at runtime and produces
14797
+ * an error if it's not the case.
14798
+ * This check is relevant for JIT-compiled components (for AOT-compiled
14799
+ * ones this check happens at build time).
14800
+ *
14801
+ * The element is considered known if either:
14802
+ * - it's a known HTML element
14803
+ * - it's a known custom element
14804
+ * - the element matches any directive
14805
+ * - the element is allowed by one of the schemas
14806
+ *
14807
+ * @param element Element to validate
14808
+ * @param tagName Name of the tag to check
14809
+ * @param schemas Array of schemas
14810
+ * @param hasDirectives Boolean indicating that the element matches any directive
14811
+ */
14812
+ function validateElementIsKnown(element, tagName, schemas, hasDirectives) {
14766
14813
  // If `schemas` is set to `null`, that's an indication that this Component was compiled in AOT
14767
14814
  // mode where this check happens at compile time. In JIT mode, `schemas` is always present and
14768
14815
  // defined as an array (as an empty array in case `schemas` field is not defined) and we should
14769
14816
  // execute the check below.
14770
14817
  if (schemas === null)
14771
14818
  return;
14772
- const tagName = tNode.value;
14773
14819
  // If the element matches any directive, it's considered as valid.
14774
14820
  if (!hasDirectives && tagName !== null) {
14775
- // The element is unknown if it's an instance of HTMLUnknownElement or it isn't registered
14821
+ // The element is unknown if it's an instance of HTMLUnknownElement, or it isn't registered
14776
14822
  // as a custom element. Note that unknown elements with a dash in their name won't be instances
14777
14823
  // of HTMLUnknownElement in browsers that support web components.
14778
14824
  const isUnknown =
@@ -14782,7 +14828,7 @@ function logUnknownElementError(tView, element, tNode, hasDirectives) {
14782
14828
  element instanceof HTMLUnknownElement) ||
14783
14829
  (typeof customElements !== 'undefined' && tagName.indexOf('-') > -1 &&
14784
14830
  !customElements.get(tagName));
14785
- if (isUnknown && !matchingSchemas(tView, tagName)) {
14831
+ if (isUnknown && !matchingSchemas(schemas, tagName)) {
14786
14832
  let message = `'${tagName}' is not a known element:\n`;
14787
14833
  message += `1. If '${tagName}' is an Angular component, then verify that it is part of this module.\n`;
14788
14834
  if (tagName && tagName.indexOf('-') > -1) {
@@ -21252,7 +21298,7 @@ class Version {
21252
21298
  /**
21253
21299
  * @publicApi
21254
21300
  */
21255
- const VERSION = new Version('14.0.0-next.10');
21301
+ const VERSION = new Version('14.0.0-next.13');
21256
21302
 
21257
21303
  /**
21258
21304
  * @license
@@ -24992,7 +25038,10 @@ const PLATFORM_INITIALIZER = new InjectionToken('Platform Initializer');
24992
25038
  * A token that indicates an opaque platform ID.
24993
25039
  * @publicApi
24994
25040
  */
24995
- const PLATFORM_ID = new InjectionToken('Platform ID');
25041
+ const PLATFORM_ID = new InjectionToken('Platform ID', {
25042
+ providedIn: 'platform',
25043
+ factory: () => 'unknown', // set a default platform name, when none set explicitly
25044
+ });
24996
25045
  /**
24997
25046
  * A [DI token](guide/glossary#di-token "DI token definition") that provides a set of callbacks to
24998
25047
  * be called for every component that is bootstrapped.
@@ -25039,9 +25088,10 @@ class Console {
25039
25088
  }
25040
25089
  }
25041
25090
  Console.ɵfac = function Console_Factory(t) { return new (t || Console)(); };
25042
- Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac });
25091
+ Console.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: Console, factory: Console.ɵfac, providedIn: 'platform' });
25043
25092
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(Console, [{
25044
- type: Injectable
25093
+ type: Injectable,
25094
+ args: [{ providedIn: 'platform' }]
25045
25095
  }], null, null); })();
25046
25096
 
25047
25097
  /**
@@ -25999,9 +26049,10 @@ class TestabilityRegistry {
25999
26049
  }
26000
26050
  }
26001
26051
  TestabilityRegistry.ɵfac = function TestabilityRegistry_Factory(t) { return new (t || TestabilityRegistry)(); };
26002
- TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac });
26052
+ TestabilityRegistry.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: TestabilityRegistry, factory: TestabilityRegistry.ɵfac, providedIn: 'platform' });
26003
26053
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(TestabilityRegistry, [{
26004
- type: Injectable
26054
+ type: Injectable,
26055
+ args: [{ providedIn: 'platform' }]
26005
26056
  }], function () { return []; }, null); })();
26006
26057
  class _NoopGetTestability {
26007
26058
  addToWindow(registry) { }
@@ -26313,9 +26364,10 @@ class PlatformRef {
26313
26364
  }
26314
26365
  }
26315
26366
  PlatformRef.ɵfac = function PlatformRef_Factory(t) { return new (t || PlatformRef)(ɵɵinject(Injector)); };
26316
- PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac });
26367
+ PlatformRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: PlatformRef, factory: PlatformRef.ɵfac, providedIn: 'platform' });
26317
26368
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(PlatformRef, [{
26318
- type: Injectable
26369
+ type: Injectable,
26370
+ args: [{ providedIn: 'platform' }]
26319
26371
  }], function () { return [{ type: Injector }]; }, null); })();
26320
26372
  function getNgZone(ngZoneOption, extra) {
26321
26373
  let ngZone;
@@ -26453,11 +26505,10 @@ function optionsReducer(dst, objs) {
26453
26505
  */
26454
26506
  class ApplicationRef {
26455
26507
  /** @internal */
26456
- constructor(_zone, _injector, _exceptionHandler, _componentFactoryResolver, _initStatus) {
26508
+ constructor(_zone, _injector, _exceptionHandler, _initStatus) {
26457
26509
  this._zone = _zone;
26458
26510
  this._injector = _injector;
26459
26511
  this._exceptionHandler = _exceptionHandler;
26460
- this._componentFactoryResolver = _componentFactoryResolver;
26461
26512
  this._initStatus = _initStatus;
26462
26513
  /** @internal */
26463
26514
  this._bootstrapListeners = [];
@@ -26573,8 +26624,8 @@ class ApplicationRef {
26573
26624
  componentFactory = componentOrFactory;
26574
26625
  }
26575
26626
  else {
26576
- componentFactory =
26577
- this._componentFactoryResolver.resolveComponentFactory(componentOrFactory);
26627
+ const resolver = this._injector.get(ComponentFactoryResolver$1);
26628
+ componentFactory = resolver.resolveComponentFactory(componentOrFactory);
26578
26629
  }
26579
26630
  this.componentTypes.push(componentFactory.componentType);
26580
26631
  // Create a factory associated with the current module if it's not bound to some other
@@ -26675,12 +26726,12 @@ class ApplicationRef {
26675
26726
  return this._views.length;
26676
26727
  }
26677
26728
  }
26678
- ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ComponentFactoryResolver$1), ɵɵinject(ApplicationInitStatus)); };
26729
+ ApplicationRef.ɵfac = function ApplicationRef_Factory(t) { return new (t || ApplicationRef)(ɵɵinject(NgZone), ɵɵinject(Injector), ɵɵinject(ErrorHandler), ɵɵinject(ApplicationInitStatus)); };
26679
26730
  ApplicationRef.ɵprov = /*@__PURE__*/ ɵɵdefineInjectable({ token: ApplicationRef, factory: ApplicationRef.ɵfac, providedIn: 'root' });
26680
26731
  (function () { (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ApplicationRef, [{
26681
26732
  type: Injectable,
26682
26733
  args: [{ providedIn: 'root' }]
26683
- }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ComponentFactoryResolver$1 }, { type: ApplicationInitStatus }]; }, null); })();
26734
+ }], function () { return [{ type: NgZone }, { type: Injector }, { type: ErrorHandler }, { type: ApplicationInitStatus }]; }, null); })();
26684
26735
  function remove(list, el) {
26685
26736
  const index = list.indexOf(el);
26686
26737
  if (index > -1) {
@@ -28663,19 +28714,12 @@ const defaultKeyValueDiffers = new KeyValueDiffers(keyValDiff);
28663
28714
  * Use of this source code is governed by an MIT-style license that can be
28664
28715
  * found in the LICENSE file at https://angular.io/license
28665
28716
  */
28666
- const _CORE_PLATFORM_PROVIDERS = [
28667
- // Set a default platform name for platforms that don't set it explicitly.
28668
- { provide: PLATFORM_ID, useValue: 'unknown' },
28669
- { provide: PlatformRef, deps: [Injector] },
28670
- { provide: TestabilityRegistry, deps: [] },
28671
- { provide: Console, deps: [] },
28672
- ];
28673
28717
  /**
28674
28718
  * This platform has to be included in any other platform
28675
28719
  *
28676
28720
  * @publicApi
28677
28721
  */
28678
- const platformCore = createPlatformFactory(null, 'core', _CORE_PLATFORM_PROVIDERS);
28722
+ const platformCore = createPlatformFactory(null, 'core', []);
28679
28723
 
28680
28724
  /**
28681
28725
  * @license