fix(router): remove duplicated getOutlet function (#39764)
The codebase currently contains two `getOutlet` functions, and they can end up in the bundle of an application. A recent commit 6fbe21941d7ad1bab7441e1bf3c667ecffc7a359 tipped us off as it introduced several `noop` occurrences in the golden symbol files. After investigating with @petebacondarwin, we decided to remove the duplicated functions. This probably shaves only a few bytes, but this commit removes the duplicated functions, by always using the one in `router/src/utils/config`. PR Close #39764
This commit is contained in:
parent
fe1ada86e8
commit
5fa767363d
@ -1379,9 +1379,6 @@
|
|||||||
{
|
{
|
||||||
"name": "getOutlet"
|
"name": "getOutlet"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "getOutlet"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "getOwnDefinition"
|
"name": "getOwnDefinition"
|
||||||
},
|
},
|
||||||
|
@ -14,6 +14,7 @@ import {ActivatedRouteSnapshot, inheritedParamsDataResolve, ParamsInheritanceStr
|
|||||||
import {defaultUrlMatcher, PRIMARY_OUTLET} from './shared';
|
import {defaultUrlMatcher, PRIMARY_OUTLET} from './shared';
|
||||||
import {mapChildrenIntoArray, UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';
|
import {mapChildrenIntoArray, UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';
|
||||||
import {forEach, last} from './utils/collection';
|
import {forEach, last} from './utils/collection';
|
||||||
|
import {getOutlet} from './utils/config';
|
||||||
import {TreeNode} from './utils/tree';
|
import {TreeNode} from './utils/tree';
|
||||||
|
|
||||||
class NoMatch {}
|
class NoMatch {}
|
||||||
@ -328,10 +329,6 @@ function emptyPathMatch(
|
|||||||
return r.path === '' && r.redirectTo === undefined;
|
return r.path === '' && r.redirectTo === undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getOutlet(route: Route): string {
|
|
||||||
return route.outlet || PRIMARY_OUTLET;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getData(route: Route): Data {
|
function getData(route: Route): Data {
|
||||||
return route.data || {};
|
return route.data || {};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user