@angular/core 16.0.0-rc.2 → 16.0.0-rc.3

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 (38) hide show
  1. package/esm2022/rxjs-interop/src/take_until_destroyed.mjs +3 -2
  2. package/esm2022/rxjs-interop/src/to_observable.mjs +19 -18
  3. package/esm2022/src/application_init.mjs +9 -3
  4. package/esm2022/src/application_ref.mjs +2 -1
  5. package/esm2022/src/errors.mjs +3 -3
  6. package/esm2022/src/hydration/error_handling.mjs +13 -5
  7. package/esm2022/src/linker/template_ref.mjs +3 -2
  8. package/esm2022/src/render3/component_ref.mjs +3 -2
  9. package/esm2022/src/render3/definition.mjs +4 -5
  10. package/esm2022/src/render3/instructions/change_detection.mjs +263 -3
  11. package/esm2022/src/render3/instructions/element.mjs +2 -2
  12. package/esm2022/src/render3/instructions/element_container.mjs +2 -2
  13. package/esm2022/src/render3/instructions/render.mjs +125 -0
  14. package/esm2022/src/render3/instructions/shared.mjs +23 -405
  15. package/esm2022/src/render3/instructions/template.mjs +22 -9
  16. package/esm2022/src/render3/interfaces/container.mjs +3 -3
  17. package/esm2022/src/render3/interfaces/view.mjs +2 -2
  18. package/esm2022/src/render3/node_manipulation.mjs +4 -8
  19. package/esm2022/src/render3/util/view_utils.mjs +35 -11
  20. package/esm2022/src/render3/view_ref.mjs +2 -2
  21. package/esm2022/src/version.mjs +1 -1
  22. package/esm2022/testing/src/logger.mjs +3 -3
  23. package/esm2022/testing/src/test_bed.mjs +1 -3
  24. package/esm2022/testing/src/test_bed_common.mjs +1 -1
  25. package/fesm2022/core.mjs +647 -618
  26. package/fesm2022/core.mjs.map +1 -1
  27. package/fesm2022/rxjs-interop.mjs +23 -21
  28. package/fesm2022/rxjs-interop.mjs.map +1 -1
  29. package/fesm2022/testing.mjs +639 -618
  30. package/fesm2022/testing.mjs.map +1 -1
  31. package/index.d.ts +24 -10
  32. package/package.json +1 -1
  33. package/rxjs-interop/index.d.ts +1 -1
  34. package/schematics/migrations/guard-and-resolve-interfaces/bundle.js +13 -13
  35. package/schematics/migrations/remove-module-id/bundle.js +14 -14
  36. package/schematics/ng-generate/standalone-migration/bundle.js +360 -346
  37. package/schematics/ng-generate/standalone-migration/bundle.js.map +2 -2
  38. package/testing/index.d.ts +3 -3
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-rc.2
2
+ * @license Angular v16.0.0-rc.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -275,6 +275,7 @@ export declare class ApplicationInitStatus {
275
275
  readonly done = false;
276
276
  readonly donePromise: Promise<any>;
277
277
  private readonly appInits;
278
+ constructor();
278
279
  static ɵfac: i0.ɵɵFactoryDeclaration<ApplicationInitStatus, never>;
279
280
  static ɵprov: i0.ɵɵInjectableDeclaration<ApplicationInitStatus>;
280
281
  }
