{"push_id":853557654,"size":1,"distinct_size":1,"ref":"refs/heads/jquery","head":"910b4675440e1c8e0c1ea2c74d905bf16a702e1f","before":"03ff7df3f556cc8b39ca34c0d14bed4ca39eff21","commits":[{"sha":"910b4675440e1c8e0c1ea2c74d905bf16a702e1f","author":{"email":"f80d0ca101e967b50b730ddf8e8aca0de85e8df6@matthewphillips.info","name":"Matthew Phillips"},"message":"Implements new Main Module API\n\nThis commit implements the Main Module API as defined in #80. What this\nmeans is that you can use can-ssr with any JavaScript module as long as\nthey implement these two APIs:\n\nCreates an Object that will hold state relevant for the request. This\ncould be some type of typed object that acts as a view model for your\napp or it could be a plain object, depending on what your framework\nneeds.\n\n```js\nexports.createState = function(){\n\treturn new AppViewModel();\n};\n```\n\n**render** is a function that returns a Promise when it has finished\nrendering. It is given a new Document that it can write to, or it could\nalso return a string representation.\n\n```js\nexports.render = function(doc, state){\n\tvar $body = $(doc.body);\n\n\t$body.append($(\"<div>Hello world</div>\"));\n\n\treturn $.getJSON(\"/some/data.json\").then(function(data){\n\t\t// render the data some how\n\t});\n};\n```\n\nIf writing directly to the provided Document can-ssr will stringify the\ndocumentElement and return that as the response.","distinct":true,"url":"https://api.github.com/repos/canjs/can-ssr/commits/910b4675440e1c8e0c1ea2c74d905bf16a702e1f"}]}