Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Adding deprecation information for the rename of Ember.Router.router #2806

Merged
merged 3 commits into from
Feb 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions source/deprecations/v2.x.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -876,6 +876,50 @@ let klass = factory.class;
klass.hasSpeed('slow'); // true
```

### Deprecations Added in 2.13

#### Ember.Router.router renamed to Ember.Router.routerMicrolib

##### until: 2.16.0
##### id: ember-router.router

The private `router` property of the `Ember.Router` instance (commonly found as this.router in Ember.Route instances or via router:main in the container)
has been renamed to `routerMicrolib` to disambiguate it from `router.js`, the microlib used within `Ember.Router`.

Addon and application developers that are using the internal `router` property of `Ember.Router` should replace those usages with `Ember.Router.routerMicrolib`.

This example demonstrates a common use case for `.router`.

Before:

```javascript
export default Ember.Service.extend({
getRouteNameFromUrl (url) {
const router = getContainer(this).lookup('router:main');
const routes = router.router.recognizer.recognize(url);

if (routes && routes.length) {
return routes[routes.length-1].handler;
}
}
});
```

After:

```javascript
export default Ember.Service.extend({
getRouteNameFromUrl (url) {
const router = getContainer(this).lookup('router:main');
const routes = router.routerMicrolib.recognizer.recognize(url);

if (routes && routes.length) {
return routes[routes.length-1].handler;
}
}
});
```

### Deprecations Added in Pending Features

#### Arguments in Component Lifecycle Hooks
Expand Down