5 ms·
full circle?
by leetbulb 11y ago
full circle?
- smadge 11y agoWas going to say the same thing. Depressing. Most js devs probably don't realize the irony.
- profeta 11y agolove how your comment was downvoted to oblivion and yet, the thread went on and on. the irony indeed.
- chrisfosterelli 11y agoHow is this full circle? Traditional server-rendered pages don't support the ability to navigate to new pages and fully interact with the application without refreshing.
- smadge 11y agoTraditional server-rendered pages would prioritize serving content first. Then they would sprinkle in some javascript to provide dynamic features(like navigating to new pages without refreshing). This is exactly what "isomorphic javascript" is providing now, in a very roundabout manner.
- chrisfosterelli 11y ago> sprinkle some javascript to provide dynamic features I've never seen any added javascript to a page that went as far as generating and rendering other pages completely, that's always been a refresh. If it's not then that's literally the same thing as a SPA, and is actually isomorphic javascript. The "sprinkled javascript" that your talking about was basically used to do some simple DOM manipulation and a few XHR requests. It is not the same as a full single page app that is bootstrapped from server-side markup.
- deleted 11y ago[deleted]
- smadge 11y ago> I've never seen any added javascript to a page that went as far as generating and rendering other pages completely, that's always been a refresh. pjax[1] does what you are describing. There are other similar libraries as well. On user navigation, it makes a XHR request to the server, and updates in place any changed DOM elements. I like this, because it progressively enhances the user experience. An application should focus on serving content quickly to the user, then improving the experience where browsers leave a gap. Notice that pjax provides the same functionality as an isomorphic javascript without inflicting upon the world server side javascript ;) [1] https://github.com/MoOx/pjax https://github.com/MoOx/pjax
- chrisfosterelli 11y agoAh, I stand corrected! I've never seen pjax before. That said, this project was created in February 2015... It's not that the "Traditional server-rendered pages" approach had been doing this for decades and isomorophic javascript simply reinvented the wheel here... this is a new project. I shouldn't have claimed that you need full javascript to do this, that was clearly wrong, but my point is that isomorophic javascript is not the same as the common traditional server-rendered pages used before javascript single page applications came around.
- firasd 11y agoIdeally there should be a way to render JavaScript on the server side for views/templates, like React, without having to write your whole backend in JS. In fact I just googled and found something like this in the reactjs commmunity repo: https://github.com/reactjs/react-php-v8js https://github.com/reactjs/react-php-v8js
- lucaspiller 11y agoOne easy solution is to have a server side application that just serves the view layer. That bit can be JavaScript, then your API can be whatever language you want.
- Pxtl 11y agoWe're back to aspnet web forms and the update panel, but with a less terrible API.