You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guides/release/configuring-ember/optional-features.md
+17-6Lines changed: 17 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,9 +33,9 @@ Usage:
33
33
34
34
Available features:
35
35
36
-
some-example-feature (Default: true)
37
-
A description of the feature goes here
38
-
More information: <link to an RFC>
36
+
no-implicit-route-model (Default: true)
37
+
Removes the default record loading behavior on Ember's Route.
38
+
More information: https://rfcs.emberjs.com/id/0774-implicit-record-route-loading
39
39
```
40
40
41
41
## Features
@@ -46,11 +46,22 @@ Let us disable an optional feature to see what happens. Substitute `some-example
46
46
for a real feature name when you run this command.
47
47
48
48
```bash
49
-
$ ember feature:disable some-example-feature
50
-
Disabled some-example-feature. Be sure to commit config/optional-features.json to source control!
49
+
$ ember feature:disable no-implicit-route-model
50
+
Disabled no-implicit-route-model. Be sure to commit config/optional-features.json to source control!
51
51
```
52
52
53
53
As we can see from the warning, `@ember/optional-features` has created a file in `config/optional-features.json` to store the configuration for your project.
54
54
We commit it to our repository and we are off to the races!
55
55
56
-
<!-- eof - needed for pages that end in a code block -->
56
+
### no-implicit-route-model
57
+
58
+
This feature is related to esoteric features of route model loading that you likely do not use, or know exist, and [have been deprecated](https://deprecations.emberjs.com/id/deprecate-implicit-route-model/) in `5.3.0`. They are due to be removed in `6.0.0`. To clear the deprecation, you can enable this feature.
59
+
60
+
With this feature disabled, Ember will automatically load a route's model if the `model` hook has not been implemented. In this case, Ember will attempt to try a few things before rendering this route's template.
61
+
62
+
1. If there is a `store` property on your route, it will attempt to call its `find` method. Assuming you have ember-data installed, you may be expecting this. The arguments will be extracted from the params. For example, if a dynamic segment is `:post_id`, there exists logic to split on the underscore and find a record of type post.
63
+
64
+
2. As a fallback, it will attempt to define a `find` method and use your Model instance's `find` method to fetch. If a Model cannot be found or if the found Model does not have a find method, an assertion is thrown.
65
+
66
+
Enabling this optional feature will remove this implicit model loading behavior and leave it to you to implement if and when you need it.
0 commit comments