3 ms·
> then doing so without the server being Javascript is more complex. why? What does the server being javascript do for you that no other server can do to reduc
by meesterdude 9y ago
> then doing so without the server being Javascript is more complex.
why? What does the server being javascript do for you that no other server can do to reduce the complexity?
- matthewmacleod 9y agoIt allows you to use the same tools to render the user interface on both the server and the client. For example: write a UI using React components, render a static version on the server, and use those same React components running in the browser to render an SPA using the statically-rendered template as a seed. The options if you are not using javascript on the server are less appealing - calling out to a JS interpreter to do your templating, or building duplicate templates for server and client side, or trying to sprinkle interactive client magic on the page after it’s been loaded. They’re all possible, but they are more complex than “one set of templates rendered everywhere” - what people were calling “isomorphic” I suppose, though it’s a silly term. Have I clarified? You seem unusually upset about what I thought was a relatively minor aspect of my initial post.
- meesterdude 9y agounusually upset? I've written like, two sentences in this thread. But apparently it was enough to get downvoted & flagged. I'm allergic to bullshit, but not to discourse. Your initial post sounded like nonsense to me - like you were arbitrarily elevating javascript for no particular reason. But now that you've explained that you're talking in context SSR I understand. Maybe that was inferred and I just missed it - even if thats what this whole HN thread is about. I know I was thinking in terms of JSON responses and couldn't understand why one would be so much better than the other. So, you're right. you do have to do additional work, when JS isn't your server, when your pages are rendered with JS and you want to pre-render pages. But I wonder - is it worth it to move your entire backend into JS just to do that for SSR? Would not calling out to a JS interpreter be the more... SOA approach, or even the more pragmatic one? Or is it exponentially more difficult to do that than to move everything into node/JS?