-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[4.12->5.x]: Model.inverseFor(...).type was class, is now a string #9970
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm going to close this as part of #9639 where I'll also make a note of it. Some back context: in 5.x we shipped types (which is part of the changeset ported back to 4.13). In order to do so we typed Model which surfaced that At some point in the early days of SproutCore when AppResolver was how sproutcore worked (which later became ember's app resolver), passing the class in this location was how the modeling layer worked. That carried on until sometime in the ~mid 2.x to early 3.x era when investment into rationalizing the internals, fixing the performance of relationships, and cleaning up internal-model resulted in the api being converted to using a string. The docs were never updated and some portion of the code that was unused by the library itself continued to return a class. This went by unnoticed until typescript alerted us to the mixed return type. In general, starting in 4.x the schema service should always be used to lookup information about a record, and direct use of the static classes should be avoided. In 4.12+ this is as simple as |
Uh oh!
There was an error while loading. Please reload this page.
Reproduction
ember-cli/ember-new-output@v4.12.3...robbytx:ember-new-output:inverseFor
Model.inverseFor(...).type
is a Model class) with [email protected]Description
Per https://api.emberjs.com/ember-data/4.11/classes/Model/methods/inverseFor?anchor=inverseFor:
This is/was the documented behavior for all of the released 4.x series, as demonstrated by the above tests.
In #8020 (comment), this documentation was claimed to be incorrect, and at some point in the 5.x series, the behavior of Model.inverseFor was in fact changed such that the
type
property became a string value instead.This change is reflected at https://api.emberjs.com/ember-data/5.3/classes/Model/methods/inverseFor?anchor=inverseFor:
However, no deprecation was included in the 4.x series, and I cannot find any notice of this API compatibility change.
Versions
The text was updated successfully, but these errors were encountered: