{"action":"created","issue":{"url":"https://api.github.com/repos/wistityhq/strapi/issues/80","labels_url":"https://api.github.com/repos/wistityhq/strapi/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/wistityhq/strapi/issues/80/comments","events_url":"https://api.github.com/repos/wistityhq/strapi/issues/80/events","html_url":"https://github.com/wistityhq/strapi/issues/80","id":130286302,"number":80,"title":"Promise.defer(); is obsolete","user":{"login":"sylvainlap","id":8457604,"avatar_url":"https://avatars.githubusercontent.com/u/8457604?v=3","gravatar_id":"","url":"https://api.github.com/users/sylvainlap","html_url":"https://github.com/sylvainlap","followers_url":"https://api.github.com/users/sylvainlap/followers","following_url":"https://api.github.com/users/sylvainlap/following{/other_user}","gists_url":"https://api.github.com/users/sylvainlap/gists{/gist_id}","starred_url":"https://api.github.com/users/sylvainlap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sylvainlap/subscriptions","organizations_url":"https://api.github.com/users/sylvainlap/orgs","repos_url":"https://api.github.com/users/sylvainlap/repos","events_url":"https://api.github.com/users/sylvainlap/events{/privacy}","received_events_url":"https://api.github.com/users/sylvainlap/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/wistityhq/strapi/labels/admin","name":"admin","color":"bfdadc"},{"url":"https://api.github.com/repos/wistityhq/strapi/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/wistityhq/strapi/labels/framework","name":"framework","color":"fef2c0"},{"url":"https://api.github.com/repos/wistityhq/strapi/labels/users","name":"users","color":"d4c5f9"}],"state":"open","locked":false,"assignee":{"login":"Aurelsicoko","id":4144726,"avatar_url":"https://avatars.githubusercontent.com/u/4144726?v=3","gravatar_id":"","url":"https://api.github.com/users/Aurelsicoko","html_url":"https://github.com/Aurelsicoko","followers_url":"https://api.github.com/users/Aurelsicoko/followers","following_url":"https://api.github.com/users/Aurelsicoko/following{/other_user}","gists_url":"https://api.github.com/users/Aurelsicoko/gists{/gist_id}","starred_url":"https://api.github.com/users/Aurelsicoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aurelsicoko/subscriptions","organizations_url":"https://api.github.com/users/Aurelsicoko/orgs","repos_url":"https://api.github.com/users/Aurelsicoko/repos","events_url":"https://api.github.com/users/Aurelsicoko/events{/privacy}","received_events_url":"https://api.github.com/users/Aurelsicoko/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/wistityhq/strapi/milestones/6","html_url":"https://github.com/wistityhq/strapi/milestones/v2.0.0","labels_url":"https://api.github.com/repos/wistityhq/strapi/milestones/6/labels","id":1480941,"number":6,"title":"v2.0.0","description":"","creator":{"login":"loicsaintroch","id":2212354,"avatar_url":"https://avatars.githubusercontent.com/u/2212354?v=3","gravatar_id":"","url":"https://api.github.com/users/loicsaintroch","html_url":"https://github.com/loicsaintroch","followers_url":"https://api.github.com/users/loicsaintroch/followers","following_url":"https://api.github.com/users/loicsaintroch/following{/other_user}","gists_url":"https://api.github.com/users/loicsaintroch/gists{/gist_id}","starred_url":"https://api.github.com/users/loicsaintroch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/loicsaintroch/subscriptions","organizations_url":"https://api.github.com/users/loicsaintroch/orgs","repos_url":"https://api.github.com/users/loicsaintroch/repos","events_url":"https://api.github.com/users/loicsaintroch/events{/privacy}","received_events_url":"https://api.github.com/users/loicsaintroch/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":1,"state":"open","created_at":"2016-01-03T11:32:17Z","updated_at":"2016-02-01T07:55:41Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-02-01T07:50:59Z","updated_at":"2016-02-01T09:04:30Z","closed_at":null,"body":"In your code, you use `const deferred = Promise.defer();` to create a new Promise. According to https://developer.mozilla.org/en-US/docs/Mozilla/JavaScript_code_modules/Promise.jsm/Deferred this method is obsolete.\r\n\r\nYou should use the ES6 way: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\r\n\r\n```\r\nnew Promise(function(resolve, reject) {\r\n  if (ok) {\r\n    resolve();\r\n  } else {\r\n    reject();\r\n  }\r\n});\r\n```"},"comment":{"url":"https://api.github.com/repos/wistityhq/strapi/issues/comments/177863722","html_url":"https://github.com/wistityhq/strapi/issues/80#issuecomment-177863722","issue_url":"https://api.github.com/repos/wistityhq/strapi/issues/80","id":177863722,"user":{"login":"Aurelsicoko","id":4144726,"avatar_url":"https://avatars.githubusercontent.com/u/4144726?v=3","gravatar_id":"","url":"https://api.github.com/users/Aurelsicoko","html_url":"https://github.com/Aurelsicoko","followers_url":"https://api.github.com/users/Aurelsicoko/followers","following_url":"https://api.github.com/users/Aurelsicoko/following{/other_user}","gists_url":"https://api.github.com/users/Aurelsicoko/gists{/gist_id}","starred_url":"https://api.github.com/users/Aurelsicoko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Aurelsicoko/subscriptions","organizations_url":"https://api.github.com/users/Aurelsicoko/orgs","repos_url":"https://api.github.com/users/Aurelsicoko/repos","events_url":"https://api.github.com/users/Aurelsicoko/events{/privacy}","received_events_url":"https://api.github.com/users/Aurelsicoko/received_events","type":"User","site_admin":false},"created_at":"2016-02-01T09:04:30Z","updated_at":"2016-02-01T09:04:30Z","body":"@sylvainlap I also read that the Promise constructor is throw safety. I don't know why we used the common deferred anti-pattern... This is a good timing because we have to rewrite the generators to consider our move to Bookshelf."}}