This RFC restores the behavior of the ds-improved-ajax feature flag for ember-data.
ember-data has decided to pursue another direction instead of this proposal,
and this addon is a temporary offering that will be deprecated once ember-data
releases an alternative.
This feature allowed users to customize how a request is formed by overwriting
methodForRequest,urlForRequest,headersForRequestandbodyForRequest- in adapters extending from
DS.RESTAdapterandDS.JSONAPIAdapter.
ember install ds-improved-ajax
Make sure your adapters that depend on this functionality extend from this addon's adapters. This addon does not change the behavior of ember-data's adapters.
eg change
// <APP>/adapters/application.js
import DS from 'ember-data';
export default DS.RESTAdapter.extend({
// ...
});to
// <APP>/adapters/application.js
import RESTAdapter from 'ds-improved-ajax/adapters/rest';
export default RESTAdapter.extend({
// ...
});or change
// <APP>/adapters/application.js
import DS from 'ember-data';
export default DS.JSONAPIAdapter.extend({
// ...
});to
// <APP>/adapters/application.js
import JSONAPIAdapter from 'ds-improved-ajax/adapters/json-api';
export default JSONAPIAdapter.extend({
// ...
});If you do not have an application adapter you can re-export the json-api adapter.
// <APP>/adapters/application.js
import JSONAPIAdapter from 'ds-improved-ajax/adapters/json-api';
export default JSONAPIAdapter;git clone <repository-url>cd ds-improved-ajaxnpm install
npm run lint:jsnpm run lint:js -- --fix
ember test– Runs the test suite on the current Ember versionember test --server– Runs the test suite in "watch mode"npm test– Runsember try:eachto test your addon against multiple Ember versions
ember serve- Visit the dummy application at http://localhost:4200.
For more information on using ember-cli, visit https://ember-cli.com/.
This project is licensed under the MIT License.