@angular/core 17.0.0-next.0 → 17.0.0-next.1

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 v17.0.0-next.0
2
+ * @license Angular v17.0.0-next.1
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 v17.0.0-next.0
2
+ * @license Angular v17.0.0-next.1
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -2879,20 +2879,6 @@ function ɵɵdefineComponent(componentDefinition) {
2879
2879
  return def;
2880
2880
  });
2881
2881
  }
2882
- /**
2883
- * Generated next to NgModules to monkey-patch directive and pipe references onto a component's
2884
- * definition, when generating a direct reference in the component file would otherwise create an
2885
- * import cycle.
2886
- *
2887
- * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.
2888
- *
2889
- * @codeGenApi
2890
- */
2891
- function ɵɵsetComponentScope(type, directives, pipes) {
2892
- const def = type.ɵcmp;
2893
- def.directiveDefs = extractDefListOrFactory(directives, /* pipeDef */ false);
2894
- def.pipeDefs = extractDefListOrFactory(pipes, /* pipeDef */ true);
2895
- }
2896
2882
  function extractDirectiveDef(type) {
2897
2883
  return getComponentDef$1(type) || getDirectiveDef(type);
2898
2884
  }
@@ -2917,24 +2903,6 @@ function ɵɵdefineNgModule(def) {
2917
2903
  return res;
2918
2904
  });
2919
2905
  }
2920
- /**
2921
- * Adds the module metadata that is necessary to compute the module's transitive scope to an
2922
- * existing module definition.
2923
- *
2924
- * Scope metadata of modules is not used in production builds, so calls to this function can be
2925
- * marked pure to tree-shake it from the bundle, allowing for all referenced declarations
2926
- * to become eligible for tree-shaking as well.
2927
- *
2928
- * @codeGenApi
2929
- */
2930
- function ɵɵsetNgModuleScope(type, scope) {
2931
- return noSideEffects(() => {
2932
- const ngModuleDef = getNgModuleDef(type, true);
2933
- ngModuleDef.declarations = scope.declarations || EMPTY_ARRAY;
2934
- ngModuleDef.imports = scope.imports || EMPTY_ARRAY;
2935
- ngModuleDef.exports = scope.exports || EMPTY_ARRAY;
2936
- });
2937
- }
2938
2906
  /**
2939
2907
  * Inverts an inputs or outputs lookup such that the keys, which were the
2940
2908
  * minified keys, are part of the values, and the values are parsed so that
@@ -7767,9 +7735,6 @@ class DepsTracker {
7767
7735
  throw new Error(`Attempting to get component dependencies for a type that is not a component: ${type}`);
7768
7736
  }
7769
7737
  if (def.standalone) {
7770
- if (!rawImports) {
7771
- throw new Error('Standalone component should pass its raw import in order to compute its dependencies');
7772
- }
7773
7738
  const scope = this.getStandaloneComponentScope(type, rawImports);
7774
7739
  if (scope.compilation.isPoisoned) {
7775
7740
  return { dependencies: [] };
@@ -7917,7 +7882,7 @@ class DepsTracker {
7917
7882
  pipes: new Set(),
7918
7883
  },
7919
7884
  };
7920
- for (const rawImport of rawImports) {
7885
+ for (const rawImport of rawImports ?? []) {
7921
7886
  const imported = resolveForwardRef(rawImport);
7922
7887
  try {
7923
7888
  verifyStandaloneImport(imported, type);
@@ -11307,7 +11272,7 @@ class Version {
11307
11272
  /**
11308
11273
  * @publicApi
11309
11274
  */
11310
- const VERSION = new Version('17.0.0-next.0');
11275
+ const VERSION = new Version('17.0.0-next.1');
11311
11276
 
11312
11277
  // This default value is when checking the hierarchy for a token.
11313
11278
  //
@@ -23119,6 +23084,54 @@ function ɵɵStandaloneFeature(definition) {
23119
23084
  };
23120
23085
  }
23121
23086
 
