From 22607ee37b3b181b74411dc935261e5ed4c19eac Mon Sep 17 00:00:00 2001 From: ANordmoe Date: Wed, 14 May 2025 10:29:40 -0400 Subject: [PATCH 1/4] remove whitespace, mutation ops as const --- snippets/updating-data/create-record/handler.js | 1 - snippets/updating-data/save-record/handler.js | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/snippets/updating-data/create-record/handler.js b/snippets/updating-data/create-record/handler.js index 1b6430c..e2d83b8 100644 --- a/snippets/updating-data/create-record/handler.js +++ b/snippets/updating-data/create-record/handler.js @@ -4,7 +4,6 @@ import { serializeResources } from '@ember-data/json-api/request'; const MUTATION_OPS = new Set(['createRecord', 'updateRecord']); - const updatesHandler = { request(context, next) { if (!MUTATION_OPS.has(context.request.op)) { diff --git a/snippets/updating-data/save-record/handler.js b/snippets/updating-data/save-record/handler.js index 1a90e29..7aea773 100644 --- a/snippets/updating-data/save-record/handler.js +++ b/snippets/updating-data/save-record/handler.js @@ -1,9 +1,9 @@ // Create handler for serialization of any record import { serializeResources } from '@ember-data/json-api/request'; -const updatesHandler = { - MUTATION_OPS: new Set(['createRecord', 'updateRecord']), +const MUTATION_OPS = new Set(['createRecord', 'updateRecord']); +const updatesHandler = { request(context, next) { if (!MUTATION_OPS.has(context.request.op)) { // Not a mutation, do nothing From 2f1c78e9914433b43573b040bc46e5d7293e6476 Mon Sep 17 00:00:00 2001 From: ANordmoe Date: Wed, 14 May 2025 11:11:16 -0400 Subject: [PATCH 2/4] grammar and spelling --- .../integration/components/guide-section/subsection-test.js | 6 +++--- translations/adapters/path-for-type/en-us.yaml | 2 +- translations/deleting-data/delete-record/en-us.yaml | 2 +- translations/fetching-data/find-all/en-us.yaml | 4 ++-- translations/fetching-data/find-record/en-us.yaml | 2 +- translations/fetching-data/query/en-us.yaml | 2 +- translations/serializers/general/en-us.yaml | 4 ++-- translations/updating-data/create-record/en-us.yaml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/tests/integration/components/guide-section/subsection-test.js b/tests/integration/components/guide-section/subsection-test.js index 6c29c16..22bcd89 100644 --- a/tests/integration/components/guide-section/subsection-test.js +++ b/tests/integration/components/guide-section/subsection-test.js @@ -61,7 +61,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community lib!) if not.' + 'Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community library!) if not.' ); const emberClassic = this.element.querySelector( @@ -97,7 +97,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'To create a new record using Ember Data you should use createRecord request and attach "body" to it. In case of JSON:API backend - you can use serializeResources request utility.' + 'To create a new record using Ember Data, you should use createRecord request and attach "body" to it. Use serializeResources request utility when working with a JSON:API backend.' ); const emberClassic = this.element.querySelector( @@ -133,7 +133,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'To delete an existing record using Ember Data you should use deleteRecord builder to issue the request.' + 'To delete an existing record using Ember Data, you should use deleteRecord builder to issue the request.' ); const emberClassic = this.element.querySelector( diff --git a/translations/adapters/path-for-type/en-us.yaml b/translations/adapters/path-for-type/en-us.yaml index f7060e0..69f524b 100644 --- a/translations/adapters/path-for-type/en-us.yaml +++ b/translations/adapters/path-for-type/en-us.yaml @@ -2,4 +2,4 @@ title: Use request builders instead of pathForType description: > To modify a URL for a request you can use the ''resourcePath'' option for every request builder. Default configuration for ''JSON:API'', ''REST'', and ''ActiveRecord'' builders will be provided by EmberData.
- We recommend creating your own utility file with request builders that suite your backend's needs. + We recommend creating your own utility file with request builders that suit your backend's needs. diff --git a/translations/deleting-data/delete-record/en-us.yaml b/translations/deleting-data/delete-record/en-us.yaml index 5e0a441..b82a0ef 100644 --- a/translations/deleting-data/delete-record/en-us.yaml +++ b/translations/deleting-data/delete-record/en-us.yaml @@ -1,2 +1,2 @@ title: deleteRecord -description: To delete an existing record using Ember Data you should use deleteRecord builder to issue the request. +description: To delete an existing record using Ember Data, you should use deleteRecord builder to issue the request. diff --git a/translations/fetching-data/find-all/en-us.yaml b/translations/fetching-data/find-all/en-us.yaml index f47481b..637a0ac 100644 --- a/translations/fetching-data/find-all/en-us.yaml +++ b/translations/fetching-data/find-all/en-us.yaml @@ -1,4 +1,4 @@ title: findAll description: | - There is no direct replacement for findAll, you can use query without extra options instead. Here is how to achieve exact findAll behavior: - We discourage using peekAll. When you made a request, you need to guarantee that everything you requested is part of response you get back. + There is no direct replacement for findAll, so you can use query with extra options instead. Here's how to achieve exact findAll behavior: + We discourage using peekAll, but it is currently the best way to guarantee that everything you requested is part of the response you get back. diff --git a/translations/fetching-data/find-record/en-us.yaml b/translations/fetching-data/find-record/en-us.yaml index 1c357ed..9e0e013 100644 --- a/translations/fetching-data/find-record/en-us.yaml +++ b/translations/fetching-data/find-record/en-us.yaml @@ -1,3 +1,3 @@ title: findRecord description: | - Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community lib!) if not. + Examples here are shown for apps that use JSON:API. Apps using other paradigms should use the builders for REST or ActiveRecord if applicable, or author their own (or a new community library!) if not. diff --git a/translations/fetching-data/query/en-us.yaml b/translations/fetching-data/query/en-us.yaml index 98e9817..e738a7a 100644 --- a/translations/fetching-data/query/en-us.yaml +++ b/translations/fetching-data/query/en-us.yaml @@ -1,2 +1,2 @@ title: query -description: The query just moved out from being on Store public interface to builders. +description: The query has moved from the Store public interface to builders. diff --git a/translations/serializers/general/en-us.yaml b/translations/serializers/general/en-us.yaml index 36a7f4b..3979eb7 100644 --- a/translations/serializers/general/en-us.yaml +++ b/translations/serializers/general/en-us.yaml @@ -8,8 +8,8 @@ description: |
Similarly, the methods ''adapterFor'' and ''serializerFor'' will not be deprecated until at least 6.0; however, it should no longer be assumed that an application has an adapter or serializer at all.
- Serializers previously was used to accomplish two main things: serialization and normalization. + Serializers previously were used to accomplish two main things: serialization and normalization.
Normalization is now done in handlers, before returning the response.
- Serialization can be done in handler, but we encourage application developers to do it in request builder. + Serialization can be done in a handler, but we encourage application developers to do it in request builder. diff --git a/translations/updating-data/create-record/en-us.yaml b/translations/updating-data/create-record/en-us.yaml index 1efc5d3..d03ee25 100644 --- a/translations/updating-data/create-record/en-us.yaml +++ b/translations/updating-data/create-record/en-us.yaml @@ -1,2 +1,2 @@ title: createRecord -description: To create a new record using Ember Data you should use createRecord request and attach "body" to it. In case of JSON:API backend - you can use serializeResources request utility. +description: To create a new record using Ember Data, you should use a createRecord request and attach "body" to it. Use the serializeResources request utility when working with a JSON:API backend. From 9368585688930ce7587c4ad55687bea4f335816f Mon Sep 17 00:00:00 2001 From: ANordmoe Date: Wed, 14 May 2025 11:30:38 -0400 Subject: [PATCH 3/4] update text assertion --- tests/integration/components/guide-section/subsection-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/components/guide-section/subsection-test.js b/tests/integration/components/guide-section/subsection-test.js index 22bcd89..727a580 100644 --- a/tests/integration/components/guide-section/subsection-test.js +++ b/tests/integration/components/guide-section/subsection-test.js @@ -97,7 +97,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'To create a new record using Ember Data, you should use createRecord request and attach "body" to it. Use serializeResources request utility when working with a JSON:API backend.' + 'To create a new record using Ember Data, you should use a createRecord request and attach "body" to it. Use serializeResources request utility when working with a JSON:API backend.' ); const emberClassic = this.element.querySelector( From 6f356aeafd967c156a5c0f9697fdf4bdc61b78f4 Mon Sep 17 00:00:00 2001 From: ANordmoe Date: Wed, 14 May 2025 11:33:44 -0400 Subject: [PATCH 4/4] another missed text assertion --- tests/integration/components/guide-section/subsection-test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/components/guide-section/subsection-test.js b/tests/integration/components/guide-section/subsection-test.js index 727a580..1405893 100644 --- a/tests/integration/components/guide-section/subsection-test.js +++ b/tests/integration/components/guide-section/subsection-test.js @@ -97,7 +97,7 @@ module('Integration | Component | guide-section/subsection', function (hooks) { assert .dom('[data-test-field="Subsection Description"]') .includesText( - 'To create a new record using Ember Data, you should use a createRecord request and attach "body" to it. Use serializeResources request utility when working with a JSON:API backend.' + 'To create a new record using Ember Data, you should use a createRecord request and attach "body" to it. Use the serializeResources request utility when working with a JSON:API backend.' ); const emberClassic = this.element.querySelector(