3.0.0
This is a major release of done-ssr bringing together compatibility with CanJS 5.0, StealJS 2.0, incremental rendering by default, and native http2 support.
Features
Incremental rendering
The biggest new feature of this release is support for incremental rendering. Incremental rendering is a new way for DoneJS apps to boot faster for the user. This is done by sending out an initial HTML request as quickly as possible while still rendering on the server. As the server renders instructions are sent back to the client which updates itself.
The result can be a dramatic difference in poor network conditions or when making slow API/database requests.
HTTP/2
done-ssr now supports the native http2 module from node. If you are using this API you can provide done-ssr the headers
object like so:
const ssr = require('done-ssr');
const http2 = require('http2');
const fs = require('fs');
const render = ssr();
const server = http2.createSecureServer({
key: fs.readFileSync('localhost-privkey.pem'),
cert: fs.readFileSync('localhost-cert.pem')
});
server.on('error', (err) => console.error(err));
server.on('stream', (stream, headers) => {
stream.respond({
'content-type': 'text/html',
':status': 200
});
render(headers).pipe(stream);
});
server.listen(8443);
CanJS 5 and StealJS 2
With the release of DoneJS 3.0, done-ssr now supports CanJS 5 and StealJS 2 apps.