The 0.12.1 releases contains breaking changes. Luckly we don't have a large following yet so we can somewhat safely put this out quickly.
The major difference between 0.12.0
and 0.12.1
is the fact that the server API now returns React.createElement
instances by default instead of HTML. The reason for this is that it's the only way that you can get React components to depend on each other as each render
method needs to return React's DOM structure so it can be used to compose and diff the DOM tree.
In order to force HTML output of the templates you now need to supply a second argument in to the returned render method:
var render = jsx.server(template);
render({ data: 'for template' }, { html: true });
The { html: true }
instructs the renderer to transform it's DOM nodes to a HTML string instead of DOM nodes. Another big changes is that the client and server function now have compatibility in options as well. So everything you do on the server can be done on the client as well.