I have an ember-cli project, and I'm trying to get to ember 2.0. I know the idea is to remove all deprecation warning before upgrading, but I don't know what to do about this one:
DEPRECATION: The default behavior of shouldReloadAll will change in Ember Data 2.0
to always return false when there is at least one "foo" record in the store.
If you would like to preserve the current behavior please override shouldReloadAll
in your adapter:application and return true.
[deprecation id: ds.adapter.should-reload-all-default-behavior]
This warning is related to a call that I make for this.store.findAll('foo') for example.
As far as I can understand, fixing this would involve change the behavior of either ember-data or ember-django-adapter.
Here is my (partial) package.json:
{
"name": "my-app",
"private": true,
"devDependencies": {
"ember-cli": "1.13.13",
"ember-data": "1.13.15",
"ember-django-adapter": "^1.1.1",
}
}
Here is a some of my bower.json:
{
"name": "my-app",
"dependencies": {
"ember": "1.13.11",
"ember-data": "1.13.15",
"ember-resolver": "~0.1.20",
}
}
So, after reading a bit, I thought maybe I can just ignore this warning, and maybe the behavior of shouldReloadAll isn't all that important for my app.
I'll list my steps carefully, because I'm not very familiar with npm or bower, and I may well be doing something wrong.
- Change ember and ember-data to
"~2.0.0"wherever they occur inpackage.jsonandember.json npm uninstall ember-databower uninstall ember-databower uninstall embernpm cache clearbower cache clearnpm installbower install
At this point it is telling me that I have installed [email protected] and [email protected]
I then run the application, and find the following error:
TypeError: str.replace is not a function
at Object.func (ember.debug.js:35278)
at Object.Cache.get (ember.debug.js:12867)
at decamelize (ember.debug.js:35320)
at Object.func (ember.debug.js:35235)
at Object.Cache.get (ember.debug.js:12867)
at Object.dasherize (ember.debug.js:35324)
at ember$data$lib$system$normalize$model$name$$normalizeModelName (normalize-model-name.js:13)
at ember$data$lib$serializers$json$serializer$$default.extend.modelNameFromPayloadKey (rest-serializer.js:426)
at ember$data$lib$serializers$json$serializer$$default.extend._normalizePolymorphicRecord (rest-serializer.js:161)
at rest-serializer.js:141onerrorDefault @ ember.debug.js:29661exports.default.trigger @ ember.debug.js:51067(anonymous function) @ ember.debug.js:52059Queue.invoke @ ember.debug.js:978Queue.flush @ ember.debug.js:1042DeferredActionQueues.flush @ ember.debug.js:838Backburner.end @ ember.debug.js:166Backburner.run @ ember.debug.js:288run @ ember.debug.js:19125hash.success @ rest-adapter.js:735fire @ jquery.js:3148self.fireWith @ jquery.js:3260done @ jquery.js:9314callback @ jquery.js:9718
The following versions are reported:
DEBUG: -------------------------------
vendor.js:15777 DEBUG: Ember : 2.0.2
vendor.js:15777 DEBUG: Ember Data : 2.0.1
vendor.js:15777 DEBUG: jQuery : 1.11.3
vendor.js:15777 DEBUG: -------------------------------
vendor.js:19380 Rendering application with bracketfun-web@view:toplevel: Object
PLEASE NOTE: This error doesn't seem related to the deprecation, in any explanation of the deprecation that I've received.
shouldReloadAll()method in your application adapter (which will extend the Django adapter) and just make it return true. The reason for the change is so that results are cached, and can be explicitly reloaded usingthis.store.findAll('foo', { reload: true }). - uberclops