23087
+ /**
23088
+ * Generated next to NgModules to monkey-patch directive and pipe references onto a component's
23089
+ * definition, when generating a direct reference in the component file would otherwise create an
23090
+ * import cycle.
23091
+ *
23092
+ * See [this explanation](https://hackmd.io/Odw80D0pR6yfsOjg_7XCJg?view) for more details.
23093
+ *
23094
+ * @codeGenApi
23095
+ */
23096
+ function ɵɵsetComponentScope(type, directives, pipes) {
23097
+ const def = type.ɵcmp;
23098
+ def.directiveDefs = extractDefListOrFactory(directives, /* pipeDef */ false);
23099
+ def.pipeDefs = extractDefListOrFactory(pipes, /* pipeDef */ true);
23100
+ }
23101
+ /**
23102
+ * Adds the module metadata that is necessary to compute the module's transitive scope to an
23103
+ * existing module definition.
23104
+ *
23105
+ * Scope metadata of modules is not used in production builds, so calls to this function can be
23106
+ * marked pure to tree-shake it from the bundle, allowing for all referenced declarations
23107
+ * to become eligible for tree-shaking as well.
23108
+ *
23109
+ * @codeGenApi
23110
+ */
23111
+ function ɵɵsetNgModuleScope(type, scope) {
23112
+ return noSideEffects(() => {
23113
+ const ngModuleDef = getNgModuleDef(type, true);
23114
+ ngModuleDef.declarations = convertToTypeArray(scope.declarations || EMPTY_ARRAY);
23115
+ ngModuleDef.imports = convertToTypeArray(scope.imports || EMPTY_ARRAY);
23116
+ ngModuleDef.exports = convertToTypeArray(scope.exports || EMPTY_ARRAY);
23117
+ depsTracker.registerNgModule(type, scope);
23118
+ });
23119
+ }
23120
+ function convertToTypeArray(values) {
23121
+ if (typeof values === 'function') {
23122
+ return values;
23123
+ }
23124
+ if (values.some(isForwardRef)) {
23125
+ return () => values.map(resolveForwardRef).map(maybeUnwrapModuleWithProviders);
23126
+ }
23127
+ else {
23128
+ return values.map(maybeUnwrapModuleWithProviders);
23129
+ }
23130
+ }
23131
+ function maybeUnwrapModuleWithProviders(value) {
23132
+ return isModuleWithProviders$1(value) ? value.ngModule : value;
23133
+ }
23134
+
23122
23135
  /**
23123
23136
  * Retrieves the component instance associated with a given DOM element.
23124
23137
  *
@@ -25332,8 +25345,9 @@ function ɵɵtemplateRefExtractor(tNode, lView) {
25332
25345
  }
25333
25346
 
25334
25347
  function ɵɵgetComponentDepsFactory(type, rawImports) {
25335
- // TODO(pmvald): Implement this runtime using deps tracker.
25336
- return () => [];
25348
+ return () => {
25349
+ return depsTracker.getComponentDependencies(type, rawImports).dependencies;
25350
+ };
25337
25351
  }
25338
25352
 
25339
25353
  /**
@@ -25458,6 +25472,7 @@ const angularCoreEnv = (() => ({
25458
25472
  'ɵɵclassProp': ɵɵclassProp,
25459
25473
  'ɵɵadvance': ɵɵadvance,
25460
25474
  'ɵɵtemplate': ɵɵtemplate,
25475
+ 'ɵɵconditional': ɵɵconditional,
25461
25476
  'ɵɵdefer': ɵɵdefer,
25462
25477
  'ɵɵdeferWhen': ɵɵdeferWhen,
25463
25478
  'ɵɵdeferOnIdle': ɵɵdeferOnIdle,
@@ -27216,7 +27231,7 @@ class TestBedImpl {
27216
27231
  /**
27217
27232
  * Runs the given function in the `EnvironmentInjector` context of `TestBed`.
27218
27233
  *
27219
- * @see EnvironmentInjector#runInContext
27234
+ * @see {@link EnvironmentInjector#runInContext}
27220
27235
  */
27221
27236
  static runInInjectionContext(fn) {
27222
27237
  return TestBedImpl.INSTANCE.runInInjectionContext(fn);
@@ -27624,11 +27639,15 @@ function withModule(moduleDef, fn) {
27624
27639
  * allows tests to be asynchronous by either returning a promise or using a 'done' parameter.
27625
27640
  */
27626
27641
  // Reset the test providers and the fake async zone before each test.
27627
- beforeEach(getCleanupHook(false));
27642
+ // We keep a guard because somehow this file can make it into a bundle and be executed
27643
+ // beforeEach is only defined when executing the tests
27644
+ globalThis.beforeEach?.(getCleanupHook(false));
27628
27645
  // We provide both a `beforeEach` and `afterEach`, because the updated behavior for
27629
27646
  // tearing down the module is supposed to run after the test so that we can associate
27630
27647
  // teardown errors with the correct test.
27631
- afterEach(getCleanupHook(true));
27648
+ // We keep a guard because somehow this file can make it into a bundle and be executed
27649
+ // afterEach is only defined when executing the tests
27650
+ globalThis.afterEach?.(getCleanupHook(true));
27632
27651
  function getCleanupHook(expectedTeardownValue) {
27633
27652
  return () => {
27634
27653
  const testBed = TestBedImpl.INSTANCE;