ember-source 4.0.0 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,5 +5,5 @@
5
5
  * Portions Copyright 2008-2011 Apple Inc. All rights reserved.
6
6
  * @license Licensed under MIT license
7
7
  * See https://raw.github.com/emberjs/ember.js/master/LICENSE
8
- * @version 4.0.0
8
+ * @version 4.0.1
9
9
  */
@@ -14,7 +14,6 @@ import { isProxy, lookupDescriptor, symbol } from '@ember/-internals/utils';
14
14
  import { assert, info, isTesting } from '@ember/debug';
15
15
  import { dependentKeyCompat } from '@ember/object/compat';
16
16
  import { once } from '@ember/runloop';
17
- import { classify } from '@ember/string';
18
17
  import { DEBUG } from '@glimmer/env';
19
18
  import { PARAMS_SYMBOL, STATE_SYMBOL } from 'router_js';
20
19
  import { calculateCacheKey, deprecateTransitionMethods, normalizeControllerQueryParams, prefixRouteNameArg, stashParamNames } from '../utils';
@@ -1330,18 +1329,17 @@ class Route extends EmberObject.extend(ActionHandler, Evented) {
1330
1329
  get store() {
1331
1330
  let owner = getOwner(this);
1332
1331
  let routeName = this.routeName;
1333
- let namespace = get(this, '_router.namespace');
1334
1332
  return {
1335
1333
  find(name, value) {
1336
1334
  let modelClass = owner.factoryFor(`model:${name}`);
1337
- assert(`You used the dynamic segment ${name}_id in your route ${routeName}, but ${namespace}.${classify(name)} did not exist and you did not override your route's \`model\` hook.`, Boolean(modelClass));
1335
+ assert(`You used the dynamic segment \`${name}_id\` in your route ` + `\`${routeName}\` for which Ember requires you provide a ` + `data-loading implementation. Commonly, that is done by ` + `adding a model hook implementation on the route ` + `(\`model({${name}_id}) {\`) or by injecting an implemention of ` + `a data store: \`@service store;\`.`, Boolean(modelClass));
1338
1336
 
1339
1337
  if (!modelClass) {
1340
1338
  return;
1341
1339
  }
1342
1340
 
1343
1341
  modelClass = modelClass.class;
1344
- assert(`${classify(name)} has no method \`find\`.`, typeof modelClass.find === 'function');
1342
+ assert(`You used the dynamic segment \`${name}_id\` in your route ` + `\`${routeName}\` for which Ember requires you provide a ` + `data-loading implementation. Commonly, that is done by ` + `adding a model hook implementation on the route ` + `(\`model({${name}_id}) {\`) or by injecting an implemention of ` + `a data store: \`@service store;\`.\n\n` + `Rarely, applications may attempt to use a legacy behavior where ` + `the model class (in this case \`${name}\`) is resolved and the ` + `\`find\` method on that class is invoked to load data. In this ` + `application, a model of \`${name}\` was found but it did not ` + `provide a \`find\` method. You should not add a \`find\` ` + `method to your model. Instead, please implement an appropriate ` + `\`model\` hook on the \`${routeName}\` route.`, typeof modelClass.find === 'function');
1345
1343
  return modelClass.find(value);
1346
1344
  }
1347
1345
 
@@ -1 +1 @@
1
- export default "4.0.0";
1
+ export default "4.0.1";
package/docs/data.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "name": "The Ember API",
4
4
  "description": "The Ember API: a framework for building ambitious web applications",
5
5
  "url": "https://emberjs.com/",
6
- "version": "4.0.0"
6
+ "version": "4.0.1"
7
7
  },
8
8
  "files": {
9
9
  "node_modules/rsvp/lib/rsvp/promise/all.js": {
@@ -2922,7 +2922,7 @@
2922
2922
  "module": "@ember/routing",
2923
2923
  "namespace": "",
2924
2924
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
2925
- "line": 85,
2925
+ "line": 84,
2926
2926
  "description": "The `Route` class is used to define individual routes. Refer to\nthe [routing guide](https://guides.emberjs.com/release/routing/) for documentation.",
2927
2927
  "extends": "EmberObject",
2928
2928
  "uses": [
@@ -8763,7 +8763,7 @@
8763
8763
  },
8764
8764
  {
8765
8765
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8766
- "line": 147,
8766
+ "line": 146,
8767
8767
  "description": "Configuration hash for this route's queryParams. The possible\nconfiguration options and their defaults are as follows\n(assuming a query param whose controller property is `page`):\n\n```javascript\nqueryParams: {\n page: {\n // By default, controller query param properties don't\n // cause a full transition when they are changed, but\n // rather only cause the URL to update. Setting\n // `refreshModel` to true will cause an \"in-place\"\n // transition to occur, whereby the model hooks for\n // this route (and any child routes) will re-fire, allowing\n // you to reload models (e.g., from the server) using the\n // updated query param values.\n refreshModel: false,\n\n // By default, changes to controller query param properties\n // cause the URL to update via `pushState`, which means an\n // item will be added to the browser's history, allowing\n // you to use the back button to restore the app to the\n // previous state before the query param property was changed.\n // Setting `replace` to true will use `replaceState` (or its\n // hash location equivalent), which causes no browser history\n // item to be added. This options name and default value are\n // the same as the `link-to` helper's `replace` option.\n replace: false,\n\n // By default, the query param URL key is the same name as\n // the controller property name. Use `as` to specify a\n // different URL key.\n as: 'page'\n }\n}\n```",
8768
8768
  "itemtype": "property",
8769
8769
  "name": "queryParams",
@@ -8776,7 +8776,7 @@
8776
8776
  },
8777
8777
  {
8778
8778
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8779
- "line": 193,
8779
+ "line": 192,
8780
8780
  "description": "The name of the template to use by default when rendering this routes\ntemplate.\n\n```app/routes/posts/list.js\nimport Route from '@ember/routing/route';\n\nexport default class extends Route {\n templateName = 'posts/list'\n});\n```\n\n```app/routes/posts/index.js\nimport PostsList from '../posts/list';\n\nexport default class extends PostsList {};\n```\n\n```app/routes/posts/archived.js\nimport PostsList from '../posts/list';\n\nexport default class extends PostsList {};\n```",
8781
8781
  "itemtype": "property",
8782
8782
  "name": "templateName",
@@ -8790,7 +8790,7 @@
8790
8790
  },
8791
8791
  {
8792
8792
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8793
- "line": 226,
8793
+ "line": 225,
8794
8794
  "description": "The name of the controller to associate with this route.\n\nBy default, Ember will lookup a route's controller that matches the name\nof the route (i.e. `posts.new`). However,\nif you would like to define a specific controller to use, you can do so\nusing this property.\n\nThis is useful in many ways, as the controller specified will be:\n\n* passed to the `setupController` method.\n* used as the controller for the template being rendered by the route.\n* returned from a call to `controllerFor` for the route.",
8795
8795
  "itemtype": "property",
8796
8796
  "name": "controllerName",
@@ -8804,7 +8804,7 @@
8804
8804
  },
8805
8805
  {
8806
8806
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8807
- "line": 249,
8807
+ "line": 248,
8808
8808
  "description": "The controller associated with this route.\n\nExample\n\n```app/routes/form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm('Are you sure you want to abandon progress?')) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n}\n```",
8809
8809
  "itemtype": "property",
8810
8810
  "name": "controller",
@@ -8817,7 +8817,7 @@
8817
8817
  },
8818
8818
  {
8819
8819
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8820
- "line": 280,
8820
+ "line": 279,
8821
8821
  "description": "The name of the route, dot-delimited.\n\nFor example, a route found at `app/routes/posts/post.js` will have\na `routeName` of `posts.post`.",
8822
8822
  "itemtype": "property",
8823
8823
  "name": "routeName",
@@ -8830,7 +8830,7 @@
8830
8830
  },
8831
8831
  {
8832
8832
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8833
- "line": 294,
8833
+ "line": 293,
8834
8834
  "description": "The name of the route, dot-delimited, including the engine prefix\nif applicable.\n\nFor example, a route found at `addon/routes/posts/post.js` within an\nengine named `admin` will have a `fullRouteName` of `admin.posts.post`.",
8835
8835
  "itemtype": "property",
8836
8836
  "name": "fullRouteName",
@@ -8843,7 +8843,7 @@
8843
8843
  },
8844
8844
  {
8845
8845
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8846
- "line": 309,
8846
+ "line": 308,
8847
8847
  "description": "Sets the name for this route, including a fully resolved name for routes\ninside engines.",
8848
8848
  "access": "private",
8849
8849
  "tagname": "",
@@ -8861,7 +8861,7 @@
8861
8861
  },
8862
8862
  {
8863
8863
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8864
- "line": 322,
8864
+ "line": 321,
8865
8865
  "access": "private",
8866
8866
  "tagname": "",
8867
8867
  "itemtype": "method",
@@ -8871,7 +8871,7 @@
8871
8871
  },
8872
8872
  {
8873
8873
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8874
- "line": 353,
8874
+ "line": 352,
8875
8875
  "access": "private",
8876
8876
  "tagname": "",
8877
8877
  "itemtype": "property",
@@ -8881,7 +8881,7 @@
8881
8881
  },
8882
8882
  {
8883
8883
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8884
- "line": 362,
8884
+ "line": 361,
8885
8885
  "access": "private",
8886
8886
  "tagname": "",
8887
8887
  "itemtype": "method",
@@ -8891,7 +8891,7 @@
8891
8891
  },
8892
8892
  {
8893
8893
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8894
- "line": 370,
8894
+ "line": 369,
8895
8895
  "description": "Returns a hash containing the parameters of an ancestor route.\n\nYou may notice that `this.paramsFor` sometimes works when referring to a\nchild route, but this behavior should not be relied upon as only ancestor\nroutes are certain to be loaded in time.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('member', { path: ':name' }, function() {\n this.route('interest', { path: ':interest' });\n });\n});\n```\n\n```app/routes/member.js\nimport Route from '@ember/routing/route';\n\nexport default class MemberRoute extends Route {\n queryParams = {\n memberQp: { refreshModel: true }\n }\n}\n```\n\n```app/routes/member/interest.js\nimport Route from '@ember/routing/route';\n\nexport default class MemberInterestRoute extends Route {\n queryParams = {\n interestQp: { refreshModel: true }\n }\n\n model() {\n return this.paramsFor('member');\n }\n}\n```\n\nIf we visit `/turing/maths?memberQp=member&interestQp=interest` the model for\nthe `member.interest` route is a hash with:\n\n* `name`: `turing`\n* `memberQp`: `member`",
8896
8896
  "itemtype": "method",
8897
8897
  "name": "paramsFor",
@@ -8914,7 +8914,7 @@
8914
8914
  },
8915
8915
  {
8916
8916
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8917
- "line": 449,
8917
+ "line": 448,
8918
8918
  "description": "Serializes the query parameter key",
8919
8919
  "itemtype": "method",
8920
8920
  "name": "serializeQueryParamKey",
@@ -8932,7 +8932,7 @@
8932
8932
  },
8933
8933
  {
8934
8934
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8935
- "line": 460,
8935
+ "line": 459,
8936
8936
  "description": "Serializes value of the query parameter based on defaultValueType",
8937
8937
  "itemtype": "method",
8938
8938
  "name": "serializeQueryParam",
@@ -8960,7 +8960,7 @@
8960
8960
  },
8961
8961
  {
8962
8962
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8963
- "line": 476,
8963
+ "line": 475,
8964
8964
  "description": "Deserializes value of the query parameter based on defaultValueType",
8965
8965
  "itemtype": "method",
8966
8966
  "name": "deserializeQueryParam",
@@ -8988,7 +8988,7 @@
8988
8988
  },
8989
8989
  {
8990
8990
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
8991
- "line": 492,
8991
+ "line": 491,
8992
8992
  "access": "private",
8993
8993
  "tagname": "",
8994
8994
  "itemtype": "property",
@@ -8998,7 +8998,7 @@
8998
8998
  },
8999
8999
  {
9000
9000
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9001
- "line": 501,
9001
+ "line": 500,
9002
9002
  "description": "A hook you can use to reset controller values either when the model\nchanges or the route is exiting.\n\n```app/routes/articles.js\nimport Route from '@ember/routing/route';\n\nexport default class ArticlesRoute extends Route {\n resetController(controller, isExiting, transition) {\n if (isExiting && transition.targetName !== 'error') {\n controller.set('page', 1);\n }\n }\n}\n```",
9003
9003
  "itemtype": "method",
9004
9004
  "name": "resetController",
@@ -9027,7 +9027,7 @@
9027
9027
  },
9028
9028
  {
9029
9029
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9030
- "line": 528,
9030
+ "line": 527,
9031
9031
  "access": "private",
9032
9032
  "tagname": "",
9033
9033
  "itemtype": "method",
@@ -9037,7 +9037,7 @@
9037
9037
  },
9038
9038
  {
9039
9039
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9040
- "line": 539,
9040
+ "line": 538,
9041
9041
  "access": "private",
9042
9042
  "tagname": "",
9043
9043
  "itemtype": "method",
@@ -9048,7 +9048,7 @@
9048
9048
  },
9049
9049
  {
9050
9050
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9051
- "line": 552,
9051
+ "line": 551,
9052
9052
  "access": "private",
9053
9053
  "tagname": "",
9054
9054
  "itemtype": "method",
@@ -9058,7 +9058,7 @@
9058
9058
  },
9059
9059
  {
9060
9060
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9061
- "line": 563,
9061
+ "line": 562,
9062
9062
  "description": "The `willTransition` action is fired at the beginning of any\nattempted transition with a `Transition` object as the sole\nargument. This action can be used for aborting, redirecting,\nor decorating the transition from the currently active routes.\n\nA good example is preventing navigation when a form is\nhalf-filled out:\n\n```app/routes/contact-form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ContactFormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData')) {\n this.controller.displayNavigationConfirm();\n transition.abort();\n }\n }\n}\n```\n\nYou can also redirect elsewhere by calling\n`this.transitionTo('elsewhere')` from within `willTransition`.\nNote that `willTransition` will not be fired for the\nredirecting `transitionTo`, since `willTransition` doesn't\nfire when there is already a transition underway. If you want\nsubsequent `willTransition` actions to fire for the redirecting\ntransition, you must first explicitly call\n`transition.abort()`.\n\nTo allow the `willTransition` event to continue bubbling to the parent\nroute, use `return true;`. When the `willTransition` method has a\nreturn value of `true` then the parent route's `willTransition` method\nwill be fired, enabling \"bubbling\" behavior for the event.",
9063
9063
  "itemtype": "event",
9064
9064
  "name": "willTransition",
@@ -9077,7 +9077,7 @@
9077
9077
  },
9078
9078
  {
9079
9079
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9080
- "line": 607,
9080
+ "line": 606,
9081
9081
  "description": "The `didTransition` action is fired after a transition has\nsuccessfully been completed. This occurs after the normal model\nhooks (`beforeModel`, `model`, `afterModel`, `setupController`)\nhave resolved. The `didTransition` action has no arguments,\nhowever, it can be useful for tracking page views or resetting\nstate on the controller.\n\n```app/routes/login.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class LoginRoute extends Route {\n @action\n didTransition() {\n this.controller.get('errors.base').clear();\n return true; // Bubble the didTransition event\n }\n}\n```",
9082
9082
  "itemtype": "event",
9083
9083
  "name": "didTransition",
@@ -9089,7 +9089,7 @@
9089
9089
  },
9090
9090
  {
9091
9091
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9092
- "line": 633,
9092
+ "line": 632,
9093
9093
  "description": "The `loading` action is fired on the route when a route's `model`\nhook returns a promise that is not already resolved. The current\n`Transition` object is the first parameter and the route that\ntriggered the loading event is the second parameter.\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n loading(transition, route) {\n let controller = this.controllerFor('foo');\n\n // The controller may not be instantiated when initially loading\n if (controller) {\n controller.currentlyLoading = true;\n\n transition.finally(function() {\n controller.currentlyLoading = false;\n });\n }\n }\n}\n```",
9094
9094
  "itemtype": "event",
9095
9095
  "name": "loading",
@@ -9113,7 +9113,7 @@
9113
9113
  },
9114
9114
  {
9115
9115
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9116
- "line": 667,
9116
+ "line": 666,
9117
9117
  "description": "When attempting to transition into a route, any of the hooks\nmay return a promise that rejects, at which point an `error`\naction will be fired on the partially-entered routes, allowing\nfor per-route error handling logic, or shared error handling\nlogic defined on a parent route.\n\nHere is an example of an error handler that will be invoked\nfor rejected promises from the various hooks on the route,\nas well as any unhandled errors from child routes:\n\n```app/routes/admin.js\nimport { reject } from 'rsvp';\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class AdminRoute extends Route {\n beforeModel() {\n return reject('bad things!');\n }\n\n @action\n error(error, transition) {\n // Assuming we got here due to the error in `beforeModel`,\n // we can expect that error === \"bad things!\",\n // but a promise model rejecting would also\n // call this hook, as would any errors encountered\n // in `afterModel`.\n\n // The `error` hook is also provided the failed\n // `transition`, which can be stored and later\n // `.retry()`d if desired.\n\n this.transitionTo('login');\n }\n}\n```\n\n`error` actions that bubble up all the way to `ApplicationRoute`\nwill fire a default error handler that logs the error. You can\nspecify your own global default error handler by overriding the\n`error` handler on `ApplicationRoute`:\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n error(error, transition) {\n this.controllerFor('banner').displayError(error.message);\n }\n}\n```",
9118
9118
  "itemtype": "event",
9119
9119
  "name": "error",
@@ -9137,7 +9137,7 @@
9137
9137
  },
9138
9138
  {
9139
9139
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9140
- "line": 728,
9140
+ "line": 727,
9141
9141
  "description": "This event is triggered when the router enters the route. It is\nnot executed when the model for the route changes.\n\n```app/routes/application.js\nimport { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n collectAnalytics: on('activate', function(){\n collectAnalytics();\n })\n});\n```",
9142
9142
  "itemtype": "event",
9143
9143
  "name": "activate",
@@ -9149,7 +9149,7 @@
9149
9149
  },
9150
9150
  {
9151
9151
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9152
- "line": 748,
9152
+ "line": 747,
9153
9153
  "description": "This event is triggered when the router completely exits this\nroute. It is not executed when the model for the route changes.\n\n```app/routes/index.js\nimport { on } from '@ember/object/evented';\nimport Route from '@ember/routing/route';\n\nexport default Route.extend({\n trackPageLeaveAnalytics: on('deactivate', function(){\n trackPageLeaveAnalytics();\n })\n});\n```",
9154
9154
  "itemtype": "event",
9155
9155
  "name": "deactivate",
@@ -9161,7 +9161,7 @@
9161
9161
  },
9162
9162
  {
9163
9163
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9164
- "line": 768,
9164
+ "line": 767,
9165
9165
  "description": "This hook is executed when the router completely exits this route. It is\nnot executed when the model for the route changes.",
9166
9166
  "itemtype": "method",
9167
9167
  "name": "deactivate",
@@ -9180,7 +9180,7 @@
9180
9180
  },
9181
9181
  {
9182
9182
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9183
- "line": 779,
9183
+ "line": 778,
9184
9184
  "description": "This hook is executed when the router enters the route. It is not executed\nwhen the model for the route changes.",
9185
9185
  "itemtype": "method",
9186
9186
  "name": "activate",
@@ -9199,7 +9199,7 @@
9199
9199
  },
9200
9200
  {
9201
9201
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9202
- "line": 790,
9202
+ "line": 789,
9203
9203
  "description": "Transition the application into another route. The route may\nbe either a single route or route path:\n\n```javascript\nthis.transitionTo('blogPosts');\nthis.transitionTo('blogPosts.recentEntries');\n```\n\nOptionally supply a model for the route in question. The model\nwill be serialized into the URL using the `serialize` hook of\nthe route:\n\n```javascript\nthis.transitionTo('blogPost', aPost);\n```\n\nIf a literal is passed (such as a number or a string), it will\nbe treated as an identifier instead. In this case, the `model`\nhook of the route will be triggered:\n\n```javascript\nthis.transitionTo('blogPost', 1);\n```\n\nMultiple models will be applied last to first recursively up the\nroute tree.\n\n```app/routes.js\n// ...\n\nRouter.map(function() {\n this.route('blogPost', { path:':blogPostId' }, function() {\n this.route('blogComment', { path: ':blogCommentId' });\n });\n});\n\nexport default Router;\n```\n\n```javascript\nthis.transitionTo('blogComment', aPost, aComment);\nthis.transitionTo('blogComment', 1, 13);\n```\n\nIt is also possible to pass a URL (a string that starts with a\n`/`).\n\n```javascript\nthis.transitionTo('/');\nthis.transitionTo('/blog/post/1/comment/13');\nthis.transitionTo('/blog/posts?sort=title');\n```\n\nAn options hash with a `queryParams` property may be provided as\nthe final argument to add query parameters to the destination URL.\n\n```javascript\nthis.transitionTo('blogPost', 1, {\n queryParams: { showComments: 'true' }\n});\n\n// if you just want to transition the query parameters without changing the route\nthis.transitionTo({ queryParams: { sort: 'date' } });\n```\n\nSee also [replaceWith](#method_replaceWith).\n\nSimple Transition Example\n\n```app/routes.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n this.route('secret');\n this.route('fourOhFour', { path: '*:' });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n moveToSecret(context) {\n if (authorized()) {\n this.transitionTo('secret', context);\n } else {\n this.transitionTo('fourOhFour');\n }\n }\n}\n```\n\nTransition to a nested route\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('articles', { path: '/articles' }, function() {\n this.route('new');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n transitionToNewArticle() {\n this.transitionTo('articles.new');\n }\n}\n```\n\nMultiple Models Example\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n\n this.route('breakfast', { path: ':breakfastId' }, function() {\n this.route('cereal', { path: ':cerealId' });\n });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n moveToChocolateCereal() {\n let cereal = { cerealId: 'ChocolateYumminess' };\n let breakfast = { breakfastId: 'CerealAndMilk' };\n\n this.transitionTo('breakfast.cereal', breakfast, cereal);\n }\n}\n```\n\nNested Route with Query String Example\n\n```app/routes.js\n// ...\n\nRouter.map(function() {\n this.route('fruits', function() {\n this.route('apples');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\n\nexport default class IndexRoute extends Route {\n @action\n transitionToApples() {\n this.transitionTo('fruits.apples', { queryParams: { color: 'red' } });\n }\n}\n```",
9204
9204
  "itemtype": "method",
9205
9205
  "name": "transitionTo",
@@ -9237,7 +9237,7 @@
9237
9237
  },
9238
9238
  {
9239
9239
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9240
- "line": 988,
9240
+ "line": 987,
9241
9241
  "description": "Perform a synchronous transition into another route without attempting\nto resolve promises, update the URL, or abort any currently active\nasynchronous transitions (i.e. regular transitions caused by\n`transitionTo` or URL changes).\n\nThis method is handy for performing intermediate transitions on the\nway to a final destination route, and is called internally by the\ndefault implementations of the `error` and `loading` handlers.",
9242
9242
  "itemtype": "method",
9243
9243
  "name": "intermediateTransitionTo",
@@ -9261,7 +9261,7 @@
9261
9261
  },
9262
9262
  {
9263
9263
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9264
- "line": 1010,
9264
+ "line": 1009,
9265
9265
  "description": "Refresh the model on this route and any child routes, firing the\n`beforeModel`, `model`, and `afterModel` hooks in a similar fashion\nto how routes are entered when transitioning in from other route.\nThe current route params (e.g. `article_id`) will be passed in\nto the respective model hooks, and if a different model is returned,\n`setupController` and associated route hooks will re-fire as well.\n\nAn example usage of this method is re-querying the server for the\nlatest information using the same parameters as when the route\nwas first entered.\n\nNote that this will cause `model` hooks to fire even on routes\nthat were provided a model object when the route was initially\nentered.",
9266
9266
  "itemtype": "method",
9267
9267
  "name": "refresh",
@@ -9277,7 +9277,7 @@
9277
9277
  },
9278
9278
  {
9279
9279
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9280
- "line": 1036,
9280
+ "line": 1035,
9281
9281
  "description": "Transition into another route while replacing the current URL, if possible.\nThis will replace the current history entry instead of adding a new one.\nBeside that, it is identical to `transitionTo` in all other respects. See\n'transitionTo' for additional information regarding multiple models.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n this.route('secret');\n});\n\nexport default Router;\n```\n\n```app/routes/secret.js\nimport Route from '@ember/routing/route';\n\nexport default class SecretRoute Route {\n afterModel() {\n if (!authorized()){\n this.replaceWith('index');\n }\n }\n}\n```",
9282
9282
  "itemtype": "method",
9283
9283
  "name": "replaceWith",
@@ -9311,7 +9311,7 @@
9311
9311
  },
9312
9312
  {
9313
9313
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9314
- "line": 1083,
9314
+ "line": 1082,
9315
9315
  "description": "This hook is the entry point for router.js",
9316
9316
  "access": "private",
9317
9317
  "tagname": "",
@@ -9322,7 +9322,7 @@
9322
9322
  },
9323
9323
  {
9324
9324
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9325
- "line": 1163,
9325
+ "line": 1162,
9326
9326
  "description": "This hook is the first of the route entry validation hooks\ncalled when an attempt is made to transition into a route\nor one of its children. It is called before `model` and\n`afterModel`, and is appropriate for cases when:\n\n1) A decision can be made to redirect elsewhere without\n needing to resolve the model first.\n2) Any async operations need to occur first before the\n model is attempted to be resolved.\n\nThis hook is provided the current `transition` attempt\nas a parameter, which can be used to `.abort()` the transition,\nsave it for a later `.retry()`, or retrieve values set\non it from a previous hook. You can also just call\n`this.transitionTo` to another route to implicitly\nabort the `transition`.\n\nYou can return a promise from this hook to pause the\ntransition until the promise resolves (or rejects). This could\nbe useful, for instance, for retrieving async code from\nthe server that is required to enter a route.",
9327
9327
  "itemtype": "method",
9328
9328
  "name": "beforeModel",
@@ -9345,7 +9345,7 @@
9345
9345
  },
9346
9346
  {
9347
9347
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9348
- "line": 1197,
9348
+ "line": 1196,
9349
9349
  "description": "This hook is called after this route's model has resolved.\nIt follows identical async/promise semantics to `beforeModel`\nbut is provided the route's resolved model in addition to\nthe `transition`, and is therefore suited to performing\nlogic that can only take place after the model has already\nresolved.\n\n```app/routes/posts.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsRoute extends Route {\n afterModel(posts, transition) {\n if (posts.get('length') === 1) {\n this.transitionTo('post.show', posts.get('firstObject'));\n }\n }\n}\n```\n\nRefer to documentation for `beforeModel` for a description\nof transition-pausing semantics when a promise is returned\nfrom this hook.",
9350
9350
  "itemtype": "method",
9351
9351
  "name": "afterModel",
@@ -9373,7 +9373,7 @@
9373
9373
  },
9374
9374
  {
9375
9375
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9376
- "line": 1234,
9376
+ "line": 1233,
9377
9377
  "description": "A hook you can implement to optionally redirect to another route.\n\nCalling `this.transitionTo` from inside of the `redirect` hook will\nabort the current transition (into the route that has implemented `redirect`).\n\n`redirect` and `afterModel` behave very similarly and are\ncalled almost at the same time, but they have an important\ndistinction when calling `this.transitionTo` to a child route\nof the current route. From `afterModel`, this new transition\ninvalidates the current transition, causing `beforeModel`,\n`model`, and `afterModel` hooks to be called again. But the\nsame transition started from `redirect` does _not_ invalidate\nthe current transition. In other words, by the time the `redirect`\nhook has been called, both the resolved model and the attempted\nentry into this route are considered fully validated.",
9378
9378
  "itemtype": "method",
9379
9379
  "name": "redirect",
@@ -9397,7 +9397,7 @@
9397
9397
  },
9398
9398
  {
9399
9399
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9400
- "line": 1259,
9400
+ "line": 1258,
9401
9401
  "description": "Called when the context is changed by router.js.",
9402
9402
  "access": "private",
9403
9403
  "tagname": "",
@@ -9408,7 +9408,7 @@
9408
9408
  },
9409
9409
  {
9410
9410
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9411
- "line": 1269,
9411
+ "line": 1268,
9412
9412
  "description": "A hook you can implement to convert the URL into the model for\nthis route.\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nThe model for the `post` route is `store.findRecord('post', params.post_id)`.\n\nBy default, if your route has a dynamic segment ending in `_id`:\n\n* The model class is determined from the segment (`post_id`'s\n class is `App.Post`)\n* The find method is called on the model class with the value of\n the dynamic segment.\n\nNote that for routes with dynamic segments, this hook is not always\nexecuted. If the route is entered through a transition (e.g. when\nusing the `link-to` Handlebars helper or the `transitionTo` method\nof routes), and a model context is already provided this hook\nis not called.\n\nA model context does not include a primitive string or number,\nwhich does cause the model hook to be called.\n\nRoutes without dynamic segments will always execute the model hook.\n\n```javascript\n// no dynamic segment, model hook always called\nthis.transitionTo('posts');\n\n// model passed in, so model hook not called\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost);\n\n// integer passed in, model hook is called\nthis.transitionTo('post', 1);\n\n// model id passed in, model hook is called\n// useful for forcing the hook to execute\nthePost = store.findRecord('post', 1);\nthis.transitionTo('post', thePost.id);\n```\n\nThis hook follows the asynchronous/promise semantics\ndescribed in the documentation for `beforeModel`. In particular,\nif a promise returned from `model` fails, the error will be\nhandled by the `error` hook on `Route`.\n\nExample\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model(params) {\n return this.store.findRecord('post', params.post_id);\n }\n}\n```",
9413
9413
  "itemtype": "method",
9414
9414
  "name": "model",
@@ -9436,7 +9436,7 @@
9436
9436
  },
9437
9437
  {
9438
9438
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9439
- "line": 1378,
9439
+ "line": 1377,
9440
9440
  "access": "private",
9441
9441
  "tagname": "",
9442
9442
  "itemtype": "method",
@@ -9462,7 +9462,7 @@
9462
9462
  },
9463
9463
  {
9464
9464
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9465
- "line": 1391,
9465
+ "line": 1390,
9466
9466
  "itemtype": "method",
9467
9467
  "name": "findModel",
9468
9468
  "params": [
@@ -9484,7 +9484,7 @@
9484
9484
  },
9485
9485
  {
9486
9486
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9487
- "line": 1402,
9487
+ "line": 1401,
9488
9488
  "description": "A hook you can use to setup the controller for the current route.\n\nThis method is called with the controller for the current route and the\nmodel supplied by the `model` hook.\n\nBy default, the `setupController` hook sets the `model` property of\nthe controller to the specified `model` when it is not `undefined`.\n\nIf you implement the `setupController` hook in your Route, it will\nprevent this default behavior. If you want to preserve that behavior\nwhen implementing your `setupController` function, make sure to call\n`super`:\n\n```app/routes/photos.js\nimport Route from '@ember/routing/route';\n\nexport default class PhotosRoute extends Route {\n model() {\n return this.store.findAll('photo');\n }\n\n setupController(controller, model) {\n super.setupController(controller, model);\n\n this.controllerFor('application').set('showingPhotos', true);\n }\n}\n```\n\nThe provided controller will be one resolved based on the name\nof this route.\n\nIf no explicit controller is defined, Ember will automatically create one.\n\nAs an example, consider the router:\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\nexport default Router;\n```\n\nIf you have defined a file for the post controller,\nthe framework will use it.\nIf it is not defined, a basic `Controller` instance would be used.",
9489
9489
  "example": [
9490
9490
  " Behavior of a basic Controller\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, model) {\n controller.set('model', model);\n }\n});\n```"
@@ -9517,7 +9517,7 @@
9517
9517
  },
9518
9518
  {
9519
9519
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9520
- "line": 1479,
9520
+ "line": 1478,
9521
9521
  "description": "Returns the controller of the current route, or a parent (or any ancestor)\nroute in a route hierarchy.\n\nThe controller instance must already have been created, either through entering the\nassociated route or using `generateController`.\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n setupController(controller, post) {\n super.setupController(controller, post);\n\n this.controllerFor('posts').set('currentPost', post);\n }\n}\n```",
9522
9522
  "itemtype": "method",
9523
9523
  "name": "controllerFor",
@@ -9540,7 +9540,7 @@
9540
9540
  },
9541
9541
  {
9542
9542
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9543
- "line": 1525,
9543
+ "line": 1524,
9544
9544
  "description": "Generates a controller for a route.\n\nExample\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class Post extends Route {\n setupController(controller, post) {\n super.setupController(controller, post);\n\n this.generateController('posts');\n }\n}\n```",
9545
9545
  "itemtype": "method",
9546
9546
  "name": "generateController",
@@ -9558,7 +9558,7 @@
9558
9558
  },
9559
9559
  {
9560
9560
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9561
- "line": 1552,
9561
+ "line": 1551,
9562
9562
  "description": "Returns the resolved model of a parent (or any ancestor) route\nin a route hierarchy. During a transition, all routes\nmust resolve a model object, and if a route\nneeds access to a parent route's model in order to\nresolve a model (or just reuse the model from a parent),\nit can call `this.modelFor(theNameOfParentRoute)` to\nretrieve it. If the ancestor route's model was a promise,\nits resolved result is returned.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' }, function() {\n this.route('comments');\n });\n});\n\nexport default Router;\n```\n\n```app/routes/post/comments.js\nimport Route from '@ember/routing/route';\n\nexport default class PostCommentsRoute extends Route {\n model() {\n let post = this.modelFor('post');\n\n return post.comments;\n }\n}\n```",
9563
9563
  "itemtype": "method",
9564
9564
  "name": "modelFor",
@@ -9581,7 +9581,7 @@
9581
9581
  },
9582
9582
  {
9583
9583
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9584
- "line": 1623,
9584
+ "line": 1622,
9585
9585
  "description": "`this[RENDER]` is used to render a template into a region of another template\n(indicated by an `{{outlet}}`).",
9586
9586
  "itemtype": "method",
9587
9587
  "name": "this[RENDER]",
@@ -9631,7 +9631,7 @@
9631
9631
  },
9632
9632
  {
9633
9633
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9634
- "line": 1650,
9634
+ "line": 1649,
9635
9635
  "access": "private",
9636
9636
  "tagname": "",
9637
9637
  "itemtype": "method",
@@ -9641,7 +9641,7 @@
9641
9641
  },
9642
9642
  {
9643
9643
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9644
- "line": 1663,
9644
+ "line": 1662,
9645
9645
  "description": "Allows you to produce custom metadata for the route.\nThe return value of this method will be attached to\nits corresponding RouteInfoWithAttributes object.\n\nExample\n\n```app/routes/posts/index.js\nimport Route from '@ember/routing/route';\n\nexport default class PostsIndexRoute extends Route {\n buildRouteInfoMetadata() {\n return { title: 'Posts Page' }\n }\n}\n```\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { inject as service } from '@ember/service';\n\nexport default class ApplicationRoute extends Route {\n @service router\n\n constructor() {\n super(...arguments);\n\n this.router.on('routeDidChange', transition => {\n document.title = transition.to.metadata.title;\n // would update document's title to \"Posts Page\"\n });\n }\n}\n```",
9646
9646
  "itemtype": "method",
9647
9647
  "name": "buildRouteInfoMetadata",
@@ -9656,7 +9656,7 @@
9656
9656
  },
9657
9657
  {
9658
9658
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9659
- "line": 1713,
9659
+ "line": 1712,
9660
9660
  "description": "Store property provides a hook for data persistence libraries to inject themselves.\n\nBy default, this store property provides the exact same functionality previously\nin the model hook.\n\nCurrently, the required interface is:\n\n`store.find(modelName, findArguments)`",
9661
9661
  "itemtype": "property",
9662
9662
  "name": "store",
@@ -9668,7 +9668,7 @@
9668
9668
  },
9669
9669
  {
9670
9670
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9671
- "line": 1761,
9671
+ "line": 1777,
9672
9672
  "access": "private",
9673
9673
  "tagname": "",
9674
9674
  "itemtype": "property",
@@ -9678,7 +9678,7 @@
9678
9678
  },
9679
9679
  {
9680
9680
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9681
- "line": 1891,
9681
+ "line": 1907,
9682
9682
  "description": "Sends an action to the router, which will delegate it to the currently\nactive route hierarchy per the bubbling rules explained under `actions`.\n\nExample\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('index');\n});\n\nexport default Router;\n```\n\n```app/routes/application.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class ApplicationRoute extends Route {\n @action\n track(arg) {\n console.log(arg, 'was clicked');\n }\n}\n```\n\n```app/routes/index.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class IndexRoute extends Route {\n @action\n trackIfDebug(arg) {\n if (debug) {\n this.send('track', arg);\n }\n }\n}\n```",
9683
9683
  "itemtype": "method",
9684
9684
  "name": "send",
@@ -9702,7 +9702,7 @@
9702
9702
  },
9703
9703
  {
9704
9704
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9705
- "line": 2218,
9705
+ "line": 2234,
9706
9706
  "description": "A hook you can implement to convert the route's model into parameters\nfor the URL.\n\n```app/router.js\n// ...\n\nRouter.map(function() {\n this.route('post', { path: '/posts/:post_id' });\n});\n\n```\n\n```app/routes/post.js\nimport Route from '@ember/routing/route';\n\nexport default class PostRoute extends Route {\n model({ post_id }) {\n // the server returns `{ id: 12 }`\n return fetch(`/posts/${post_id}`;\n }\n\n serialize(model) {\n // this will make the URL `/posts/12`\n return { post_id: model.id };\n }\n}\n```\n\nThe default `serialize` method will insert the model's `id` into the\nroute's dynamic segment (in this case, `:post_id`) if the segment contains '_id'.\nIf the route has multiple dynamic segments or does not contain '_id', `serialize`\nwill return `getProperties(model, params)`\n\nThis method is called when `transitionTo` is called with a context\nin order to populate the URL.",
9707
9707
  "itemtype": "method",
9708
9708
  "name": "serialize",
@@ -9730,7 +9730,7 @@
9730
9730
  },
9731
9731
  {
9732
9732
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9733
- "line": 2288,
9733
+ "line": 2304,
9734
9734
  "description": "The controller associated with this route.\n\nExample\n\n```app/routes/form.js\nimport Route from '@ember/routing/route';\nimport { action } from '@ember/object';\n\nexport default class FormRoute extends Route {\n @action\n willTransition(transition) {\n if (this.controller.get('userHasEnteredData') &&\n !confirm('Are you sure you want to abandon progress?')) {\n transition.abort();\n } else {\n // Bubble the `willTransition` action so that\n // parent routes can decide whether or not to abort.\n return true;\n }\n }\n}\n```",
9735
9735
  "itemtype": "property",
9736
9736
  "name": "controller",
@@ -9743,7 +9743,7 @@
9743
9743
  },
9744
9744
  {
9745
9745
  "file": "packages/@ember/-internals/routing/lib/system/route.ts",
9746
- "line": 2319,
9746
+ "line": 2335,
9747
9747
  "description": "This action is called when one or more query params have changed. Bubbles.",
9748
9748
  "itemtype": "method",
9749
9749
  "name": "queryParamsDidChange",
@@ -17981,7 +17981,7 @@
17981
17981
  },
17982
17982
  {
17983
17983
  "message": "replacing incorrect tag: returns with return",
17984
- "line": " packages/@ember/-internals/routing/lib/system/route.ts:2319"
17984
+ "line": " packages/@ember/-internals/routing/lib/system/route.ts:2335"
17985
17985
  },
17986
17986
  {
17987
17987
  "message": "replacing incorrect tag: function with method",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-source",
3
- "version": "4.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "A JavaScript framework for creating ambitious web applications",
5
5
  "keywords": [
6
6
  "ember-addon"
@@ -156,6 +156,6 @@
156
156
  "ember-addon": {
157
157
  "after": "ember-cli-legacy-blueprints"
158
158
  },
159
- "_originalVersion": "4.0.0",
159
+ "_originalVersion": "4.0.1",
160
160
  "_versionPreviouslyCalculated": true
161
161
  }