5 ms·
How's this for a revolutionary idea: The server sends text hat can be rendered on any device with minimal resource usage, can be cached, can be parsed by robots
by blueskin_ 13y ago
How's this for a revolutionary idea: The server sends text hat can be rendered on any device with minimal resource usage, can be cached, can be parsed by robots, and even formatted by the user.
Rendering pages in javascript just wastes the user's computing resources (and opens them up to nice vulns) and prevents search engines from indexing your content.
- pascalo 13y agoWell, roudtripping to the server and reloading a whole chunk of html to get a sorted view of a table you already have downloaded isn't super smart either?
- camus2 13y agothat's exactly what microsoft is doing with its excel app online,and it's one of the fastest app i've ever seen.
- protonfish 13y agoThat sounds great, but does it have a framework with corporate backers?
- blueskin_ 13y agoIt's called HTML.
- jaegerpicker 13y agoThat's a pretty horrible idea and a large step backwards. Sure the web started out as a system for reading and sharing text but that being the extent of the web's UI pattern has long since passed. For good reason. The web is our best shot at create an open and non controlled application framework. Rendering text on a server and not using JS isn't even close to a solution for that.
- IgorPartola 13y agoCool. How do you provide instantaneous feedback with this system? As in, if the user has a list of items with delete buttons, and you want to remove the item from the list as soon as the user clicks the X? Think about using your browser and having it reload every toolbar and menu every time you clicked on something. All sarcasm aside, plain HTML has plenty of great uses, but just because you don't see a reason for client-side apps does not mean that they don't exist.
- _nate_ 13y agoCan you not use AJAX through jQuery to gain this instant feedback? Do I really need to load an additional library to send and receive data to the server and update the UI, when I can already do that through jQuery? This is an aspect of the HTML vs JS rendered page debate I’m still trying to wrap my head around. I understand really large and complex applications need libraries like Angular, Ember, React, and the like to render their pages with JS. But what is so backwards and old-school about rendering HTML server side and then manipulating the HTML client side with a thin layer of JS and AJAX? It feels as if the debate is between plain vanilla HTML pages and highly complex JS rendering, without any middle ground and integrating the benefits of both. EDIT: Thank you for the responses. I’m genuinely trying to understand the pro and cons – of not just each framework – but of the methodologies in general, and your answers help.
- protonfish 13y agoI agree except for "large complex applications need libraries like Angular" That is nonsense. There were plenty of large complex web apps before Angular and they worked fine. This sudden belief that web apps need a front-end framework is insane.
- ben336 13y agoSure. And if you display a count of the number of items in the list, you can update that with jQuery too. Are there other dependencies? Maybe if the list gets too small there's supposed to be a warning message or something shown? I can check the list size each time with jQuery and display/hide the message if necessary. Eventually as these side effects pile up, jQuery by itself becomes a mess. You have a ton of checks and complex behaviors after each user event. Or I can provide some structure on the front end so that I can model my data in a reasonable way and have the DOM respond based on changes to that model. Obviously for stuff thats mostly static, server-side rendering is better. But when you're displaying stuff that includes complex relationships and behaviors, modeling it on the client side becomes an important part of maintainability. This doesn't have to be complicated. Backbone is certainly not complicated. But it is the best option if you want to have complex UI behavior tied to an underlying model and need responsive UI feedback.
- ashmud 13y agoWould this be anything like Atom/RSS? I like as much separation as possible for letting the UI do the formatting and the backend just be an API. I'm not sure how this (not rendering in JS) would handle more complex scenarios such as SPAs.
- williamcotton 13y agoUse React and you get the best of both worlds. React supports server-side rendering. Apps built with Angular or Ember have major issues with SEO. They'll have to resort to using something like PhantomJS to prerender their HTML. This is not a trivial bit of engineering.
- pascalo 13y agoInteresting ... By "supports server side rendering", do you mean react can bind to a chunk of preexisting HTML in the page to enhance it? Or running react on node and build a page? Got an example at hand?
- williamcotton 13y agoYou'll have to excuse me because I only did a cursory reading of the the following, but it seems to be a decent outline: http://bensmithett.com/server-rendered-react-components-in-rails/ http://bensmithett.com/server-rendered-react-components-in-r...
- pascalo 13y agoThanks. Will give that a read. Edit: Very interesting read liked from there ... https://groups.google.com/forum/m/#!msg/reactjs/eUespJPdyas/hmJywyo9ZSwJ https://groups.google.com/forum/m/#!msg/reactjs/eUespJPdyas/...
- deleted 13y ago[deleted]
- camus2 13y agoYou can render react HTML components in node js without a headless browser, you cant do that with angular,so you can use react on the server.
- lightblade 13y agoI think you're talking about XSLT