@angular/router 22.0.0-next.9 → 22.0.0-rc.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 v22.0.0-next.9
2
+ * @license Angular v22.0.0-rc.1
3
3
  * (c) 2010-2026 Google LLC. https://angular.dev/
4
4
  * License: MIT
5
5
  */
@@ -7,7 +7,7 @@
7
7
  import * as i3 from '@angular/common';
8
8
  import { ViewportScroller, PlatformNavigation, PlatformLocation, ɵPRECOMMIT_HANDLER_SUPPORTED as _PRECOMMIT_HANDLER_SUPPORTED, LOCATION_INITIALIZED, Location, ɵNavigationAdapterForLocation as _NavigationAdapterForLocation, HashLocationStrategy, LocationStrategy, PathLocationStrategy } from '@angular/common';
9
9
  import * as i0 from '@angular/core';
10
- import { inject, HostAttributeToken, linkedSignal, untracked, signal, input, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, effect, ɵRuntimeError as _RuntimeError, computed, booleanAttribute, Injectable, HostListener, Input, Attribute, Directive, EventEmitter, Output, ContentChildren, createEnvironmentInjector, InjectionToken, NgZone, EnvironmentInjector, DestroyRef, afterNextRender, ɵpromiseWithResolvers as _promiseWithResolvers, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, provideAppInitializer, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, Injector, provideEnvironmentInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ApplicationRef, ENVIRONMENT_INITIALIZER, NgModule } from '@angular/core';
10
+ import { inject, HostAttributeToken, linkedSignal, untracked, signal, input, ɵINTERNAL_APPLICATION_ERROR_HANDLER as _INTERNAL_APPLICATION_ERROR_HANDLER, effect, ɵRuntimeError as _RuntimeError, computed, booleanAttribute, Service, HostListener, Input, Attribute, Directive, EventEmitter, Output, ContentChildren, createEnvironmentInjector, Injectable, InjectionToken, ɵIS_HYDRATION_DOM_REUSE_ENABLED as _IS_HYDRATION_DOM_REUSE_ENABLED, NgZone, ApplicationRef, EnvironmentInjector, DestroyRef, afterNextRender, ɵpromiseWithResolvers as _promiseWithResolvers, ɵpublishExternalGlobalUtil as _publishExternalGlobalUtil, makeEnvironmentProviders, APP_BOOTSTRAP_LISTENER, provideAppInitializer, ɵIS_ENABLED_BLOCKING_INITIAL_NAVIGATION as _IS_ENABLED_BLOCKING_INITIAL_NAVIGATION, Injector, provideEnvironmentInitializer, ɵperformanceMarkFeature as _performanceMarkFeature, ENVIRONMENT_INITIALIZER, NgModule } from '@angular/core';
11
11
  import { ROUTER_CONFIGURATION, isUrlTree, Router, ActivatedRoute, StateManager, UrlSerializer, NavigationEnd, UrlTree, isActive, exactMatchOptions, subsetMatchOptions, RouterConfigLoader, IMPERATIVE_NAVIGATION, NavigationTransitions, NavigationStart, NavigationSkipped, NavigationSkippedCode, Scroll, BeforeRoutesRecognized, BeforeActivateRoutes, NavigationCancel, NavigationError, isRedirectingEvent, NavigationCancellationCode, ROUTES, afterNextNavigation, NAVIGATION_ERROR_HANDLER, routeInjectorCleanup, ROUTE_INJECTOR_CLEANUP, RoutedComponentInputBinder, INPUT_BINDER, createViewTransition, CREATE_VIEW_TRANSITION, VIEW_TRANSITION_OPTIONS, stringifyEvent, DefaultUrlSerializer, ChildrenOutletContexts, RouterOutlet, ɵEmptyOutletComponent as _EmptyOutletComponent } from './_router-chunk.mjs';
12
12
  import { Subject, of, from } from 'rxjs';
13
13
  import { mergeAll, catchError, filter, concatMap, mergeMap } from 'rxjs/operators';
@@ -45,30 +45,26 @@ class ReactiveRouterState {
45
45
  }
46
46
  static ɵfac = i0.ɵɵngDeclareFactory({
47
47
  minVersion: "12.0.0",
48
- version: "22.0.0-next.9",
48
+ version: "22.0.0-rc.1",
49
49
  ngImport: i0,
50
50
  type: ReactiveRouterState,
51
51
  deps: [],
52
- target: i0.ɵɵFactoryTarget.Injectable
52
+ target: i0.ɵɵFactoryTarget.Service
53
53
  });
