Skip to content

Commit

Permalink
deprecate support for DS.FixtureAdapter
Browse files Browse the repository at this point in the history
The FixtureAdapter has needed work for a long time, and without a
champion to maintain it, it is being moved out of core and into an
addon. You can see the addon at
https://github.com/emberjs/ember-data-fixture-adapter/tree/master.

We recommend you use an AJAX stubbing solution such as Pretender:
https://github.com/trek/pretender
  • Loading branch information
Stanley Stuart committed May 23, 2015
1 parent 02706ec commit d834ea7
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 376 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

### Master

- Removed support for DS.FixtureAdapter. You can use it as an addon, or
build it using [Ember Giftwrap](https://github.com/ef4/ember-giftwrap).
https://github.com/emberjs/ember-data-fixture-adapter/tree/master

### Release 1.0.0-beta.18 (May 18, 2015)

- [#3066](https://github.com/emberjs/data/pull/3066) Doc typo: primaryTypeClasss -> primaryTypeClass [@lolmaus](https://github.com/lolmaus)
Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,6 @@ adapter translates that into an XHR request to (for example)
By default, Ember Data will use the `RESTAdapter`, which adheres to a
set of RESTful JSON conventions.

Ember Data also ships with the `FixtureAdapter`, useful for testing and
prototyping before you have a server, and the `ActiveModelAdapter`,
which is designed to work out-of-the-box with the
[`ActiveModel::Serializers`](https://github.com/rails-api/active_model_serializers)
gem for Rails.

To learn more about adapters, including what conventions the
`RESTAdapter` follows and how to build your own, see the Ember.js
Guides: [Connecting to an HTTP
Expand Down
9 changes: 3 additions & 6 deletions packages/ember-data/lib/adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@
@module ember-data
*/

import FixtureAdapter from "ember-data/adapters/fixture-adapter";
import RESTAdapter from "ember-data/adapters/rest-adapter";
import rest_adapter from "ember-data/adapters/rest-adapter";

export var RESTAdapter = rest_adapter;

export {
RESTAdapter,
FixtureAdapter
};
17 changes: 16 additions & 1 deletion packages/ember-data/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ DS.RecordArrayManager = RecordArrayManager;

DS.RESTAdapter = RESTAdapter;
DS.BuildURLMixin = BuildURLMixin;
DS.FixtureAdapter = FixtureAdapter;

DS.RESTSerializer = RESTSerializer;
DS.JSONSerializer = JSONSerializer;
Expand Down Expand Up @@ -135,6 +134,22 @@ Ember.defineProperty(DS, 'normalizeModelName', {
value: normalizeModelName
});

var fixtureAdapterWasDeprecated = false;

Ember.defineProperty(DS, 'FixtureAdapter', {
enumerable: true,
writable: false,
configurable: false,
value: null,
get: function(){
if (!fixtureAdapterWasDeprecated) {
Ember.deprecate('DS.FixtureAdapter has been deprecated and moved into an unsupported addon: https://github.com/emberjs/ember-data-fixture-adapter/tree/master');
fixtureAdapterWasDeprecated = true
}
return FixtureAdapter;
}
});

Ember.lookup.DS = DS;

export default DS;
Loading

0 comments on commit d834ea7

Please sign in to comment.