Closed matthewp closed 4 years ago
Idea: could you just use hg.app(require('global/document').body, state, render)
and then have the same code client and server?
Then on server, you can send down require('global/document').body.innerHTML
.
But I'm not sure if min-document
supports innerHTML.
Client-side reattachment was broken for server-rendered apps because of 8c26d68c65045521bff76dc091c4c23f8a9f65ca.
Another fix was submitted in https://github.com/Raynos/mercury/pull/207 but I think we should preserve the simplicity by using
hg.app
still. This makes it so that you can passtrue
as the value for the element which means "this was prerendered".Test included. Closes #79