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/drafts/incremental-adoption-guide.md
+6-6
Original file line number
Diff line number
Diff line change
@@ -8,11 +8,11 @@ This guide is for existing projects that want to adopt the new APIs of the Ember
8
8
9
9
## Step 1: Upgrade to EmberData 4.12.x
10
10
11
-
This version of EmberData is the first version that supports the new APIs. It also a LTS version, so you can stay on it for a while. You can refer the [EmberData Compatibility table](https://github.com/emberjs/data/blob/main/README.md#compatibility) to see which version of EmberData is compatible with your Ember version.
11
+
This version of EmberData is the first version that supports the new APIs. It is also a LTS version, so you can stay on it for a while. You can refer the [EmberData Compatibility table](https://github.com/emberjs/data/blob/main/README.md#compatibility) to see which version of EmberData is compatible with your Ember version.
12
12
13
13
## Step 2: Add `Store` service to your application
14
14
15
-
You would need to create you own store service. Before it was automatically injected by Ember Data.
15
+
You will need to create your own store service. Before, a store service was automatically injected by EmberData.
16
16
Here is how you do it:
17
17
18
18
```ts
@@ -27,7 +27,7 @@ export default class MyStore extends Store {
27
27
28
28
```
29
29
30
-
Notice we still want to import the `Store` class from `ember-data/store` package. You might have a lint rule that says don't do it. You can disable it for this import. The reason we want to import it from `ember-data/store` is because we want to use Ember Data models, serializers, adapters, etc. and alongside we want to start utilizing new APIs.
30
+
Notice we still want to import the `Store` class from `ember-data/store` package. You might have a lint rule that says don't do it. You can disable it for this import. The reason we want to import it from `ember-data/store` is because we want to use EmberData models, serializers, adapters, etc. while alongside we want to start utilizing new APIs.
31
31
32
32
## Step 3: Add `RequestManager` service to your application
33
33
@@ -67,15 +67,15 @@ Let's go over the code above:
67
67
68
68
2. Next is `TestHandler`. It is a handler that is responsible for logging requests. It is a quick example of how you can add your own handlers to the request manager. We will take a look at more useful examples later.
69
69
70
-
3. Lastly `Fetch`. It is a handler that is responsible for sending requests to the server using the new Ember Data APIs. It must be last handler you put in the chain. After finishing request it will enrich handlers context with `response` property. And pass it back to the handlers chain in reverse order. So `TestHandler` will receive `response` property first, and so on if we would have any.
70
+
3. Lastly `Fetch`. It is a handler that sends requests to the server using the `fetch` API. It expects responses to be JSON and when in use it should be the last handler you put in the chain. After finishing each request it will convert the response into json and pass it back to the handlers chain in reverse order as the request context's response. So `TestHandler` will receive `response` property first, and so on if we would have any.
71
71
72
72
You can read more about request manager in the [request manager guide](./request-manager-guide.md).
If you was using JSON:API adapter/serializer for your backend communication, you can use `@ember-data/json-api` package. It is a package that contains predefined builders for JSON:API requests. You can read more about it in the [`@ember-data/json-api` guide](TODO: add link).
76
+
If you were using JSON:API adapter/serializer for your backend communication, you can use `@ember-data/json-api` package. It is a package that contains predefined builders for JSON:API requests. You can read more about it in the [`@ember-data/json-api` guide](TODO: add link).
77
77
78
-
If you have different backend format - Ember Data provides you with builders for `REST`(@ember-data/rest) and `ActiveRecord`(@ember-data/active-record).
78
+
If you have different backend format - EmberData provides you with builders for `REST`(@ember-data/rest) and `ActiveRecord`(@ember-data/active-record).
0 commit comments