@angular/router 22.0.0-rc.0 → 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-rc.0
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, Service, HostListener, Input, Attribute, Directive, EventEmitter, Output, ContentChildren, createEnvironmentInjector, Injectable, 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,7 +45,7 @@ class ReactiveRouterState {
45
45
  }
46
46
  static ɵfac = i0.ɵɵngDeclareFactory({
47
47
  minVersion: "12.0.0",
48
- version: "22.0.0-rc.0",
48
+ version: "22.0.0-rc.1",
49
49
  ngImport: i0,
50
50
  type: ReactiveRouterState,
51
51
  deps: [],
@@ -53,14 +53,14 @@ class ReactiveRouterState {
53
53
  });
54
54
  static ɵprov = i0.ɵɵngDeclareService({
55
55
  minVersion: "22.0.0",
56
- version: "22.0.0-rc.0",
56
+ version: "22.0.0-rc.1",
57
57
  ngImport: i0,
58
58
  type: ReactiveRouterState
59
59
  });
60
60
  }
61
61
  i0.ɵɵngDeclareClassMetadata({
62
62
  minVersion: "12.0.0",
63
- version: "22.0.0-rc.0",
63
+ version: "22.0.0-rc.1",
64
64
  ngImport: i0,
65
65
  type: ReactiveRouterState,
66
66
  decorators: [{
@@ -317,7 +317,7 @@ class RouterLink {
317
317
  }
318
318
  static ɵfac = i0.ɵɵngDeclareFactory({
319
319
  minVersion: "12.0.0",
320
- version: "22.0.0-rc.0",
320
+ version: "22.0.0-rc.1",
321
321
  ngImport: i0,
322
322
  type: RouterLink,
323
323
  deps: [{
@@ -338,7 +338,7 @@ class RouterLink {
338
338
  });
339
339
  static ɵdir = i0.ɵɵngDeclareDirective({
340
340
  minVersion: "17.1.0",
341
- version: "22.0.0-rc.0",
341
+ version: "22.0.0-rc.1",
342
342
  type: RouterLink,
343
343
  isStandalone: true,
344
344
  selector: "[routerLink]",
@@ -443,7 +443,7 @@ class RouterLink {
443
443
  }
444
444
  i0.ɵɵngDeclareClassMetadata({
445
445
  minVersion: "12.0.0",
446
- version: "22.0.0-rc.0",
446
+ version: "22.0.0-rc.1",
447
447
  ngImport: i0,
448
448
  type: RouterLink,
449
449
  decorators: [{
@@ -629,7 +629,7 @@ class RouterLinkActive {
629
629
  }
630
630
  static ɵfac = i0.ɵɵngDeclareFactory({
631
631
  minVersion: "12.0.0",
632
- version: "22.0.0-rc.0",
632
+ version: "22.0.0-rc.1",
633
633
  ngImport: i0,
634
634
  type: RouterLinkActive,
635
635
  deps: [{
@@ -645,7 +645,7 @@ class RouterLinkActive {
645
645
  });
646
646
  static ɵdir = i0.ɵɵngDeclareDirective({
647
647
  minVersion: "14.0.0",
648
- version: "22.0.0-rc.0",
648
+ version: "22.0.0-rc.1",
649
649
  type: RouterLinkActive,
650
650
  isStandalone: true,
651
651
  selector: "[routerLinkActive]",
@@ -669,7 +669,7 @@ class RouterLinkActive {
669
669
  }
670
670
  i0.ɵɵngDeclareClassMetadata({
671
671
  minVersion: "12.0.0",
672
- version: "22.0.0-rc.0",
672
+ version: "22.0.0-rc.1",
673
673
  ngImport: i0,
674
674
  type: RouterLinkActive,
675
675
  decorators: [{
@@ -721,7 +721,7 @@ class PreloadAllModules {
721
721
  }
722
722
  static ɵfac = i0.ɵɵngDeclareFactory({
723
723
  minVersion: "12.0.0",
724
- version: "22.0.0-rc.0",
724
+ version: "22.0.0-rc.1",
725
725
  ngImport: i0,
726
726
  type: PreloadAllModules,
727
727
  deps: [],
@@ -729,14 +729,14 @@ class PreloadAllModules {
729
729
  });
730
730
  static ɵprov = i0.ɵɵngDeclareService({
731
731
  minVersion: "22.0.0",
732
- version: "22.0.0-rc.0",
732
+ version: "22.0.0-rc.1",
733
733
  ngImport: i0,
734
734
  type: PreloadAllModules
735
735
  });
736
736
  }
737
737
  i0.ɵɵngDeclareClassMetadata({
738
738
  minVersion: "12.0.0",
739
- version: "22.0.0-rc.0",
739
+ version: "22.0.0-rc.1",
740
740
  ngImport: i0,
741
741
  type: PreloadAllModules,
742
742
  decorators: [{
@@ -749,7 +749,7 @@ class NoPreloading {
749
749
  }
750
750
  static ɵfac = i0.ɵɵngDeclareFactory({
751
751
  minVersion: "12.0.0",
752
- version: "22.0.0-rc.0",
752
+ version: "22.0.0-rc.1",
753
753
  ngImport: i0,
754
754
  type: NoPreloading,
755
755
  deps: [],
@@ -757,14 +757,14 @@ class NoPreloading {
757
757
  });
758
758
  static ɵprov = i0.ɵɵngDeclareService({
759
759
  minVersion: "22.0.0",
760
- version: "22.0.0-rc.0",
760
+ version: "22.0.0-rc.1",
761
761
  ngImport: i0,
762
762
  type: NoPreloading
763
763
  });
764
764
  }
765
765
  i0.ɵɵngDeclareClassMetadata({
766
766
  minVersion: "12.0.0",
767
- version: "22.0.0-rc.0",
767
+ version: "22.0.0-rc.1",
768
768
  ngImport: i0,
769
769
  type: NoPreloading,
770
770
  decorators: [{
@@ -842,7 +842,7 @@ class RouterPreloader {
842
842
  }
843
843
  static ɵfac = i0.ɵɵngDeclareFactory({
844
844
  minVersion: "12.0.0",
845
- version: "22.0.0-rc.0",
845
+ version: "22.0.0-rc.1",
846
846
  ngImport: i0,
847
847
  type: RouterPreloader,
848
848
  deps: [{
@@ -858,7 +858,7 @@ class RouterPreloader {
858
858
  });
859
859
  static ɵprov = i0.ɵɵngDeclareInjectable({
860
860
  minVersion: "12.0.0",
861
- version: "22.0.0-rc.0",
861
+ version: "22.0.0-rc.1",
862
862
  ngImport: i0,
863
863
  type: RouterPreloader,
864
864
  providedIn: 'root'
@@ -866,7 +866,7 @@ class RouterPreloader {
866
866
  }
867
867
  i0.ɵɵngDeclareClassMetadata({
868
868
  minVersion: "12.0.0",
869
- version: "22.0.0-rc.0",
869
+ version: "22.0.0-rc.1",
870
870
  ngImport: i0,
871
871
  type: RouterPreloader,
872
872
  decorators: [{
@@ -895,6 +895,9 @@ class RouterScroller {
895
895
  lastSource = IMPERATIVE_NAVIGATION;
896
896
  restoredId = 0;
897
897
  store = {};
898
+ isHydrating = inject(_IS_HYDRATION_DOM_REUSE_ENABLED, {
899
+ optional: true
900
+ }) ?? false;
898
901
  urlSerializer = inject(UrlSerializer);
899
902
  zone = inject(NgZone);
900
903
  viewportScroller = inject(ViewportScroller);
@@ -903,6 +906,11 @@ class RouterScroller {
903
906
  this.options = options;
904
907
  this.options.scrollPositionRestoration ||= 'disabled';
905
908
  this.options.anchorScrolling ||= 'disabled';
909
+ if (this.isHydrating) {
910
+ inject(ApplicationRef).whenStable().then(() => {
911
+ this.isHydrating = false;
912
+ });
913
+ }
906
914
  }
907
915
  init() {
908
916
  if (this.options.scrollPositionRestoration !== 'disabled') {
@@ -949,6 +957,7 @@ class RouterScroller {
949
957
  });
950
958
  }
951
959
  scheduleScrollEvent(routerEvent, anchor) {
960
+ if (this.isHydrating) return;
952
961
  const scroll = untracked(this.transitions.currentNavigation)?.extras.scroll;
953
962
  this.zone.runOutsideAngular(async () => {
954
963
  await new Promise(resolve => {
@@ -968,7 +977,7 @@ class RouterScroller {
968
977
  }
969
978
  static ɵfac = i0.ɵɵngDeclareFactory({
970
979
  minVersion: "12.0.0",
971
- version: "22.0.0-rc.0",
980
+ version: "22.0.0-rc.1",
972
981
  ngImport: i0,
973
982
  type: RouterScroller,
974
983
  deps: "invalid",
@@ -976,14 +985,14 @@ class RouterScroller {
976
985
  });
977
986
  static ɵprov = i0.ɵɵngDeclareInjectable({
978
987
  minVersion: "12.0.0",
979
- version: "22.0.0-rc.0",
988
+ version: "22.0.0-rc.1",
980
989
  ngImport: i0,
981
990
  type: RouterScroller
982
991
  });
983
992
  }
984
993
  i0.ɵɵngDeclareClassMetadata({
985
994
  minVersion: "12.0.0",
986
- version: "22.0.0-rc.0",
995
+ version: "22.0.0-rc.1",
987
996
  ngImport: i0,
988
997
  type: RouterScroller,
989
998
  decorators: [{
@@ -1299,7 +1308,7 @@ class NavigationStateManager extends StateManager {
1299
1308
  }
1300
1309
  static ɵfac = i0.ɵɵngDeclareFactory({
1301
1310
  minVersion: "12.0.0",
1302
- version: "22.0.0-rc.0",
1311
+ version: "22.0.0-rc.1",
1303
1312
  ngImport: i0,
1304
1313
  type: NavigationStateManager,
1305
1314
  deps: [],
@@ -1307,14 +1316,14 @@ class NavigationStateManager extends StateManager {
1307
1316
  });
1308
1317
  static ɵprov = i0.ɵɵngDeclareService({
1309
1318
  minVersion: "22.0.0",
1310
- version: "22.0.0-rc.0",
1319
+ version: "22.0.0-rc.1",
1311
1320
  ngImport: i0,
1312
1321
  type: NavigationStateManager
1313
1322
  });
1314
1323
  }
1315
1324
  i0.ɵɵngDeclareClassMetadata({
1316
1325
  minVersion: "12.0.0",
1317
- version: "22.0.0-rc.0",
1326
+ version: "22.0.0-rc.1",
1318
1327
  ngImport: i0,
1319
1328
  type: NavigationStateManager,
1320
1329
  decorators: [{
@@ -1583,7 +1592,7 @@ class RouterModule {
1583
1592
  }
1584
1593
  static ɵfac = i0.ɵɵngDeclareFactory({
1585
1594
  minVersion: "12.0.0",
1586
- version: "22.0.0-rc.0",
1595
+ version: "22.0.0-rc.1",
1587
1596
  ngImport: i0,
1588
1597
  type: RouterModule,
1589
1598
  deps: [],
@@ -1591,7 +1600,7 @@ class RouterModule {
1591
1600
  });
1592
1601
  static ɵmod = i0.ɵɵngDeclareNgModule({
1593
1602
  minVersion: "14.0.0",
1594
- version: "22.0.0-rc.0",
1603
+ version: "22.0.0-rc.1",
1595
1604
  ngImport: i0,
1596
1605
  type: RouterModule,
1597
1606
  imports: [RouterOutlet, RouterLink, RouterLinkActive, _EmptyOutletComponent],
@@ -1599,14 +1608,14 @@ class RouterModule {
1599
1608
  });
1600
1609
  static ɵinj = i0.ɵɵngDeclareInjector({
1601
1610
  minVersion: "12.0.0",
1602
- version: "22.0.0-rc.0",
1611
+ version: "22.0.0-rc.1",
1603
1612
  ngImport: i0,
1604
1613
  type: RouterModule
1605
1614
  });
1606
1615
  }
1607
1616
  i0.ɵɵngDeclareClassMetadata({
1608
1617
  minVersion: "12.0.0",
1609
- version: "22.0.0-rc.0",
1618
+ version: "22.0.0-rc.1",
1610
1619
  ngImport: i0,
1611
1620
  type: RouterModule,
1612
1621
  decorators: [{