From b08d9a9f57e83ce4907d0f374e804c20cc60305e Mon Sep 17 00:00:00 2001 From: Chris Thoburn Date: Wed, 24 Aug 2022 11:48:04 -0700 Subject: [PATCH] Add note about Model.errors --- text/0846-ember-data-deprecate-proxies.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/text/0846-ember-data-deprecate-proxies.md b/text/0846-ember-data-deprecate-proxies.md index a8153a79f5..7a2fb99469 100644 --- a/text/0846-ember-data-deprecate-proxies.md +++ b/text/0846-ember-data-deprecate-proxies.md @@ -68,14 +68,14 @@ in effect make this a near possibility. ---- -### PromiseBelongsTo +### PromiseBelongsTo | Model.errors Since there is no path for a PromiseProxy to not exist for belongsTo relationships, deprecating this promise proxy is left for the deprecation of Model / belongsTo more broadly. -- **Affected APIs:** async `belongsTo` relationships on instances of `@ember-data/model` +- **Affected APIs:** async `belongsTo` relationships on instances of `@ember-data/model`, `errors` property on instance of `@ember-data/model` -In the interest of parity and in order to make native property access usage easier to refactor to we considered converting PromiseBelongsTo into a native proxy which would allow dot notation access to work. However, this would encourage not resolving the value before interacting with it, and encouraging folks to refactor towards `await` before use is key for the next stage in which async relationships will not exist at all in their current form. For this reason, we choose to leave this Proxy as-is. +In the interest of parity and in order to make native property access usage easier to refactor to we considered converting Errors and PromiseBelongsTo into native proxies which would allow dot notation access to work. However, for PromiseBelongsTo this would encourage not resolving the value before interacting with it, and encouraging folks to refactor towards `await` before use is key for the next stage in which async relationships will not exist at all in their current form. For this reason, we choose to leave this Proxy as-is. For `Errors` we have the complication that Errors is a recursive proxy that functions as an `ArrayProxy` an `ObjectProxy` and its own class. We prefer to find a replacement API that would not have the confusion of both `errors.name[0]` and `errors[0]` being valid interactions. We would note that even if Model / belongsTo are not deprecated before 5.0, their replacements will be available.