Greetings! I am a beginner with Ember and recently encountered some warnings after upgrading to the latest version of Ember Data:
Update: I have two identical versions of my app, one built without ember-cli and the other with ember cli. Both applications display these warning messages in the console:
DEPRECATION: Usage of snapshot.constructor
is deprecated, use snapshot.type
instead.
DEPRECATION: Using DS.Snapshot.get() is deprecated. Use .attr(), .belongsTo() or .hasMany() instead.
The first warning appears twice, while the second warning shows up once right after clicking an alert. Here's the code snippet triggering this issue:
The difference lies in the fact that the non-ember-cli built app works without any issues!
It seems like this could be related to a problem within ember-cli
import Ember from 'ember';
export default Ember.Controller.extend({
sortProperties:["time"],
sortAscending:true,
start:new Date(),
count:0,
incorrect:0,
startReview:true,
showHighScores:false,
actions:{
// more action functions here...
},
Immediately after interacting with the alert, the deprecation warnings appear
Further analysis points to the set and get methods in the code below as potential culprits, but adapting them to comply with the latest Ember Data update has been challenging:
randomizer:function(){
this.set("randomArray",this.get("model.text").split(" ").randomize());
}.observes("startReview"),
// more functions and logic follow...
});
If you'd like to learn more about the newest release of ember-data, check out this blog post: