{"action":"opened","issue":{"url":"https://api.github.com/repos/opentable/oc/issues/224","repository_url":"https://api.github.com/repos/opentable/oc","labels_url":"https://api.github.com/repos/opentable/oc/issues/224/labels{/name}","comments_url":"https://api.github.com/repos/opentable/oc/issues/224/comments","events_url":"https://api.github.com/repos/opentable/oc/issues/224/events","html_url":"https://github.com/opentable/oc/issues/224","id":145964285,"number":224,"title":"OC plugin to render nested components on the server-side","user":{"login":"matteofigus","id":1789893,"avatar_url":"https://avatars.githubusercontent.com/u/1789893?v=3","gravatar_id":"","url":"https://api.github.com/users/matteofigus","html_url":"https://github.com/matteofigus","followers_url":"https://api.github.com/users/matteofigus/followers","following_url":"https://api.github.com/users/matteofigus/following{/other_user}","gists_url":"https://api.github.com/users/matteofigus/gists{/gist_id}","starred_url":"https://api.github.com/users/matteofigus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matteofigus/subscriptions","organizations_url":"https://api.github.com/users/matteofigus/orgs","repos_url":"https://api.github.com/users/matteofigus/repos","events_url":"https://api.github.com/users/matteofigus/events{/privacy}","received_events_url":"https://api.github.com/users/matteofigus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-04-05T11:45:26Z","updated_at":"2016-04-05T11:45:26Z","closed_at":null,"body":"When rendering nested components on the server-side, an unnecessary network trip is required to make extra requests to the registry itself.\r\nThe ideal solution for optimally approaching to this scenario would be to have a plugin to render nested components using exposed registry internals to do the rendering via the same instance. \r\n\r\nThe api for a `server.js` file should be something like this:\r\n```js\r\nmodule.exports.data = function(context, callback){\r\n  var nestedComponents = [\r\n    { name: 'component', parameters: { 'hello': 'world' }},\r\n    { name: 'component2', parameters: { 'hello': 'world' }}\r\n  ];\r\n  context.plugins.renderComponents(nestedComponents, function(err, components){\r\n    callback(null, components);\r\n  });\r\n};\r\n```\r\nThe plugin should have the same API as [the node.js client's `renderComponents` method](https://github.com/opentable/oc/tree/master/client#clientrendercomponentscomponents--options-callback) - but it should do the rendering without making an extra request to itself."}}