8000 fix(router): remove duplicated getOutlet function (#39764) · angular/angular@df231ad · GitHub
[go: up one dir, main page]

Skip to content

Commit df231ad

Browse files
cexbrayatAndrewKushnir
authored andcommitted
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 6fbe219 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
1 parent babbf8a commit df231ad

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

packages/core/test/bundling/router/bundle.golden_symbols.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1379,9 +1379,6 @@
13791379
{
13801380
"name": "getOutlet"
13811381
},
1382-
{
1383-
"name": "getOutlet"
1384-
},
13851382
{
13861383
"name": "getOwnDefinition"
13871384
},

packages/router/src/recognize.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {ActivatedRouteSnapshot, inheritedParamsDataResolve, ParamsInheritanceStr
1414
import {defaultUrlMatcher, PRIMARY_OUTLET} from './shared';
1515
import {mapChildrenIntoArray, UrlSegment, UrlSegmentGroup, UrlTree} from './url_tree';
1616
import {forEach, last} from './utils/collection';
17+
import {getOutlet} from './utils/config';
1718
import {TreeNode} from './utils/tree';
1819

1920
class NoMatch {}
@@ -328,10 +329,6 @@ function emptyPathMatch(
328329
return r.path === '' && r.redirectTo === undefined;
329330
}
330331

331-
function getOutlet(route: Route): string {
332-
return route.outlet || PRIMARY_OUTLET;
333-
}
334-
335332
function getData(route: Route): Data {
336333
return route.data || {};
337334
}

0 commit comments

Comments
 (0)
0