So I’m trying to understand the new server-render package: http://docs.meteor.com/packages/server-render.html
Can someone explain what exactly is happening behind the scene. I’m particularly confused about the difference between using the onPageLoad on client vs using it on server.
especially on client side, I mean… a server side rendering on the client side??? what does that mean?
onPageLoad is for server-side only. On client you can use your client router or a package like ‘history’ on npm to listen to the URL change client-side
But in the official doc - http://docs.meteor.com/packages/server-render.html, under the Usage section, it says “Likewise on the client:”, then followed with a code snippet.
What I didn’t know is that you still have possibility to use onPageLoad on the client. This may be useful !
For example in the future our sink object could contain more data, and this may be easier to use this way.
If you want one more working example (using onPageLoad server side, and history client side)
thx. I’m able to get this work on server side.
But I’m just very confused. Especially on client side, what does it mean “server side rendering on the client side”? and what is the difference between calling it on server and client?
My question is more towards understanding the concept.
So at this time the HTML sent by the server is actually overriden by the HTML/CSS/JS of the client, which takes over.
This is kind of a hybrid approach to render HTML.