Hacker News new | ask | show | jobs
by ymn_ayk 4820 days ago
I don't like the idea of rendering client code in the server.
2 comments

Don't think of it as client or server code. Think of it as presentation code. And it happens to run on both the server and browser.

Though, don't write your business code in javascript. Hell to maintain.

If you can do it without code duplication, why not just consider it a kind of caching? That's how it seems to be used here: as an optimization.

If your definition of the JSON to HTML transformation is declarative, it makes sense to allow the server to do it for the data that's available to it.

The web has a semi-long history of "dumb clients," and that means the server has to be able to do the rendering. There are some pretty good reasons for this, and projects like Rendr try to make it as easy as possible. Seems good to me!