@angular/core 20.0.0-next.0 → 20.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.
Files changed (43) hide show
  1. package/fesm2022/core.mjs +6448 -6198
  2. package/fesm2022/core.mjs.map +1 -1
  3. package/fesm2022/primitives/di.mjs +45 -0
  4. package/fesm2022/primitives/di.mjs.map +1 -0
  5. package/fesm2022/primitives/event-dispatch.mjs +2 -2
  6. package/fesm2022/primitives/signals.mjs +2 -2
  7. package/fesm2022/rxjs-interop.mjs +2 -2
  8. package/fesm2022/testing.mjs +280 -119
  9. package/fesm2022/testing.mjs.map +1 -1
  10. package/index.d.ts +138 -51
  11. package/package.json +11 -1
  12. package/primitives/di/index.d.ts +99 -0
  13. package/primitives/event-dispatch/index.d.ts +2 -2
  14. package/primitives/signals/index.d.ts +2 -2
  15. package/rxjs-interop/index.d.ts +2 -2
  16. package/schematics/bundles/{apply_import_manager-0959b78c.js → apply_import_manager-e2a7fe5b.js} +4 -4
  17. package/schematics/bundles/{checker-cf6f7980.js → checker-af521da6.js} +346 -234
  18. package/schematics/bundles/cleanup-unused-imports.js +8 -8
  19. package/schematics/bundles/{compiler_host-cc1379e9.js → compiler_host-5a29293c.js} +3 -3
  20. package/schematics/bundles/control-flow-migration.js +4 -4
  21. package/schematics/bundles/explicit-standalone-flag.js +6 -6
  22. package/schematics/bundles/{imports-31a38653.js → imports-047fbbc8.js} +2 -2
  23. package/schematics/bundles/{index-42d84d69.js → index-1bef3025.js} +5 -5
  24. package/schematics/bundles/{index-6675d6bc.js → index-ef1bffbb.js} +5 -5
  25. package/schematics/bundles/inject-migration.js +8 -8
  26. package/schematics/bundles/{leading_space-6e7a8ec6.js → leading_space-f8944434.js} +2 -2
  27. package/schematics/bundles/{migrate_ts_type_references-5089e4ef.js → migrate_ts_type_references-2a3e9e6b.js} +13 -15
  28. package/schematics/bundles/{ng_decorators-6878e227.js → ng_decorators-b0d8b324.js} +3 -3
  29. package/schematics/bundles/{nodes-ffdce442.js → nodes-7758dbf6.js} +2 -2
  30. package/schematics/bundles/output-migration.js +8 -8
  31. package/schematics/bundles/pending-tasks.js +6 -6
  32. package/schematics/bundles/{program-362689f0.js → program-a449f9bf.js} +14 -14
  33. package/schematics/bundles/{project_paths-7d2daa1e.js → project_paths-17dc204d.js} +4 -4
  34. package/schematics/bundles/{project_tsconfig_paths-6c9cde78.js → project_tsconfig_paths-b558633b.js} +2 -2
  35. package/schematics/bundles/{property_name-42030525.js → property_name-ac18447e.js} +2 -2
  36. package/schematics/bundles/provide-initializer.js +6 -6
  37. package/schematics/bundles/route-lazy-loading.js +6 -6
  38. package/schematics/bundles/self-closing-tags-migration.js +44 -28
  39. package/schematics/bundles/signal-input-migration.js +10 -10
  40. package/schematics/bundles/signal-queries-migration.js +10 -10
  41. package/schematics/bundles/signals.js +10 -10
  42. package/schematics/bundles/standalone-migration.js +10 -10
  43. package/testing/index.d.ts +25 -14
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v20.0.0-next.1
4
+ * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
@@ -9,21 +9,21 @@
9
9
  Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
13
- var project_paths = require('./project_paths-7d2daa1e.js');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-b558633b.js');
13
+ var project_paths = require('./project_paths-17dc204d.js');
14
14
  require('os');
15
15
  var ts = require('typescript');
