Skip to content

Commit 5ec1bcd

Browse files
authored
Merge pull request #2007 from achambers/patch-1
Update optional-features.md to include no-implicit-route-model
2 parents 881fb6a + 5ecb2b7 commit 5ec1bcd

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

guides/release/configuring-ember/optional-features.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ Usage:
3333

3434
Available features:
3535

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
3939
```
4040
4141
## Features
@@ -46,11 +46,22 @@ Let us disable an optional feature to see what happens. Substitute `some-example
4646
for a real feature name when you run this command.
4747
4848
```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!
5151
```
5252
5353
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.
5454
We commit it to our repository and we are off to the races!
5555
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.
67+

0 commit comments

Comments
 (0)