{"action":"created","issue":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/73","labels_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/73/comments","events_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/73/events","html_url":"https://github.com/ParsePlatform/Parse-SDK-JS/issues/73","id":114122715,"number":73,"title":"Blockers migrating from SDK 1.5.x -> 1.6.x","user":{"login":"TylerBrock","id":280807,"avatar_url":"https://avatars.githubusercontent.com/u/280807?v=3","gravatar_id":"","url":"https://api.github.com/users/TylerBrock","html_url":"https://github.com/TylerBrock","followers_url":"https://api.github.com/users/TylerBrock/followers","following_url":"https://api.github.com/users/TylerBrock/following{/other_user}","gists_url":"https://api.github.com/users/TylerBrock/gists{/gist_id}","starred_url":"https://api.github.com/users/TylerBrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TylerBrock/subscriptions","organizations_url":"https://api.github.com/users/TylerBrock/orgs","repos_url":"https://api.github.com/users/TylerBrock/repos","events_url":"https://api.github.com/users/TylerBrock/events{/privacy}","received_events_url":"https://api.github.com/users/TylerBrock/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-10-29T18:58:10Z","updated_at":"2015-11-03T19:22:27Z","closed_at":null,"body":"I understand that the JS SDK is moving away from backbone style objects but there are a couple of pieces of that functionality that we'd like to see make their way into the 1.6 SDK at some point.\r\n\r\n- Our application depends on the ability to silently update attributes of Parse.Objects\r\n\r\n  Our existing parse objects (called models in our application's vernacular) all override `validate()` to provide client and server side validation for objects. We validate them before they are sent to Parse in the browser and after Parse receives them via a beforeSave hook. While it is not always the case, we often depend on being able to have objects in a non-valid state up until the point they are saved by constructing and updating them with `{silent: true}`.\r\n\r\n   ```js\r\nvar thing = new Models.Thing({\"awesome\": true}), {silent: true});\r\nthing.set(\"awesome\", true, {silent: true});\r\n   ```\r\n\r\n  The reason we do this is because we want to build up a model with information we receive over time. For example a user wants to create a group in our system and we know the `organizationId` that it belongs to up front but don't have the other details such as group `name` and `location`.\r\n\r\n  You can imagine having a <ModelForm> component in React that renders a form with data that you currently have about an object (that can't be saved as-is) but that can have the missing pieces filled in by the user to make it ultimately validate cleanly.\r\n\r\n  The API doesn't have to be the same but it would be great if you could construct objects and manipulate their attributes freely **UNTIL** you try and save it, at which point everything must be valid. This surfaces as thousands of \"Uncaught Error: Can't create an invalid Parse Object\" in our application.\r\n\r\n- Our application depends on defaults\r\n\r\n  This one is easier to work around but as a result of the way we use validation (described in the first bullet point) we depend on some values having defaults.\r\n\r\n[Here](https://gist.github.com/TylerBrock/67916527b5bb3b3ae7f9) is an example of a HustleModel and HustleModel's implementation where you can see defaults and constraints in use. I don't mind that this code is publicly visible.\r\n\r\nHow can we help add this functionality or work around is absence in versions 1.6+ of the SDK? I'd like to help in any way possible so that we can stay current with bugfixes, etc (the retrying of API requests in the new RESTController especially) and use more ES6."},"comment":{"url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/comments/153460794","html_url":"https://github.com/ParsePlatform/Parse-SDK-JS/issues/73#issuecomment-153460794","issue_url":"https://api.github.com/repos/ParsePlatform/Parse-SDK-JS/issues/73","id":153460794,"user":{"login":"TylerBrock","id":280807,"avatar_url":"https://avatars.githubusercontent.com/u/280807?v=3","gravatar_id":"","url":"https://api.github.com/users/TylerBrock","html_url":"https://github.com/TylerBrock","followers_url":"https://api.github.com/users/TylerBrock/followers","following_url":"https://api.github.com/users/TylerBrock/following{/other_user}","gists_url":"https://api.github.com/users/TylerBrock/gists{/gist_id}","starred_url":"https://api.github.com/users/TylerBrock/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TylerBrock/subscriptions","organizations_url":"https://api.github.com/users/TylerBrock/orgs","repos_url":"https://api.github.com/users/TylerBrock/repos","events_url":"https://api.github.com/users/TylerBrock/events{/privacy}","received_events_url":"https://api.github.com/users/TylerBrock/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T19:22:27Z","updated_at":"2015-11-03T19:22:27Z","body":"Both Goals and GoalSteps are completely new objects.\r\n\r\n```js\r\n// goals require group pointer\r\nvar group;\r\nvar query = new Parse.Query(Group);\r\nquery.first().then(function(g){\r\n  group = g;\r\n});\r\n\r\n// the setup\r\nvar goal = new Goal({name: \"Great Goal\", group: group})\r\nvar goalStep = new GoalStep()\r\ngoalStep.set(\"goal\", goal);\r\n\r\n\r\ngoal.save() // works fine\r\ngoalStep.save().fail(function(error){\r\n  console.log(error)\r\n})\r\n```\r\n\r\nOutput:\r\n```js\r\nParseError {\r\n  code: 111,\r\n  message: 'invalid type for key goal, expected *Goal, but got map'\r\n}\r\n```"}}