16
- var checker = require('./checker-cf6f7980.js');
17
- require('./program-362689f0.js');
16
+ var checker = require('./checker-af521da6.js');
17
+ require('./program-a449f9bf.js');
18
18
  require('path');
19
- var ng_decorators = require('./ng_decorators-6878e227.js');
20
- var property_name = require('./property_name-42030525.js');
19
+ var ng_decorators = require('./ng_decorators-b0d8b324.js');
20
+ var property_name = require('./property_name-ac18447e.js');
21
21
  require('@angular-devkit/core');
22
22
  require('node:path/posix');
23
23
  require('fs');
24
24
  require('module');
25
25
  require('url');
26
- require('./imports-31a38653.js');
26
+ require('./imports-047fbbc8.js');
27
27
 
28
28
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
29
29
 
@@ -315,6 +315,7 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
315
315
  const tagReplacements = [];
316
316
  for (const sf of sourceFiles) {
317
317
  ts__default["default"].forEachChild(sf, (node) => {
318
+ // Skipping any non component declarations
318
319
  if (!ts__default["default"].isClassDeclaration(node)) {
319
320
  return;
320
321
  }
@@ -326,22 +327,23 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
326
327
  templateVisitor.visitNode(node);
327
328
  templateVisitor.resolvedTemplates.forEach((template) => {
328
329
  const { migrated, changed, replacementCount } = migrateTemplateToSelfClosingTags(template.content);
329
- if (changed) {
330
- const fileToMigrate = template.inline
331
- ? file
332
- : project_paths.projectFile(template.filePath, info);
333
- const end = template.start + template.content.length;
334
- const replacements = [
335
- prepareTextReplacement(fileToMigrate, migrated, template.start, end),
336
- ];
337
- const fileReplacements = tagReplacements.find((tagReplacement) => tagReplacement.file === file);
338
- if (fileReplacements) {
339
- fileReplacements.replacements.push(...replacements);
340
- fileReplacements.replacementCount += replacementCount;
341
- }
342
- else {
343
- tagReplacements.push({ file, replacements, replacementCount });
344
- }
330
+ if (!changed) {
331
+ return;
332
+ }
333
+ const fileToMigrate = template.inline
334
+ ? file
335
+ : project_paths.projectFile(template.filePath, info);
336
+ const end = template.start + template.content.length;
337
+ const replacements = [
338
+ prepareTextReplacement(fileToMigrate, migrated, template.start, end),
339
+ ];
340
+ const fileReplacements = tagReplacements.find((tagReplacement) => tagReplacement.file === file);
341
+ if (fileReplacements) {
342
+ fileReplacements.replacements.push(...replacements);
343
+ fileReplacements.replacementCount += replacementCount;
344
+ }
345
+ else {
346
+ tagReplacements.push({ file, replacements, replacementCount });
345
347
  }
346
348
  });
347
349
  });
@@ -349,9 +351,11 @@ class SelfClosingTagsMigration extends project_paths.TsurgeFunnelMigration {
349
351
  return project_paths.confirmAsSerializable({ tagReplacements });
350
352
  }
351
353
  async combine(unitA, unitB) {
352
- return project_paths.confirmAsSerializable({
353
- tagReplacements: unitA.tagReplacements.concat(unitB.tagReplacements),
354
- });
354
+ const uniqueReplacements = removeDuplicateReplacements([
355
+ ...unitA.tagReplacements,
356
+ ...unitB.tagReplacements,
357
+ ]);
358
+ return project_paths.confirmAsSerializable({ tagReplacements: uniqueReplacements });
355
359
  }
356
360
  async globalMeta(combinedData) {
357
361
  const globalMeta = {
@@ -380,6 +384,18 @@ function prepareTextReplacement(file, replacement, start, end) {
380
384
  toInsert: replacement,
381
385
  }));
382
386
  }
387
+ function removeDuplicateReplacements(replacements) {
388
+ const uniqueFiles = new Set();
389
+ const result = [];
390
+ for (const replacement of replacements) {
391
+ const fileId = replacement.file.id;
392
+ if (!uniqueFiles.has(fileId)) {
393
+ uniqueFiles.add(fileId);
394
+ result.push(replacement);
395
+ }
396
+ }
397
+ return result;
398
+ }
383
399
 
384
400
  function migrate(options) {
385
401
  return async (tree, context) => {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v20.0.0-next.1
4
+ * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
@@ -9,18 +9,18 @@
9
9
  Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
- var migrate_ts_type_references = require('./migrate_ts_type_references-5089e4ef.js');
12
+ var migrate_ts_type_references = require('./migrate_ts_type_references-2a3e9e6b.js');
13
13
  var ts = require('typescript');
14
14
  require('os');
15
- var checker = require('./checker-cf6f7980.js');
16
- var program = require('./program-362689f0.js');
15
+ var checker = require('./checker-af521da6.js');
16
+ var program = require('./program-a449f9bf.js');
17
17
  require('path');
18
- var project_paths = require('./project_paths-7d2daa1e.js');
19
- var index = require('./index-42d84d69.js');
18
+ var project_paths = require('./project_paths-17dc204d.js');
19
+ var index = require('./index-1bef3025.js');
20
20
  var assert = require('assert');
21
- var apply_import_manager = require('./apply_import_manager-0959b78c.js');
22
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
23
- require('./leading_space-6e7a8ec6.js');
21
+ var apply_import_manager = require('./apply_import_manager-e2a7fe5b.js');
22
+ var project_tsconfig_paths = require('./project_tsconfig_paths-b558633b.js');
23
+ require('./leading_space-f8944434.js');
24
24
  require('fs');
25
25
  require('module');
26
26
  require('url');
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v20.0.0-next.1
4
+ * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
@@ -9,23 +9,23 @@
9
9
  Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
13
- var project_paths = require('./project_paths-7d2daa1e.js');
12
+ var project_tsconfig_paths = require('./project_tsconfig_paths-b558633b.js');
13
+ var project_paths = require('./project_paths-17dc204d.js');
14
14
  require('os');
15
15
  var ts = require('typescript');
16
- var checker = require('./checker-cf6f7980.js');
17
- var program = require('./program-362689f0.js');
16
+ var checker = require('./checker-af521da6.js');
17
+ var program = require('./program-a449f9bf.js');
18
18
  require('path');
19
- var apply_import_manager = require('./apply_import_manager-0959b78c.js');
20
- var migrate_ts_type_references = require('./migrate_ts_type_references-5089e4ef.js');
19
+ var apply_import_manager = require('./apply_import_manager-e2a7fe5b.js');
20
+ var migrate_ts_type_references = require('./migrate_ts_type_references-2a3e9e6b.js');
21
21
  var assert = require('assert');
22
- var index = require('./index-42d84d69.js');
22
+ var index = require('./index-1bef3025.js');
23
23
  require('@angular-devkit/core');
24
24
  require('node:path/posix');
25
25
  require('fs');
26
26
  require('module');
27
27
  require('url');
28
- require('./leading_space-6e7a8ec6.js');
28
+ require('./leading_space-f8944434.js');
29
29
 
30
30
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
31
31
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v20.0.0-next.1
4
+ * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
@@ -12,23 +12,23 @@ var schematics = require('@angular-devkit/schematics');
12
12
  var signalQueriesMigration = require('./signal-queries-migration.js');
13
13
  var signalInputMigration = require('./signal-input-migration.js');
14
14
  var outputMigration = require('./output-migration.js');
15
- require('./project_tsconfig_paths-6c9cde78.js');
15
+ require('./project_tsconfig_paths-b558633b.js');
16
16
  require('@angular-devkit/core');
17
- require('./project_paths-7d2daa1e.js');
17
+ require('./project_paths-17dc204d.js');
18
18
  require('node:path/posix');
19
19
  require('os');
20
20
  require('typescript');
21
- require('./checker-cf6f7980.js');
21
+ require('./checker-af521da6.js');
22
22
  require('fs');
23
23
  require('module');
24
24
  require('path');
25
25
  require('url');
26
- require('./program-362689f0.js');
27
- require('./apply_import_manager-0959b78c.js');
28
- require('./migrate_ts_type_references-5089e4ef.js');
26
+ require('./program-a449f9bf.js');
27
+ require('./apply_import_manager-e2a7fe5b.js');
28
+ require('./migrate_ts_type_references-2a3e9e6b.js');
29
29
  require('assert');
30
- require('./index-42d84d69.js');
31
- require('./leading_space-6e7a8ec6.js');
30
+ require('./index-1bef3025.js');
31
+ require('./leading_space-f8944434.js');
32
32
 
33
33
  function migrate(options) {
34
34
  // The migrations are independent so we can run them in any order, but we sort them here
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
  /**
3
- * @license Angular v20.0.0-next.0
4
- * (c) 2010-2024 Google LLC. https://angular.io/
3
+ * @license Angular v20.0.0-next.1
4
+ * (c) 2010-2025 Google LLC. https://angular.io/
5
5
  * License: MIT
6
6
  */
7
7
  'use strict';
@@ -9,18 +9,18 @@
9
9
  Object.defineProperty(exports, '__esModule', { value: true });
10
10
 
11
11
  var schematics = require('@angular-devkit/schematics');
12
- require('./index-6675d6bc.js');
12
+ require('./index-ef1bffbb.js');
13
13
  var fs = require('fs');
14
14
  var p = require('path');
15
15
  var ts = require('typescript');
16
- var compiler_host = require('./compiler_host-cc1379e9.js');
17
- var project_tsconfig_paths = require('./project_tsconfig_paths-6c9cde78.js');
18
- var ng_decorators = require('./ng_decorators-6878e227.js');
19
- var nodes = require('./nodes-ffdce442.js');
20
- var imports = require('./imports-31a38653.js');
21
- var checker = require('./checker-cf6f7980.js');
16
+ var compiler_host = require('./compiler_host-5a29293c.js');
17
+ var project_tsconfig_paths = require('./project_tsconfig_paths-b558633b.js');
18
+ var ng_decorators = require('./ng_decorators-b0d8b324.js');
19
+ var nodes = require('./nodes-7758dbf6.js');
20
+ var imports = require('./imports-047fbbc8.js');
21
+ var checker = require('./checker-af521da6.js');
22
22
  require('os');
23
- var program = require('./program-362689f0.js');
23
+ var program = require('./program-a449f9bf.js');
24
24
  require('@angular-devkit/core');
25
25
  require('module');
26
26
  require('url');
@@ -1,6 +1,6 @@
1
1
  /**
2
- * @license Angular v20.0.0-next.0
3
- * (c) 2010-2024 Google LLC. https://angular.io/
2
+ * @license Angular v20.0.0-next.1
3
+ * (c) 2010-2025 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
@@ -195,6 +195,7 @@ export declare function fakeAsync(fn: Function, options?: {
195
195
  * Fake equivalent of `NavigationHistoryEntry`.
196
196
  */
197
197
  declare class FakeNavigationHistoryEntry implements NavigationHistoryEntry {
198
+ private eventTarget;
198
199
  readonly url: string | null;
199
200
  readonly sameDocument: boolean;
200
201
  readonly id: string;
@@ -203,7 +204,7 @@ declare class FakeNavigationHistoryEntry implements NavigationHistoryEntry {
203
204
  private readonly state;
204
205
  private readonly historyState;
205
206
  ondispose: ((this: NavigationHistoryEntry, ev: Event) => any) | null;
206
- constructor(url: string | null, { id, key, index, sameDocument, state, historyState, }: {
207
+ constructor(eventTarget: EventTarget, url: string | null, { id, key, index, sameDocument, state, historyState, }: {
207
208
  id: string;
208
209
  key: string;
209
210
  index: number;
@@ -216,6 +217,8 @@ declare class FakeNavigationHistoryEntry implements NavigationHistoryEntry {
216
217
  addEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
217
218
  removeEventListener(type: string, callback: EventListenerOrEventListenerObject, options?: EventListenerOptions | boolean): void;
218
219
  dispatchEvent(event: Event): boolean;
220
+ /** internal */
221
+ dispose(): void;
219
222
  }
220
223
 
221
224
  /**
@@ -740,10 +743,6 @@ export declare class ɵFakeNavigation implements Navigation {
740
743
  * The current active entry index into `entriesArr`.
741
744
  */
742
745
  private currentEntryIndex;
743
- /**
744
- * The current navigate event.
745
- */
746
- private navigateEvent;
747
746
  /**
748
747
  * A Map of pending traversals, so that traversals to the same entry can be
749
748
  * re-used.
@@ -766,8 +765,6 @@ export declare class ɵFakeNavigation implements Navigation {
766
765
  private synchronousTraversals;
767
766
  /** Whether to allow a call to setInitialEntryForTesting. */
768
767
  private canSetInitialEntry;
769
- /** `EventTarget` to dispatch events. */
770
- private eventTarget;
771
768
  /** The next unique id for created entries. Replace recreates this id. */
772
769
  private nextId;
773
770
  /** The next unique key for created entries. Replace inherits this id. */
@@ -830,12 +827,25 @@ export declare class ɵFakeNavigation implements Navigation {
830
827
  isDisposed(): boolean;
831
828
  /** Implementation for all navigations and traversals. */
832
829
  private userAgentNavigate;
833
- /** Implementation to commit a navigation. */
834
- private userAgentCommit;
835
- /** Implementation for a push or replace navigation. */
836
- private userAgentPushOrReplace;
837
- /** Implementation for a traverse navigation. */
830
+ /**
831
+ * Implementation for a push or replace navigation.
832
+ * https://whatpr.org/html/10919/browsing-the-web.html#url-and-history-update-steps
833
+ * https://whatpr.org/html/10919/nav-history-apis.html#update-the-navigation-api-entries-for-a-same-document-navigation
834
+ */
835
+ private urlAndHistoryUpdateSteps;
836
+ /**
837
+ * Implementation for a traverse navigation.
838
+ *
839
+ * https://whatpr.org/html/10919/browsing-the-web.html#apply-the-traverse-history-step
840
+ * ...
841
+ * > Let updateDocument be an algorithm step which performs update document for history step application given targetEntry's document, targetEntry, changingNavigableContinuation's update-only, scriptHistoryLength, scriptHistoryIndex, navigationType, entriesForNavigationAPI, and previousEntry.
842
+ * > If targetEntry's document is equal to displayedDocument, then perform updateDocument.
843
+ * https://whatpr.org/html/10919/browsing-the-web.html#update-document-for-history-step-application
844
+ * which then goes to https://whatpr.org/html/10919/nav-history-apis.html#update-the-navigation-api-entries-for-a-same-document-navigation
845
+ */
838
846
  private userAgentTraverse;
847
+ /** https://whatpr.org/html/10919/nav-history-apis.html#update-the-navigation-api-entries-for-a-same-document-navigation */
848
+ private updateNavigationEntriesForSameDocumentNavigation;
839
849
  /** Utility method for finding entries with the given `key`. */
840
850
  private findEntry;
841
851
  set onnavigate(_handler: ((this: Navigation, ev: NavigateEvent) => any) | null);
@@ -848,6 +858,7 @@ export declare class ɵFakeNavigation implements Navigation {
848
858
  get onnavigatesuccess(): ((this: Navigation, ev: Event) => any) | null;
849
859
  set onnavigateerror(_handler: ((this: Navigation, ev: ErrorEvent) => any) | null);
850
860
  get onnavigateerror(): ((this: Navigation, ev: ErrorEvent) => any) | null;
861
+ private _transition;
851
862
  get transition(): NavigationTransition | null;
852
863
  updateCurrentEntry(_options: NavigationUpdateCurrentEntryOptions): void;
853
864
  reload(_options?: NavigationReloadOptions): NavigationResult;