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
The RequestManager paradigm is simply that any request starts by providing FetchOptions. These may be built programmatically (for instance for relationships or collections that return links information from the API), or by builders or even manually
The paradigm has the simple goal of "use the platform". Importantly, it is this usage that allows us to intelligently cache requests and documents alongside resources, opening up vast possibilities for helpful new features for EmberData.
In this paradigm, all requests for the store should begin by calling store.request. Today though that is not the case.
Currently, the Store allows users to continue using the historical methods for fetching or mutating data.
Group 1
store.findRecord
store.findAll
store.query
store.queryRecord
store.saveRecord
model.save
model.reload
model.destroyRecord
These historical methods include the hasMany and belongsTo behaviors on @ember-data/model
Group 2
accessing an async belongsTo
accessing an async hasMany
As well as corresponding relationship reference fetching methods
Group 3
HasManyReference.load()
HasManyReference.reload()
BelongsToReference.load()
BelongsToReference.reload()
These historical request methods currently translate their arguments into the shape expected by RequestManager with a few major caveats:
they require using the LegacyCompatHandler and adapter/serializer logic or something mimicking it
they are not as flexible at the callsite
they are not cacheable since they do not set cacheKey and do not provide a url
Now that builders have shipped in 5.3, we would like to RFC deprecating all of group 1 to begin simplifying the mental model of how EmberData should be used.
Groups 2 and 3 should not be deprecated until we've either provided an alternative decorator to replace async belongsTo and hasMany or shipped SchemaRecord
From a deprecation perspective this RFC is similar to [https://github.com/emberjs/rfcs/pull/745]. The primary impact will be that anyone using these methods needs to refactor to store.request. The biggest lift here will most certainly be around the learning story, as many places in the API docs, the guides and the tutorial show the older form.
The text was updated successfully, but these errors were encountered:
The RequestManager paradigm is simply that any request starts by providing
FetchOptions
. These may be built programmatically (for instance for relationships or collections that returnlinks
information from the API), or bybuilders
or even manuallyThe paradigm has the simple goal of "use the platform". Importantly, it is this usage that allows us to intelligently cache requests and documents alongside resources, opening up vast possibilities for helpful new features for EmberData.
In this paradigm, all requests for the store should begin by calling
store.request
. Today though that is not the case.Currently, the Store allows users to continue using the historical methods for fetching or mutating data.
Group 1
store.findRecord
store.findAll
store.query
store.queryRecord
store.saveRecord
model.save
model.reload
model.destroyRecord
These historical methods include the
hasMany
andbelongsTo
behaviors on@ember-data/model
Group 2
As well as corresponding relationship reference fetching methods
Group 3
HasManyReference.load()
HasManyReference.reload()
BelongsToReference.load()
BelongsToReference.reload()
These historical request methods currently translate their arguments into the shape expected by RequestManager with a few major caveats:
Now that builders have shipped in 5.3, we would like to RFC deprecating all of group 1 to begin simplifying the mental model of how EmberData should be used.
Groups 2 and 3 should not be deprecated until we've either provided an alternative decorator to replace async
belongsTo
andhasMany
or shipped SchemaRecordFrom a deprecation perspective this RFC is similar to [https://github.com/emberjs/rfcs/pull/745]. The primary impact will be that anyone using these methods needs to refactor to
store.request
. The biggest lift here will most certainly be around the learning story, as many places in the API docs, the guides and the tutorial show the older form.The text was updated successfully, but these errors were encountered: