Raynos / mercury

A truly modular frontend framework
http://raynos.github.io/mercury/
MIT License
2.82k stars 143 forks source link

Allow `true` to be passed into hg.app #208

Closed matthewp closed 4 years ago

matthewp commented 8 years ago

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 pass true as the value for the element which means "this was prerendered".

Test included. Closes #79

ajoslin commented 8 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.