@angular/router 20.0.6 → 20.1.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.
- package/fesm2022/{router2.mjs → router-Cw7qdk0Q.mjs} +54 -51
- package/fesm2022/router-Cw7qdk0Q.mjs.map +1 -0
- package/fesm2022/router.mjs +4 -4
- package/fesm2022/router.mjs.map +1 -1
- package/fesm2022/{router_module.mjs → router_module-1ZiZ4YRy.mjs} +26 -26
- package/fesm2022/router_module-1ZiZ4YRy.mjs.map +1 -0
- package/fesm2022/testing.mjs +16 -16
- package/fesm2022/testing.mjs.map +1 -1
- package/fesm2022/upgrade.mjs +2 -2
- package/fesm2022/upgrade.mjs.map +1 -1
- package/index.d.ts +3 -3
- package/package.json +4 -4
- package/{router_module.d.d.ts → router_module.d-mlGavL8F.d.ts} +2 -2
- package/testing/index.d.ts +3 -3
- package/upgrade/index.d.ts +1 -1
- package/fesm2022/router2.mjs.map +0 -1
- package/fesm2022/router_module.mjs.map +0 -1
package/fesm2022/upgrade.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { Location } from '@angular/common';
|
|
8
8
|
import { APP_BOOTSTRAP_LISTENER } from '@angular/core';
|
|
9
9
|
import { UpgradeModule } from '@angular/upgrade/static';
|
|
10
|
-
import { Router } from './
|
|
10
|
+
import { Router } from './router-Cw7qdk0Q.mjs';
|
|
11
11
|
import 'rxjs';
|
|
12
12
|
import 'rxjs/operators';
|
|
13
13
|
import '@angular/platform-browser';
|
package/fesm2022/upgrade.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upgrade.mjs","sources":["../../../../../
|
|
1
|
+
{"version":3,"file":"upgrade.mjs","sources":["../../../../../darwin_arm64-fastbuild-ST-46c76129e412/bin/packages/router/upgrade/src/upgrade.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\nimport {Location} from '@angular/common';\nimport {APP_BOOTSTRAP_LISTENER, ComponentRef, InjectionToken} from '@angular/core';\nimport {Router, ɵRestoredState as RestoredState} from '../../index';\nimport {UpgradeModule} from '@angular/upgrade/static';\n\n/**\n * Creates an initializer that sets up `ngRoute` integration\n * along with setting up the Angular router.\n *\n * @usageNotes\n *\n * For standalone applications:\n * ```ts\n * export const appConfig: ApplicationConfig = {\n * providers: [RouterUpgradeInitializer],\n * };\n * ```\n *\n * For NgModule based applications:\n * ```ts\n * @NgModule({\n * imports: [\n * RouterModule.forRoot(SOME_ROUTES),\n * UpgradeModule\n * ],\n * providers: [\n * RouterUpgradeInitializer\n * ]\n * })\n * export class AppModule {\n * ngDoBootstrap() {}\n * }\n * ```\n *\n * @publicApi\n */\nexport const RouterUpgradeInitializer = {\n provide: APP_BOOTSTRAP_LISTENER,\n multi: true,\n useFactory: locationSyncBootstrapListener as (ngUpgrade: UpgradeModule) => () => void,\n deps: [UpgradeModule],\n};\n\n/**\n * @internal\n */\nexport function locationSyncBootstrapListener(ngUpgrade: UpgradeModule) {\n return () => {\n setUpLocationSync(ngUpgrade);\n };\n}\n\n/**\n * Sets up a location change listener to trigger `history.pushState`.\n * Works around the problem that `onPopState` does not trigger `history.pushState`.\n * Must be called *after* calling `UpgradeModule.bootstrap`.\n *\n * @param ngUpgrade The upgrade NgModule.\n * @param urlType The location strategy.\n * @see {@link /api/common/HashLocationStrategy HashLocationStrategy}\n * @see {@link /api/common/PathLocationStrategy PathLocationStrategy}\n *\n * @publicApi\n */\nexport function setUpLocationSync(\n ngUpgrade: UpgradeModule,\n urlType: 'path' | 'hash' = 'path',\n): void {\n if (!ngUpgrade.$injector) {\n throw new Error(`\n RouterUpgradeInitializer can be used only after UpgradeModule.bootstrap has been called.\n Remove RouterUpgradeInitializer and call setUpLocationSync after UpgradeModule.bootstrap.\n `);\n }\n\n const router: Router = ngUpgrade.injector.get(Router);\n const location: Location = ngUpgrade.injector.get(Location);\n\n ngUpgrade.$injector\n .get('$rootScope')\n .$on(\n '$locationChangeStart',\n (\n event: any,\n newUrl: string,\n oldUrl: string,\n newState?: {[k: string]: unknown} | RestoredState,\n oldState?: {[k: string]: unknown} | RestoredState,\n ) => {\n // Navigations coming from Angular router have a navigationId state\n // property. Don't trigger Angular router navigation again if it is\n // caused by a URL change from the current Angular router\n // navigation.\n const currentNavigationId = router.getCurrentNavigation()?.id;\n const newStateNavigationId = newState?.navigationId;\n if (newStateNavigationId !== undefined && newStateNavigationId === currentNavigationId) {\n return;\n }\n\n let url;\n if (urlType === 'path') {\n url = resolveUrl(newUrl);\n } else if (urlType === 'hash') {\n // Remove the first hash from the URL\n const hashIdx = newUrl.indexOf('#');\n url = resolveUrl(newUrl.substring(0, hashIdx) + newUrl.substring(hashIdx + 1));\n } else {\n throw 'Invalid URLType passed to setUpLocationSync: ' + urlType;\n }\n const path = location.normalize(url.pathname);\n router.navigateByUrl(path + url.search + url.hash);\n },\n );\n}\n\n/**\n * Normalizes and parses a URL.\n *\n * - Normalizing means that a relative URL will be resolved into an absolute URL in the context of\n * the application document.\n * - Parsing means that the anchor's `protocol`, `hostname`, `port`, `pathname` and related\n * properties are all populated to reflect the normalized URL.\n *\n * While this approach has wide compatibility, it doesn't work as expected on IE. On IE, normalizing\n * happens similar to other browsers, but the parsed components will not be set. (E.g. if you assign\n * `a.href = 'foo'`, then `a.protocol`, `a.host`, etc. will not be correctly updated.)\n * We work around that by performing the parsing in a 2nd step by taking a previously normalized URL\n * and assigning it again. This correctly populates all properties.\n *\n * See\n * https://github.com/angular/angular.js/blob/2c7400e7d07b0f6cec1817dab40b9250ce8ebce6/src/ng/urlUtils.js#L26-L33\n * for more info.\n */\nlet anchor: HTMLAnchorElement | undefined;\nfunction resolveUrl(url: string): {pathname: string; search: string; hash: string} {\n anchor ??= document.createElement('a');\n\n anchor.setAttribute('href', url);\n anchor.setAttribute('href', anchor.href);\n\n return {\n // IE does not start `pathname` with `/` like other browsers.\n pathname: `/${anchor.pathname.replace(/^\\//, '')}`,\n search: anchor.search,\n hash: anchor.hash,\n };\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACU,MAAA,wBAAwB,GAAG;AACtC,IAAA,OAAO,EAAE,sBAAsB;AAC/B,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,UAAU,EAAE,6BAAyE;IACrF,IAAI,EAAE,CAAC,aAAa,CAAC;;AAGvB;;AAEG;AACG,SAAU,6BAA6B,CAAC,SAAwB,EAAA;AACpE,IAAA,OAAO,MAAK;QACV,iBAAiB,CAAC,SAAS,CAAC;AAC9B,KAAC;AACH;AAEA;;;;;;;;;;;AAWG;SACa,iBAAiB,CAC/B,SAAwB,EACxB,UAA2B,MAAM,EAAA;AAEjC,IAAA,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE;QACxB,MAAM,IAAI,KAAK,CAAC;;;AAGb,MAAA,CAAA,CAAC;;IAGN,MAAM,MAAM,GAAW,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC;IACrD,MAAM,QAAQ,GAAa,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;AAE3D,IAAA,SAAS,CAAC;SACP,GAAG,CAAC,YAAY;AAChB,SAAA,GAAG,CACF,sBAAsB,EACtB,CACE,KAAU,EACV,MAAc,EACd,MAAc,EACd,QAAiD,EACjD,QAAiD,KAC/C;;;;;QAKF,MAAM,mBAAmB,GAAG,MAAM,CAAC,oBAAoB,EAAE,EAAE,EAAE;AAC7D,QAAA,MAAM,oBAAoB,GAAG,QAAQ,EAAE,YAAY;QACnD,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license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
import { ActivatedRouteSnapshot, Params, UrlTree, RouterOutletContract, ActivatedRoute, RouterStateSnapshot, Route, LoadedRouterConfig, Router, Routes, InMemoryScrollingOptions, RouterConfigOptions, NavigationError, RedirectCommand, CanMatch, CanMatchFn, CanActivate, CanActivateFn, CanActivateChild, CanActivateChildFn, CanDeactivate, CanDeactivateFn, Resolve, ResolveFn, Event } from './router_module.d.js';
|
|
8
|
-
export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data, DefaultExport, DefaultUrlSerializer, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, EventType, ExtraOptions, GuardResult, GuardsCheckEnd, GuardsCheckStart, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationExtras, NavigationSkipped, NavigationSkippedCode, NavigationStart, OnSameUrlNavigation, PRIMARY_OUTLET, ParamMap, QueryParamsHandling, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTER_OUTLET_DATA, RedirectFunction, ResolveData, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterState, RoutesRecognized, RunGuardsAndResolvers, Scroll, UrlCreationOptions, UrlMatchResult, UrlMatcher, UrlSegment, UrlSegmentGroup, UrlSerializer, convertToParamMap, defaultUrlMatcher, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, RestoredState as ɵRestoredState } from './router_module.d.js';
|
|
7
|
+
import { ActivatedRouteSnapshot, Params, UrlTree, RouterOutletContract, ActivatedRoute, RouterStateSnapshot, Route, LoadedRouterConfig, Router, Routes, InMemoryScrollingOptions, RouterConfigOptions, NavigationError, RedirectCommand, CanMatch, CanMatchFn, CanActivate, CanActivateFn, CanActivateChild, CanActivateChildFn, CanDeactivate, CanDeactivateFn, Resolve, ResolveFn, Event } from './router_module.d-mlGavL8F.js';
|
|
8
|
+
export { ActivationEnd, ActivationStart, BaseRouteReuseStrategy, CanLoad, CanLoadFn, ChildActivationEnd, ChildActivationStart, Data, DefaultExport, DefaultUrlSerializer, DeprecatedGuard, DeprecatedResolve, DetachedRouteHandle, EventType, ExtraOptions, GuardResult, GuardsCheckEnd, GuardsCheckStart, InitialNavigation, IsActiveMatchOptions, LoadChildren, LoadChildrenCallback, MaybeAsync, Navigation, NavigationBehaviorOptions, NavigationCancel, NavigationCancellationCode, NavigationEnd, NavigationExtras, NavigationSkipped, NavigationSkippedCode, NavigationStart, OnSameUrlNavigation, PRIMARY_OUTLET, ParamMap, QueryParamsHandling, ROUTER_CONFIGURATION, ROUTER_INITIALIZER, ROUTER_OUTLET_DATA, RedirectFunction, ResolveData, ResolveEnd, ResolveStart, RouteConfigLoadEnd, RouteConfigLoadStart, RouteReuseStrategy, RouterEvent, RouterLink, RouterLinkActive, RouterLink as RouterLinkWithHref, RouterModule, RouterOutlet, RouterState, RoutesRecognized, RunGuardsAndResolvers, Scroll, UrlCreationOptions, UrlMatchResult, UrlMatcher, UrlSegment, UrlSegmentGroup, UrlSerializer, convertToParamMap, defaultUrlMatcher, ɵEmptyOutletComponent, ROUTER_PROVIDERS as ɵROUTER_PROVIDERS, RestoredState as ɵRestoredState } from './router_module.d-mlGavL8F.js';
|
|
9
9
|
import { Title } from '@angular/platform-browser';
|
|
10
10
|
import * as i0 from '@angular/core';
|
|
11
11
|
import { ComponentRef, EnvironmentInjector, InjectionToken, Compiler, Injector, Type, OnDestroy, EnvironmentProviders, Provider, Version } from '@angular/core';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/router",
|
|
3
|
-
"version": "20.0.
|
|
3
|
+
"version": "20.1.0-next.1",
|
|
4
4
|
"description": "Angular - the routing library",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"angular",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"tslib": "^2.3.0"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"@angular/core": "20.0.
|
|
28
|
-
"@angular/common": "20.0.
|
|
29
|
-
"@angular/platform-browser": "20.0.
|
|
27
|
+
"@angular/core": "20.1.0-next.1",
|
|
28
|
+
"@angular/common": "20.1.0-next.1",
|
|
29
|
+
"@angular/platform-browser": "20.1.0-next.1",
|
|
30
30
|
"rxjs": "^6.5.3 || ^7.4.0"
|
|
31
31
|
},
|
|
32
32
|
"ng-update": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -557,7 +557,7 @@ type QueryParamsHandling = 'merge' | 'preserve' | 'replace' | '';
|
|
|
557
557
|
/**
|
|
558
558
|
* The type for the function that can be used to handle redirects when the path matches a `Route` config.
|
|
559
559
|
*
|
|
560
|
-
* The `RedirectFunction` does
|
|
560
|
+
* The `RedirectFunction` does have access to the full
|
|
561
561
|
* `ActivatedRouteSnapshot` interface. Some data are not accurately known
|
|
562
562
|
* at the route matching phase. For example, resolvers are not run until
|
|
563
563
|
* later, so any resolved title would not be populated. The same goes for lazy
|
package/testing/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v20.0.
|
|
2
|
+
* @license Angular v20.1.0-next.1
|
|
3
3
|
* (c) 2010-2025 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
import * as i0 from '@angular/core';
|
|
8
8
|
import { ModuleWithProviders, WritableSignal, DebugElement, Type } from '@angular/core';
|
|
9
|
-
import { Routes, ExtraOptions, RouterModule } from '../router_module.d.js';
|
|
10
|
-
export { ɵEmptyOutletComponent as ɵɵEmptyOutletComponent, RouterLink as ɵɵRouterLink, RouterLinkActive as ɵɵRouterLinkActive, RouterOutlet as ɵɵRouterOutlet } from '../router_module.d.js';
|
|
9
|
+
import { Routes, ExtraOptions, RouterModule } from '../router_module.d-mlGavL8F.js';
|
|
10
|
+
export { ɵEmptyOutletComponent as ɵɵEmptyOutletComponent, RouterLink as ɵɵRouterLink, RouterLinkActive as ɵɵRouterLinkActive, RouterOutlet as ɵɵRouterOutlet } from '../router_module.d-mlGavL8F.js';
|
|
11
11
|
import { ComponentFixture } from '@angular/core/testing';
|
|
12
12
|
import 'rxjs';
|
|
13
13
|
import '@angular/common';
|
package/upgrade/index.d.ts
CHANGED