@@ -1501,7 +1501,9 @@ class Route<T = unknown>
15011501 }
15021502 ) ;
15031503
1504+ this . _disableStoreDeprecation = true ;
15041505 const store = get ( this , 'store' ) ;
1506+ this . _disableStoreDeprecation = false ;
15051507 assert ( 'Expected route to have a store with a find method' , isStoreLike ( store ) ) ;
15061508
15071509 return store . find ( type , value ) ;
@@ -1831,6 +1833,14 @@ class Route<T = unknown>
18311833 return params ;
18321834 }
18331835
1836+ /**
1837+ * Set to true to disable the built-in store deprecation warning.
1838+ * This helps avoid double calls from the `findModel` hook.
1839+ *
1840+ * @private
1841+ */
1842+ _disableStoreDeprecation = false ;
1843+
18341844 /**
18351845 Store property provides a hook for data persistence libraries to inject themselves.
18361846
@@ -1843,10 +1853,23 @@ class Route<T = unknown>
18431853
18441854 @property store
18451855 @type {Object }
1856+ @deprecated Manually define your own store, such as with `@service store`
18461857 @private
18471858 */
18481859 @computed
18491860 protected get store ( ) {
1861+ deprecate (
1862+ `The default store behavior for routes is deprecated. Please define an ` +
1863+ `explicit store for ${ this . fullRouteName } , such as with \`@service store\`.` ,
1864+ this . _disableStoreDeprecation ,
1865+ {
1866+ id : 'deprecate-defaul-route-store' ,
1867+ for : 'ember-source' ,
1868+ since : { available : '4.12.0' } ,
1869+ until : '6.0.0' ,
1870+ }
1871+ ) ;
1872+
18501873 const owner = getOwner ( this ) ;
18511874 assert ( 'Route is unexpectedly missing an owner' , owner ) ;
18521875 let routeName = this . routeName ;
0 commit comments