@@ -2306,6 +2307,8 @@ declare interface DehydratedView {
2306
2307
 
2307
2308
  declare type DependencyTypeList = (ɵDirectiveType<any> | ɵComponentType<any> | PipeType<any> | Type<any>)[];
2308
2309
 
2310
+ declare const DESCENDANT_VIEWS_TO_REFRESH = 5;
2311
+
2309
2312
  /**
2310
2313
  * Array of destroy hooks that should be executed for a view and their directive indices.
2311
2314
  *
@@ -5037,7 +5040,7 @@ declare interface LContainer extends Array<any> {
5037
5040
  * change detection we should still descend to find those children to refresh, even if the parents
5038
5041
  * are not `Dirty`/`CheckAlways`.
5039
5042
  */
5040
- [TRANSPLANTED_VIEWS_TO_REFRESH]: number;
5043
+ [DESCENDANT_VIEWS_TO_REFRESH]: number;
5041
5044
  /**
5042
5045
  * A collection of views created based on the underlying `<ng-template>` element but inserted into
5043
5046
  * a different `LContainer`. We need to track views created from a given declaration point since
@@ -5390,7 +5393,7 @@ declare interface LView<T = unknown> extends Array<any> {
5390
5393
  * change detection we should still descend to find those children to refresh, even if the parents
5391
5394
  * are not `Dirty`/`CheckAlways`.
5392
5395
  */
5393
- [TRANSPLANTED_VIEWS_TO_REFRESH]: number;
5396
+ [DESCENDANT_VIEWS_TO_REFRESH]: number;
5394
5397
  /** Unique ID of the view. Used for `__ngContext__` lookups in the `LView` registry. */
5395
5398
  [ID]: number;
5396
5399
  /**
@@ -5468,16 +5471,21 @@ declare const enum LViewFlags {
5468
5471
  /** Whether or not this view is the root view */
5469
5472
  IsRoot = 512,
5470
5473
  /**
5471
- * Whether this moved LView was needs to be refreshed at the insertion location because the
5472
- * declaration was dirty.
5474
+ * Whether this moved LView was needs to be refreshed. Similar to the Dirty flag, but used for
5475
+ * transplanted and signal views where the parent/ancestor views are not marked dirty as well.
5476
+ * i.e. "Refresh just this view". Used in conjunction with the DESCENDANT_VIEWS_TO_REFRESH
5477
+ * counter.
5473
5478
  */
5474
- RefreshTransplantedView = 1024,
5479
+ RefreshView = 1024,
5475
5480
  /** Indicates that the view **or any of its ancestors** have an embedded view injector. */
5476
5481
  HasEmbeddedViewInjector = 2048,
5477
5482
  /**
5478
5483
  * Index of the current init phase on last 21 bits
5479
5484
  */
5480
5485
  IndexWithinInitPhaseIncrementer = 4096,
5486
+ /**
5487
+ * This is the count of the bits the 1 was shifted above (base 10)
5488
+ */
5481
5489
  IndexWithinInitPhaseShift = 12,
5482
5490
  IndexWithinInitPhaseReset = 4095
5483
5491
  }