54
- static ɵprov = i0.ɵɵngDeclareInjectable({
55
- minVersion: "12.0.0",
56
- version: "22.0.0-next.9",
54
+ static ɵprov = i0.ɵɵngDeclareService({
55
+ minVersion: "22.0.0",
56
+ version: "22.0.0-rc.1",
57
57
  ngImport: i0,
58
- type: ReactiveRouterState,
59
- providedIn: 'root'
58
+ type: ReactiveRouterState
60
59
  });
61
60
  }
62
61
  i0.ɵɵngDeclareClassMetadata({
63
62
  minVersion: "12.0.0",
64
- version: "22.0.0-next.9",
63
+ version: "22.0.0-rc.1",
65
64
  ngImport: i0,
66
65
  type: ReactiveRouterState,
67
66
  decorators: [{
68
- type: Injectable,
69
- args: [{
70
- providedIn: 'root'
71
- }]
67
+ type: Service
72
68
  }],
73
69
  ctorParameters: () => []
74
70
  });
@@ -321,7 +317,7 @@ class RouterLink {
321
317
  }
322
318
  static ɵfac = i0.ɵɵngDeclareFactory({
323
319
  minVersion: "12.0.0",
324
- version: "22.0.0-next.9",
320
+ version: "22.0.0-rc.1",
325
321
  ngImport: i0,
326
322
  type: RouterLink,
327
323
  deps: [{
@@ -342,7 +338,7 @@ class RouterLink {
342
338
  });
343
339
  static ɵdir = i0.ɵɵngDeclareDirective({
344
340
  minVersion: "17.1.0",
345
- version: "22.0.0-next.9",
341
+ version: "22.0.0-rc.1",
346
342
  type: RouterLink,
347
343
  isStandalone: true,
348
344
  selector: "[routerLink]",
@@ -447,7 +443,7 @@ class RouterLink {
447
443
  }
448
444
  i0.ɵɵngDeclareClassMetadata({
449
445
  minVersion: "12.0.0",
450
- version: "22.0.0-next.9",
446
+ version: "22.0.0-rc.1",
451
447
  ngImport: i0,
452
448
  type: RouterLink,
453
449
  decorators: [{
@@ -633,7 +629,7 @@ class RouterLinkActive {
633
629
  }
634
630
  static ɵfac = i0.ɵɵngDeclareFactory({
635
631
  minVersion: "12.0.0",
636
- version: "22.0.0-next.9",
632
+ version: "22.0.0-rc.1",
637
633
  ngImport: i0,
638
634
  type: RouterLinkActive,
639
635
  deps: [{
@@ -649,7 +645,7 @@ class RouterLinkActive {
649
645
  });
650
646
  static ɵdir = i0.ɵɵngDeclareDirective({
651
647
  minVersion: "14.0.0",
652
- version: "22.0.0-next.9",
648
+ version: "22.0.0-rc.1",
653
649
  type: RouterLinkActive,
654
650
  isStandalone: true,
655
651
  selector: "[routerLinkActive]",
@@ -673,7 +669,7 @@ class RouterLinkActive {
673
669
  }
674
670
  i0.ɵɵngDeclareClassMetadata({
675
671
  minVersion: "12.0.0",
676
- version: "22.0.0-next.9",
672
+ version: "22.0.0-rc.1",
677
673
  ngImport: i0,
678
674
  type: RouterLinkActive,
679
675
  decorators: [{
@@ -725,30 +721,26 @@ class PreloadAllModules {
725
721
  }
726
722
  static ɵfac = i0.ɵɵngDeclareFactory({
727
723
  minVersion: "12.0.0",
728
- version: "22.0.0-next.9",
724
+ version: "22.0.0-rc.1",
729
725
  ngImport: i0,
730
726
  type: PreloadAllModules,
731
727
  deps: [],
732
- target: i0.ɵɵFactoryTarget.Injectable
728
+ target: i0.ɵɵFactoryTarget.Service
733
729
  });
734
- static ɵprov = i0.ɵɵngDeclareInjectable({
735
- minVersion: "12.0.0",
736
- version: "22.0.0-next.9",
730
+ static ɵprov = i0.ɵɵngDeclareService({
731
+ minVersion: "22.0.0",
732
+ version: "22.0.0-rc.1",
737
733
  ngImport: i0,
738
- type: PreloadAllModules,
739
- providedIn: 'root'
734
+ type: PreloadAllModules
740
735
  });
741
736
  }
742
737
  i0.ɵɵngDeclareClassMetadata({
743
738
  minVersion: "12.0.0",
744
- version: "22.0.0-next.9",
739
+ version: "22.0.0-rc.1",
745
740
  ngImport: i0,
746
741
  type: PreloadAllModules,
747
742
  decorators: [{
748
- type: Injectable,
749
- args: [{
750
- providedIn: 'root'
751
- }]
743
+ type: Service
752
744
  }]
753
745
  });
754
746
  class NoPreloading {
@@ -757,30 +749,26 @@ class NoPreloading {
757
749
  }
758
750
  static ɵfac = i0.ɵɵngDeclareFactory({
759
751
  minVersion: "12.0.0",
760
- version: "22.0.0-next.9",
752
+ version: "22.0.0-rc.1",
761
753
  ngImport: i0,
762
754
  type: NoPreloading,
763
755
  deps: [],
764
- target: i0.ɵɵFactoryTarget.Injectable
756
+ target: i0.ɵɵFactoryTarget.Service
765
757
  });
766
- static ɵprov = i0.ɵɵngDeclareInjectable({
767
- minVersion: "12.0.0",
768
- version: "22.0.0-next.9",
758
+ static ɵprov = i0.ɵɵngDeclareService({
759
+ minVersion: "22.0.0",
760
+ version: "22.0.0-rc.1",
769
761
  ngImport: i0,
770
- type: NoPreloading,
771
- providedIn: 'root'
762
+ type: NoPreloading
772
763
  });
773
764
  }
774
765
  i0.ɵɵngDeclareClassMetadata({
775
766
  minVersion: "12.0.0",
776
- version: "22.0.0-next.9",
767
+ version: "22.0.0-rc.1",
777
768
  ngImport: i0,
778
769
  type: NoPreloading,
779
770
  decorators: [{
780
- type: Injectable,
781
- args: [{
782
- providedIn: 'root'
783
- }]
771
+ type: Service
784
772
  }]
785
773
  });
786
774
  class RouterPreloader {
@@ -854,7 +842,7 @@ class RouterPreloader {
854
842
  }
855
843
  static ɵfac = i0.ɵɵngDeclareFactory({
856
844
  minVersion: "12.0.0",
857
- version: "22.0.0-next.9",
845
+ version: "22.0.0-rc.1",
858
846
  ngImport: i0,
859
847
  type: RouterPreloader,
860
848
  deps: [{
@@ -870,7 +858,7 @@ class RouterPreloader {
870
858
  });
871
859
  static ɵprov = i0.ɵɵngDeclareInjectable({
872
860
  minVersion: "12.0.0",
873
- version: "22.0.0-next.9",
861
+ version: "22.0.0-rc.1",
874
862
  ngImport: i0,
875
863
  type: RouterPreloader,
876
864
  providedIn: 'root'
@@ -878,7 +866,7 @@ class RouterPreloader {
878
866
  }
879
867
  i0.ɵɵngDeclareClassMetadata({
880
868
  minVersion: "12.0.0",
881
- version: "22.0.0-next.9",
869
+ version: "22.0.0-rc.1",
882
870
  ngImport: i0,
883
871
  type: RouterPreloader,
884
872
  decorators: [{
@@ -907,6 +895,9 @@ class RouterScroller {
907
895
  lastSource = IMPERATIVE_NAVIGATION;
908
896
  restoredId = 0;
909
897
  store = {};
898
+ isHydrating = inject(_IS_HYDRATION_DOM_REUSE_ENABLED, {
899
+ optional: true
900
+ }) ?? false;
910
901
  urlSerializer = inject(UrlSerializer);
911
902
  zone = inject(NgZone);
912
903
  viewportScroller = inject(ViewportScroller);
@@ -915,6 +906,11 @@ class RouterScroller {
915
906
  this.options = options;
916
907
  this.options.scrollPositionRestoration ||= 'disabled';
917
908
  this.options.anchorScrolling ||= 'disabled';
909
+ if (this.isHydrating) {
910
+ inject(ApplicationRef).whenStable().then(() => {
911
+ this.isHydrating = false;
912
+ });
913
+ }
918
914
  }
919
915
  init() {
920
916
  if (this.options.scrollPositionRestoration !== 'disabled') {
@@ -961,6 +957,7 @@ class RouterScroller {
961
957
  });
962
958
  }
963
959
  scheduleScrollEvent(routerEvent, anchor) {
960
+ if (this.isHydrating) return;
964
961
  const scroll = untracked(this.transitions.currentNavigation)?.extras.scroll;
965
962
  this.zone.runOutsideAngular(async () => {
966
963
  await new Promise(resolve => {
@@ -980,7 +977,7 @@ class RouterScroller {
980
977
  }
981
978
  static ɵfac = i0.ɵɵngDeclareFactory({
982
979
  minVersion: "12.0.0",
983
- version: "22.0.0-next.9",
980
+ version: "22.0.0-rc.1",
984
981
  ngImport: i0,
985
982
  type: RouterScroller,
986
983
  deps: "invalid",
@@ -988,14 +985,14 @@ class RouterScroller {
988
985
  });
989
986
  static ɵprov = i0.ɵɵngDeclareInjectable({
990
987
  minVersion: "12.0.0",
991
- version: "22.0.0-next.9",
988
+ version: "22.0.0-rc.1",
992
989
  ngImport: i0,
993
990
  type: RouterScroller
994
991
  });
995
992
  }
996
993
  i0.ɵɵngDeclareClassMetadata({
997
994
  minVersion: "12.0.0",
998
- version: "22.0.0-next.9",
995
+ version: "22.0.0-rc.1",
999
996
  ngImport: i0,
1000
997
  type: RouterScroller,
1001
998
  decorators: [{
@@ -1311,30 +1308,26 @@ class NavigationStateManager extends StateManager {
1311
1308
  }
1312
1309
  static ɵfac = i0.ɵɵngDeclareFactory({
1313
1310
  minVersion: "12.0.0",
1314
- version: "22.0.0-next.9",
1311
+ version: "22.0.0-rc.1",
1315
1312
  ngImport: i0,
1316
1313
  type: NavigationStateManager,
1317
1314
  deps: [],
1318
- target: i0.ɵɵFactoryTarget.Injectable
1315
+ target: i0.ɵɵFactoryTarget.Service
1319
1316
  });
1320
- static ɵprov = i0.ɵɵngDeclareInjectable({
1321
- minVersion: "12.0.0",
1322
- version: "22.0.0-next.9",
1317
+ static ɵprov = i0.ɵɵngDeclareService({
1318
+ minVersion: "22.0.0",
1319
+ version: "22.0.0-rc.1",
1323
1320
  ngImport: i0,
1324
- type: NavigationStateManager,
1325
- providedIn: 'root'
1321
+ type: NavigationStateManager
1326
1322
  });
1327
1323
  }
1328
1324
  i0.ɵɵngDeclareClassMetadata({
1329
1325
  minVersion: "12.0.0",
1330
- version: "22.0.0-next.9",
1326
+ version: "22.0.0-rc.1",
1331
1327
  ngImport: i0,
1332
1328
  type: NavigationStateManager,
1333
1329
  decorators: [{
1334
- type: Injectable,
1335
- args: [{
1336
- providedIn: 'root'
1337
- }]
1330
+ type: Service
1338
1331
  }],
1339
1332
  ctorParameters: () => []
1340
1333
  });
@@ -1599,7 +1592,7 @@ class RouterModule {
1599
1592
  }
1600
1593
  static ɵfac = i0.ɵɵngDeclareFactory({
1601
1594
  minVersion: "12.0.0",
1602
- version: "22.0.0-next.9",
1595
+ version: "22.0.0-rc.1",
1603
1596
  ngImport: i0,
1604
1597
  type: RouterModule,
1605
1598
  deps: [],
@@ -1607,7 +1600,7 @@ class RouterModule {
1607
1600
  });
1608
1601
  static ɵmod = i0.ɵɵngDeclareNgModule({
1609
1602
  minVersion: "14.0.0",
1610
- version: "22.0.0-next.9",
1603
+ version: "22.0.0-rc.1",
1611
1604
  ngImport: i0,
1612
1605
  type: RouterModule,
1613
1606
  imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],
@@ -1615,14 +1608,14 @@ class RouterModule {
1615
1608
  });
1616
1609
  static ɵinj = i0.ɵɵngDeclareInjector({
1617
1610
  minVersion: "12.0.0",
1618
- version: "22.0.0-next.9",
1611
+ version: "22.0.0-rc.1",
1619
1612
  ngImport: i0,
1620
1613
  type: RouterModule
1621
1614
  });
1622
1615
  }
1623
1616
  i0.ɵɵngDeclareClassMetadata({
1624
1617
  minVersion: "12.0.0",
1625
- version: "22.0.0-next.9",
1618
+ version: "22.0.0-rc.1",
1626
1619
  ngImport: i0,
1627
1620
  type: RouterModule,
1628
1621
  decorators: [{