ember-source 5.3.0-alpha.3 → 5.3.0-alpha.5

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.
@@ -838,15 +838,6 @@ declare module '@ember/routing/route' {
838
838
  export default Router;
839
839
  ```
840
840
 
841
- The model for the `post` route is `store.findRecord('post', params.post_id)`.
842
-
843
- By default, if your route has a dynamic segment ending in `_id`:
844
-
845
- * The model class is determined from the segment (`post_id`'s
846
- class is `App.Post`)
847
- * The find method is called on the model class with the value of
848
- the dynamic segment.
849
-
850
841
  Note that for routes with dynamic segments, this hook is not always
851
842
  executed. If the route is entered through a transition (e.g. when
852
843
  using the `link-to` Handlebars helper or the `transitionTo` method
@@ -880,12 +871,21 @@ declare module '@ember/routing/route' {
880
871
  if a promise returned from `model` fails, the error will be
881
872
  handled by the `error` hook on `Route`.
882
873
 
874
+ Note that the legacy behavior of automatically defining a model
875
+ hook when a dynamic segment ending in `_id` is present is
876
+ [deprecated](https://deprecations.emberjs.com/v5.x#toc_deprecate-implicit-route-model).
877
+ You should explicitly define a model hook whenever any segments are
878
+ present.
879
+
883
880
  Example
884
881
 
885
882
  ```app/routes/post.js
886
883
  import Route from '@ember/routing/route';
884
+ import { service } from '@ember/service';
887
885
 
888
886
  export default class PostRoute extends Route {
887
+ @service store;
888
+
889
889
  model(params) {
890
890
  return this.store.findRecord('post', params.post_id);
891
891
  }
@@ -926,7 +926,7 @@ declare module '@ember/routing/route' {
926
926
  @param {Object} value the value passed to find
927
927
  @private
928
928
  */
929
- findModel(...args: any[]): any;
929
+ findModel(type: string, value: unknown): Model | PromiseLike<Model> | undefined;
930
930
  /**
931
931
  A hook you can use to setup the controller for the current route.
932
932
 
@@ -943,8 +943,11 @@ declare module '@ember/routing/route' {
943
943
 
944
944
  ```app/routes/photos.js
945
945
  import Route from '@ember/routing/route';
946
+ import { service } from '@ember/service';
946
947
 
947
948
  export default class PhotosRoute extends Route {
949
+ @service store;
950
+
948
951
  model() {
949
952
  return this.store.findAll('photo');
950
953
  }
@@ -1160,20 +1163,7 @@ declare module '@ember/routing/route' {
1160
1163
  */
1161
1164
  buildRouteInfoMetadata(): unknown;
1162
1165
  private _paramsFor;
1163
- /**
1164
- Store property provides a hook for data persistence libraries to inject themselves.
1165
-
1166
- By default, this store property provides the exact same functionality previously
1167
- in the model hook.
1168
-
1169
- Currently, the required interface is:
1170
-
1171
- `store.find(modelName, findArguments)`
1172
-
1173
- @property store
1174
- @type {Object}
1175
- @private
1176
- */
1166
+ /** @deprecated Manually define your own store, such as with `@service store` */
1177
1167
  protected get _store(): {
1178
1168
  find(name: string, value: unknown): any;
1179
1169
  };
@@ -153,7 +153,6 @@
153
153
  /// <reference path="./@ember/-internals/metal/lib/set_properties.d.ts" />
154
154
  /// <reference path="./@ember/-internals/metal/lib/tags.d.ts" />
155
155
  /// <reference path="./@ember/-internals/metal/lib/tracked.d.ts" />
156
- /// <reference path="./@ember/-internals/overrides/index.d.ts" />
157
156
  /// <reference path="./@ember/-internals/owner/index.d.ts" />
158
157
  /// <reference path="./@ember/-internals/routing/index.d.ts" />
159
158
  /// <reference path="./@ember/-internals/runtime/index.d.ts" />
@@ -1 +0,0 @@
1
- export let onEmberGlobalAccess;
@@ -1,3 +0,0 @@
1
- declare module '@ember/-internals/overrides' {
2
- export let onEmberGlobalAccess: any;
3
- }