@@ -7503,6 +7511,14 @@ export declare function runInInjectionContext<ReturnT>(injector: Injector, fn: (
7503
7511
  * error codes which have guides, which might leak into runtime code.
7504
7512
  *
7505
7513
  * Full list of available error guides can be found at https://angular.io/errors.
7514
+ *
7515
+ * Error code ranges per package:
7516
+ * - core (this package): 100-999
7517
+ * - forms: 1000-1999
7518
+ * - common: 2000-2999
7519
+ * - animations: 3000-3999
7520
+ * - router: 4000-4999
7521
+ * - platform-browser: 5000-5500
7506
7522
  */
7507
7523
  declare const enum RuntimeErrorCode {
7508
7524
  EXPRESSION_CHANGED_AFTER_CHECKED = -100,
@@ -7559,7 +7575,8 @@ declare const enum RuntimeErrorCode {
7559
7575
  MISSING_ZONEJS = 908,
7560
7576
  UNEXPECTED_ZONE_STATE = 909,
7561
7577
  UNSAFE_IFRAME_ATTRS = -910,
7562
- VIEW_ALREADY_DESTROYED = 911
7578
+ VIEW_ALREADY_DESTROYED = 911,
7579
+ COMPONENT_ID_COLLISION = -912
7563
7580
  }
7564
7581
 
7565
7582
  /**
@@ -9078,8 +9095,6 @@ export declare const TRANSLATIONS: InjectionToken<string>;
9078
9095
  */
9079
9096
  export declare const TRANSLATIONS_FORMAT: InjectionToken<string>;
9080
9097
 
9081
- declare const TRANSPLANTED_VIEWS_TO_REFRESH = 5;
9082
-
9083
9098
 
9084
9099
  /**
9085
9100
  * @fileoverview
@@ -10524,7 +10539,6 @@ export declare const ɵdefaultIterableDiffers: IterableDiffers;
10524
10539
 
10525
10540
  export declare const ɵdefaultKeyValueDiffers: KeyValueDiffers;
10526
10541
 
10527
-
10528
10542
  /**
10529
10543
  * Synchronously perform change detection on a component (and possibly its sub-components).
10530
10544
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "16.0.0-rc.2",
3
+ "version": "16.0.0-rc.3",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v16.0.0-rc.2
2
+ * @license Angular v16.0.0-rc.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -60,7 +60,7 @@ var __async = (__this, __arguments, generator) => {
60
60
  });
61
61
  };
62
62
 
63
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/index.mjs
63
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/index.mjs
64
64
  var guard_and_resolve_interfaces_exports = {};
65
65
  __export(guard_and_resolve_interfaces_exports, {
66
66
  default: () => guard_and_resolve_interfaces_default
@@ -69,7 +69,7 @@ module.exports = __toCommonJS(guard_and_resolve_interfaces_exports);
69
69
  var import_schematics = require("@angular-devkit/schematics");
70
70
  var import_path3 = require("path");
71
71
 
72
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
72
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
73
73
  var import_core = require("@angular-devkit/core");
74
74
  function getProjectTsConfigPaths(tree) {
75
75
  return __async(this, null, function* () {
@@ -149,11 +149,11 @@ function getWorkspace(tree) {
149
149
  });
150
150
  }
151
151
 
152
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
152
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
153
153
  var import_path = require("path");
154
154
  var import_typescript2 = __toESM(require("typescript"), 1);
155
155
 
156
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
156
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
157
157
  var path = __toESM(require("path"), 1);
158
158
  var import_typescript = __toESM(require("typescript"), 1);
159
159
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -170,7 +170,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
170
170
  return import_typescript.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
171
171
  }
172
172
 
173
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
173
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
174
174
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
175
175
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
176
176
  return import_typescript2.default.createProgram(rootNames, options, host);
@@ -203,13 +203,13 @@ function canMigrateFile(basePath, sourceFile, program) {
203
203
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
204
204
  }
205
205
 
206
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/util.mjs
206
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/util.mjs
207
207
  var import_typescript7 = __toESM(require("typescript"), 1);
208
208
 
209
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
209
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
210
210
  var import_typescript4 = __toESM(require("typescript"), 1);
211
211
 
212
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
212
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/import_manager.mjs
213
213
  var import_path2 = require("path");
214
214
  var import_typescript3 = __toESM(require("typescript"), 1);
215
215
  var ImportManager = class {
@@ -393,7 +393,7 @@ ${text}`;
393
393
  }
394
394
  };
395
395
 
396
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
396
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/change_tracker.mjs
397
397
  var ChangeTracker = class {
398
398
  constructor(_printer, _importRemapper) {
399
399
  __publicField(this, "_printer");
@@ -449,7 +449,7 @@ function normalizePath(path2) {
449
449
  return path2.replace(/\\/g, "/");
450
450
  }
451
451
 
452
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
452
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
453
453
  var import_typescript5 = __toESM(require("typescript"), 1);
454
454
  function getImportOfIdentifier(typeChecker, node) {
455
455
  const symbol = typeChecker.getSymbolAtLocation(node);
@@ -521,7 +521,7 @@ function findImportSpecifier(nodes, specifierName) {
521
521
  });
522
522
  }
523
523
 
524
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs
524
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/nodes.mjs
525
525
  var import_typescript6 = __toESM(require("typescript"), 1);
526
526
  function closestNode(node, predicate) {
527
527
  let current = node.parent;
@@ -534,7 +534,7 @@ function closestNode(node, predicate) {
534
534
  return null;
535
535
  }
536
536
 
537
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/util.mjs
537
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/util.mjs
538
538
  var deprecatedInterfaces = /* @__PURE__ */ new Set(["CanLoad", "CanMatch", "CanActivate", "CanDeactivate", "CanActivateChild", "Resolve"]);
539
539
  var routerModule = "@angular/router";
540
540
  function migrateFile(sourceFile, typeChecker, rewriteFn) {
@@ -647,7 +647,7 @@ function visitTypeReference(typeReference, typeChecker, changeTracker, sourceFil
647
647
  import_typescript7.default.forEachChild(typeReference, visitTypeReferenceChildren);
648
648
  }
649
649
 
650
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/index.mjs
650
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/guard-and-resolve-interfaces/index.mjs
651
651
  function guard_and_resolve_interfaces_default() {
652
652
  return (tree) => __async(this, null, function* () {
653
653
  const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);
@@ -56,7 +56,7 @@ var __async = (__this, __arguments, generator) => {
56
56
  });
57
57
  };
58
58
 
59
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/remove-module-id/index.mjs
59
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/remove-module-id/index.mjs
60
60
  var remove_module_id_exports = {};
61
61
  __export(remove_module_id_exports, {
62
62
  default: () => remove_module_id_default
@@ -66,13 +66,13 @@ var import_schematics = require("@angular-devkit/schematics");
66
66
  var import_path2 = require("path");
67
67
  var import_typescript8 = __toESM(require("typescript"), 1);
68
68
 
69
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/extract_metadata.mjs
69
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/extract_metadata.mjs
70
70
  var import_typescript4 = __toESM(require("typescript"), 1);
71
71
 
72
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
72
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
73
73
  var import_typescript2 = __toESM(require("typescript"), 1);
74
74
 
75
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
75
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/imports.mjs
76
76
  var import_typescript = __toESM(require("typescript"), 1);
77
77
  function getImportOfIdentifier(typeChecker, node) {
78
78
  const symbol = typeChecker.getSymbolAtLocation(node);
@@ -94,7 +94,7 @@ function getImportOfIdentifier(typeChecker, node) {
94
94
  };
95
95
  }
96
96
 
97
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
97
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/decorators.mjs
98
98
  function getCallDecoratorImport(typeChecker, decorator) {
99
99
  if (!import_typescript2.default.isCallExpression(decorator.expression) || !import_typescript2.default.isIdentifier(decorator.expression.expression)) {
100
100
  return null;
@@ -103,7 +103,7 @@ function getCallDecoratorImport(typeChecker, decorator) {
103
103
  return getImportOfIdentifier(typeChecker, identifier);
104
104
  }
105
105
 
106
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/ng_decorators.mjs
106
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/ng_decorators.mjs
107
107
  function getAngularDecorators(typeChecker, decorators) {
108
108
  return decorators.map((node) => ({ node, importData: getCallDecoratorImport(typeChecker, node) })).filter(({ importData }) => importData && importData.importModule.startsWith("@angular/")).map(({ node, importData }) => ({
109
109
  node,
@@ -113,7 +113,7 @@ function getAngularDecorators(typeChecker, decorators) {
113
113
  }));
114
114
  }
115
115
 
116
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/functions.mjs
116
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/functions.mjs
117
117
  var import_typescript3 = __toESM(require("typescript"), 1);
118
118
  function unwrapExpression(node) {
119
119
  if (import_typescript3.default.isParenthesizedExpression(node) || import_typescript3.default.isAsExpression(node)) {
@@ -123,7 +123,7 @@ function unwrapExpression(node) {
123
123
  }
124
124
  }
125
125
 
126
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/extract_metadata.mjs
126
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/extract_metadata.mjs
127
127
  function extractAngularClassMetadata(typeChecker, node) {
128
128
  const decorators = import_typescript4.default.getDecorators(node);
129
129
  if (!decorators || !decorators.length) {
@@ -150,7 +150,7 @@ function extractAngularClassMetadata(typeChecker, node) {
150
150
  };
151
151
  }
152
152
 
153
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
153
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/project_tsconfig_paths.mjs
154
154
  var import_core = require("@angular-devkit/core");
155
155
  function getProjectTsConfigPaths(tree) {
156
156
  return __async(this, null, function* () {
@@ -230,11 +230,11 @@ function getWorkspace(tree) {
230
230
  });
231
231
  }
232
232
 
233
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
233
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
234
234
  var import_path = require("path");
235
235
  var import_typescript6 = __toESM(require("typescript"), 1);
236
236
 
237
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
237
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/parse_tsconfig.mjs
238
238
  var path = __toESM(require("path"), 1);
239
239
  var import_typescript5 = __toESM(require("typescript"), 1);
240
240
  function parseTsconfigFile(tsconfigPath, basePath) {
@@ -251,7 +251,7 @@ function parseTsconfigFile(tsconfigPath, basePath) {
251
251
  return import_typescript5.default.parseJsonConfigFileContent(config, parseConfigHost, basePath, {});
252
252
  }
253
253
 
254
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
254
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/compiler_host.mjs
255
255
  function createMigrationProgram(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles) {
256
256
  const { rootNames, options, host } = createProgramOptions(tree, tsconfigPath, basePath, fakeFileRead, additionalFiles);
257
257
  return import_typescript6.default.createProgram(rootNames, options, host);
@@ -284,7 +284,7 @@ function canMigrateFile(basePath, sourceFile, program) {
284
284
  return !(0, import_path.relative)(basePath, sourceFile.fileName).startsWith("..");
285
285
  }
286
286
 
287
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/utils/typescript/property_name.mjs
287
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/utils/typescript/property_name.mjs
288
288
  var import_typescript7 = __toESM(require("typescript"), 1);
289
289
  function getPropertyNameText(node) {
290
290
  if (import_typescript7.default.isIdentifier(node) || import_typescript7.default.isStringLiteralLike(node)) {
@@ -293,7 +293,7 @@ function getPropertyNameText(node) {
293
293
  return null;
294
294
  }
295
295
 
296
- // bazel-out/k8-fastbuild/bin/packages/core/schematics/migrations/remove-module-id/index.mjs
296
+ // bazel-out/darwin-fastbuild/bin/packages/core/schematics/migrations/remove-module-id/index.mjs
297
297
  function remove_module_id_default() {
298
298
  return (tree) => __async(this, null, function* () {
299
299
  const { buildPaths, testPaths } = yield getProjectTsConfigPaths(tree);