Node.js and Client-Side Rendering


A few months ago, I wanted to learn a new fun language. I tried unsuccessfully Ruby (which is by the way not really new), had a look at Scala and Clojure which I didn't like much (especially Clojure!) and came eventually on Javascript, sorry Node.js. Node.js is a wonderful language. If you know Javascript, you don't have much to learn to be good with Node. Well, there are plenty of details to learn, but the learning curve is quite fast in comparison to language like Ruby, which are for me very complicate.

Client Side vs Server Side

And then I tried to find different tutorials and browse the net to find interesting help. One of the most interesting article I found was this one. Lots of interesting informations and small intro for the difference between client-side and server-side rendering. Basically, client-side rendering means that you store the whole website in Javascript while server-side rendering is what you see on 99.9% of normal website (including this one). If you want a demo of client-side rendering, have a look on my app. You can register, if you want, but if you inspect the source of each page, you won't find much html ... Surprising, isn't it!?
The App itself will be subject to different blog posts, so stay tuned!

Advantages / Disadvantages

If you read the LinkedIn article, you will see only advantages using client-side rendering. However, there are not only advantages. One big drawback is search-engine indexation. How can Google see what's on your page if you just deliver Javascript to it? Also, what if you have a user not using Javascript (not common, but it happens). Most websites wants to be found by search engines so this is the reason why you don't see much websites using this technique. I may also imagine that Google / Bing are supporting partially this kind of client-side rendered websites but who would risk to bet on that and having its website ranked at the page 15678 if the bot interprets bad your ton of Javascript!?
Finally, an alternative is to have website supporting client-side rendering and server-side rendering. If the client doesn't accept Javascript, or for Bots of Search Engine, the server may deliver HTML instead of Javascript. Pretty smart, but not easy to maintain, nor to develop.

Finally, the templates of the app linked above have been developped with dustc of LinkedIn

comments powered by Disqus