{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/4017","repository_url":"https://api.github.com/repos/Starcounter/Starcounter","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/4017/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/4017/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/4017/events","html_url":"https://github.com/Starcounter/Starcounter/issues/4017","id":196940047,"number":4017,"title":"Allow multiple JSON roots in Puppeteer response","user":{"login":"warpech","id":566463,"avatar_url":"https://avatars.githubusercontent.com/u/566463?v=3","gravatar_id":"","url":"https://api.github.com/users/warpech","html_url":"https://github.com/warpech","followers_url":"https://api.github.com/users/warpech/followers","following_url":"https://api.github.com/users/warpech/following{/other_user}","gists_url":"https://api.github.com/users/warpech/gists{/gist_id}","starred_url":"https://api.github.com/users/warpech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warpech/subscriptions","organizations_url":"https://api.github.com/users/warpech/orgs","repos_url":"https://api.github.com/users/warpech/repos","events_url":"https://api.github.com/users/warpech/events{/privacy}","received_events_url":"https://api.github.com/users/warpech/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-21T14:01:59Z","updated_at":"2016-12-22T07:28:35Z","closed_at":null,"body":"For the starts, I am just signalling the problem that me and @tomalec have discussed yesterday.\r\n\r\nRight now we have a feature that the first JSON response returned from a handler gets sent to client. Responses from middleware or mapping are ignored. You can affect this by setting the `PublicViewModel` property, but this does not solve blending at the root level -- still, there can only be one root.\r\n\r\nThis has numerous inelegant consequences:\r\n\r\n- Puppeteer/PuppetJs session state version number (`_ver#c$`, `_ver#s`) is added as a \"magic\" root property. This alters the original JSON tree proposed by the app.\r\n- It is not possible to get responses from multiple apps to a root request\r\n- LauncherLayoutInfo (definition of the blending composition) cannot be added at the root level, meaning that the root partial is not blendable\r\n\r\nIdea: Putting all Puppeteer responses in Starcounter to some JSON envelope solves all of the above problems:\r\n\r\n```js\r\n  {\r\n    \"_ver#c$\": 0,\r\n    \"_ver#s\": 0,\r\n    \"Responses\": {\r\n        /* All returned responses go here */\r\n    }\r\n  }\r\n```\r\n\r\nSolving this has many benefits:\r\n\r\n- removes magic of version numbers\r\n- turns the root response into just a partial. \"Partials all the way up\" AKA \"Make Starcounter partial-centric\" AKA https://github.com/Starcounter/Starcounter/issues/3540\r\n- allows for cleaner implementation of many points in https://github.com/StarcounterPrefabs/Launcher/issues/261\r\n- allows to add siblings a the root level, so common UI such as Layout Editor or Sign In can be used with any app through middleware or URI mapping\r\n- Layout Editor will be finally able to edit root partials\r\n- allows to obsolete `PublicViewModel` (https://github.com/Starcounter/TechComm/issues/235#issuecomment-265959977)\r\n\r\nI think this should be a goal for Starcounter 2.4. Please slap me in the face if something is fundamentally wrong with my proposal.\r\n\r\nAnyone has strong ideas for or against?\r\n\r\ncc @chrhol, @per-samuelsson, @miyconst, @tomalec, @Starcounter-Jack "},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/268736675","html_url":"https://github.com/Starcounter/Starcounter/issues/4017#issuecomment-268736675","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/4017","id":268736675,"user":{"login":"warpech","id":566463,"avatar_url":"https://avatars.githubusercontent.com/u/566463?v=3","gravatar_id":"","url":"https://api.github.com/users/warpech","html_url":"https://github.com/warpech","followers_url":"https://api.github.com/users/warpech/followers","following_url":"https://api.github.com/users/warpech/following{/other_user}","gists_url":"https://api.github.com/users/warpech/gists{/gist_id}","starred_url":"https://api.github.com/users/warpech/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/warpech/subscriptions","organizations_url":"https://api.github.com/users/warpech/orgs","repos_url":"https://api.github.com/users/warpech/repos","events_url":"https://api.github.com/users/warpech/events{/privacy}","received_events_url":"https://api.github.com/users/warpech/received_events","type":"User","site_admin":false},"created_at":"2016-12-22T07:28:35Z","updated_at":"2016-12-22T07:28:35Z","body":"Good point, I am all for unifying the treatment of the root and the other places. "}}
{"actor":{"display_login":"warpech"}}