|
|
|
|
|
by jsjohnst
3474 days ago
|
|
The only really "good" reason in my opinion is to use the same code that renders the page in the browser to be used to render the page on the server. I've never seen this done well in production though. Dav Glass did some awesome hack day projects in the early days of Node.js demonstrating how this could work for Yahoo mail. Hit your inbox for the first time in a browser session and it'll send back a full HTML page rather than a bunch of JS files and expect the client to render before anything appears. With this you could have less than one second full render times for a complex single page app. Imagine if Gmail did something like this, you wouldn't need to leave a tab open to avoid the 5-10sec it takes from login till inbox shows. Furthermore, you could build this out further where if the "compose page" JavaScript hadn't loaded yet, you could then roundtrip to the server and get the markup rather than waiting on it to parse and execute on a slower machine. Not saying everyone should do this obviously, but it is a valid use case for JavaScript on the server if done right IMHO. |
|