Issues after upgrading ember-cli from 0.2.5 to 0.2.7


#1

Hi all,
I built a small test app that displays github API. It doesn’t use ember-data.
In this gist are the main files of the app that are different from default.

After updating ember-cli from 0.2.5 to 0.2.7 the app, at the route, for example, users/octocat displays only the HTML container but doesn’t render handlebars tags that simply disappear. Checking with ember-inspector I can see that the data are retrieved from github API but not displayed anymore.

Any hints?


#2

Ok, so I’ll try to add more information.
Actually, this is the response of github to an user API request:

{
  "login": "octocat",
  "id": 583231,
  "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "The Octocat",
  "company": "GitHub",
  "blog": "http://www.github.com/blog",
  "location": "San Francisco",
  "email": "octocat@github.com",
  "hireable": false,
  "bio": null,
  "public_repos": 5,
  "public_gists": 8,
  "followers": 1023,
  "following": 6,
  "created_at": "2011-01-25T18:44:36Z",
  "updated_at": "2015-05-22T18:59:27Z"
}

I read the specification of the convention for a JSON response for ember here, but it’s not clear if it’s used also in the model hook inside a route (that is what I have done here). If we apply the logic of Ember Data JSON convention we should consider that the ember serializer expects this kind of response from the API:

{
  "user": {
      "login": "octocat",
      "id": 583231,
      "avatar_url": "https://avatars.githubusercontent.com/u/583231?v=3",
      "gravatar_id": "",
      "url": "https://api.github.com/users/octocat",
      "html_url": "https://github.com/octocat"
   }
}

That is not the case of the github API response.

But the question is: does emberjs follow its JSON convention also for a raw data retrieving using model hook inside a route? Or is this convention specific to Ember Data?


#3

Solution:
This was not an ember-cli related issue.
It was actually and emberjs issue, relative to a deprecation added in version 1.11 and made executive in 1.12.
After a deep reading of all the deprecations relative to emberjs versions, I found that the change in Ember.ObjectController from version 1.11 to 1.12 (reported by the deprecation added for version 1.11):

Next update any use of {{modelPropertyName}} in templates with {{model.modelPropertyName}}.

produced a change in how the variables are called in templates. So in the case of a “details” template, you cannot call directly the variable correctly loaded in the EmberObject using - in my example - {{login}} but you have to use {{model.login}}.
With this change in the code that I reported, it works.

It would be possible to report this and express this change more clearly in the docs?