Skip to content

Commit 19113ee

Browse files
fix(location): Do not deep import vanilla.* from ui-router-core
- This stops rollup from double-bundling the `ui-router-core` code. refactor(UISref): change constructor args order
1 parent 1a0ae71 commit 19113ee

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

src/directives/uiSref.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,19 @@ export class UISref {
100100
/** @internalapi */ private _emit: boolean = false;
101101
/** @internalapi */ private _statesSub: Subscription;
102102
/** @internalapi */ private _router: UIRouter;
103-
/** @internalapi */ public parent: ParentUIViewInject;
104103
/** @internalapi */ private _anchorUISref: AnchorUISref;
104+
/** @internalapi */ public parent: ParentUIViewInject;
105105

106106
constructor(
107107
_router: UIRouter,
108+
@Optional() _anchorUISref: AnchorUISref,
108109
@Inject(UIView.PARENT_INJECT) parent: ParentUIViewInject,
109-
@Optional() _anchorUISref: AnchorUISref
110110
) {
111111
this._router = _router;
112-
this.parent = parent;
113112
this._anchorUISref = _anchorUISref;
114-
this._statesSub = _router.globals.states$.subscribe(() => this.update())
113+
this.parent = parent;
114+
115+
this._statesSub = _router.globals.states$.subscribe(() => this.update());
115116
}
116117

117118
/** @internalapi */

src/location/locationService.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
/** @module ng2 */
22
/** */
3-
import { UIRouter } from "ui-router-core";
4-
import { BaseLocationServices } from "ui-router-core/lib/vanilla/baseLocationService";
5-
import { parseUrl } from "ui-router-core/lib/vanilla/utils";
3+
import { UIRouter, BaseLocationServices, parseUrl } from "ui-router-core";
64
import { PlatformLocation, LocationStrategy } from "@angular/common";
75

86
/** A `LocationServices` that uses the browser hash "#" to get/set the current location */

src/providers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ import { ng2ViewsBuilder, Ng2ViewConfig } from "./statebuilders/views";
9595
import { Ng2ViewDeclaration } from "./interface";
9696
import { applyRootModuleConfig, applyModuleConfig } from "./uiRouterConfig";
9797
import { RootModule, StatesModule, UIROUTER_ROOT_MODULE, UIROUTER_MODULE_TOKEN } from "./uiRouterNgModule";
98-
import { servicesPlugin } from "ui-router-core/lib/vanilla";
99-
import { ServicesPlugin } from "ui-router-core/lib/vanilla/interface";
98+
import { servicesPlugin, ServicesPlugin } from "ui-router-core";
10099
import { ng2LazyLoadBuilder } from "./statebuilders/lazyLoad";
101100
import { UIRouterRx } from "ui-router-rx";
102101
import { LocationStrategy, PlatformLocation } from "@angular/common";

0 commit comments

Comments
 (0)