diff --git a/packages/@ember/-internals/routing/lib/system/router.ts b/packages/@ember/-internals/routing/lib/system/router.ts index c7f08c90814..2fd8b50b00c 100644 --- a/packages/@ember/-internals/routing/lib/system/router.ts +++ b/packages/@ember/-internals/routing/lib/system/router.ts @@ -2,12 +2,7 @@ import { computed, get, notifyPropertyChange, set } from '@ember/-internals/meta import { getOwner, Owner } from '@ember/-internals/owner'; import { A as emberA, Evented, Object as EmberObject, typeOf } from '@ember/-internals/runtime'; import { assert, deprecate, info } from '@ember/debug'; -import { - APP_CTRL_ROUTER_PROPS, - HANDLER_INFOS, - ROUTER_EVENTS, - TRANSITION_STATE, -} from '@ember/deprecated-features'; +import { APP_CTRL_ROUTER_PROPS, ROUTER_EVENTS } from '@ember/deprecated-features'; import EmberError from '@ember/error'; import { assign } from '@ember/polyfills'; import { cancel, once, run, scheduleOnce } from '@ember/runloop'; @@ -29,9 +24,7 @@ import RouterState from './router_state'; import { MatchCallback } from 'route-recognizer'; import Router, { InternalRouteInfo, - InternalTransition, logAbort, - PARAMS_SYMBOL, QUERY_PARAMS_SYMBOL, STATE_SYMBOL, Transition, @@ -80,141 +73,6 @@ function defaultWillTransition( } } -if (TRANSITION_STATE) { - Object.defineProperty(InternalTransition.prototype, 'state', { - get() { - deprecate( - 'You attempted to read "transition.state" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the public state on it.', - false, - { - id: 'transition-state', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_transition-state', - } - ); - return this[STATE_SYMBOL]; - }, - }); - - Object.defineProperty(InternalTransition.prototype, 'queryParams', { - get() { - deprecate( - 'You attempted to read "transition.queryParams" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the queryParams on it.', - false, - { - id: 'transition-state', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_transition-state', - } - ); - return this[QUERY_PARAMS_SYMBOL]; - }, - }); - - Object.defineProperty(InternalTransition.prototype, 'params', { - get() { - deprecate( - 'You attempted to read "transition.params" which is a private API. You should read the `RouteInfo` object on "transition.to" or "transition.from" which has the params on it.', - false, - { - id: 'transition-state', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_transition-state', - } - ); - return this[PARAMS_SYMBOL]; - }, - }); -} - -if (HANDLER_INFOS) { - Object.defineProperty(InternalRouteInfo.prototype, 'handler', { - get() { - deprecate( - 'You attempted to read "handlerInfo.handler" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.route; - }, - - set(value: string) { - deprecate( - 'You attempted to set "handlerInfo.handler" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - this.route = value; - }, - }); - - Object.defineProperty(InternalTransition.prototype, 'handlerInfos', { - get() { - deprecate( - 'You attempted to use "transition.handlerInfos" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.routeInfos; - }, - }); - - Object.defineProperty(TransitionState.prototype, 'handlerInfos', { - get() { - deprecate( - 'You attempted to use "transition.state.handlerInfos" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.routeInfos; - }, - }); - - Object.defineProperty(Router.prototype, 'currentHandlerInfos', { - get() { - deprecate( - 'You attempted to use "_routerMicrolib.currentHandlerInfos" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.currentRouteInfos; - }, - }); - - Router.prototype['getHandler'] = function(name: string) { - deprecate( - 'You attempted to use "_routerMicrolib.getHandler" which is a private API that will be removed.', - false, - { - id: 'remove-handler-infos', - until: '3.9.0', - url: 'https://emberjs.com/deprecations/v3.x#toc_remove-handler-infos', - } - ); - return this.getRoute(name); - }; -} - interface RenderOutletState { name: string; outlet: string; diff --git a/packages/@ember/deprecated-features/index.ts b/packages/@ember/deprecated-features/index.ts index 6853418427c..cc98f9967dc 100644 --- a/packages/@ember/deprecated-features/index.ts +++ b/packages/@ember/deprecated-features/index.ts @@ -8,9 +8,7 @@ export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5'; export const RUN_SYNC = !!'3.0.0-beta.4'; export const LOGGER = !!'3.2.0-beta.1'; export const MERGE = !!'3.6.0-beta.1'; -export const HANDLER_INFOS = !!'3.9.0'; -export const ROUTER_EVENTS = !!'3.9.0'; -export const TRANSITION_STATE = !!'3.9.0'; +export const ROUTER_EVENTS = !!'4.0.0'; export const COMPONENT_MANAGER_STRING_LOOKUP = !!'3.8.0'; export const JQUERY_INTEGRATION = !!'3.9.0'; export const ALIAS_METHOD = !!'3.9.0';