Re:We've Open-sourced Rendr
by ricardobeat on Friday April 19, 2013 @02:57PM
(#5578140)
That is how Backbone and all other current frameworks work.
Re:We've Open-sourced Rendr
by superfreek on Friday April 19, 2013 @08:14PM
(#5579300)
No it isn't.
Re:We've Open-sourced Rendr
by ricardobeat on Friday April 19, 2013 @10:20PM
(#5579661)
Care to explain? They use pushState or hashes for routing, and load data via XHR. If you are using pushState it is assumed that the URL must exist on the server.
Re:We've Open-sourced Rendr
by cheapsteak on Saturday April 20, 2013 @01:37AM
(#5580430)
Having the URL exist on the server isn't the same as serving a rendered page from the URL, which is what most SPAs do. You could just rewrite all URLs in a website to point back to your index.html, then have the client side router initialize the app from the URL parameters. If you don't have javascript turned on (e.g. googlebot) then all you'll see is a blank page
Re:We've Open-sourced Rendr
by ricardobeat on Saturday April 20, 2013 @01:23PM
(#5582116)
Googlebot interprets javascript. In that case you shouldn't use pushState but fragment URLs[1].
I should have said it is assumed that the URL exists on the server and points to the same resource/content; otherwise setting URLs using pushState makes no sense. GitHub is a good example of how it should be done, not an exception.
[1] https://developers.google.com/webmasters/ajax-crawling/docs/...
This is what GitHub uses between tabs on its Pull Requests page. I love how simple the implementation is.
Your app still needs to follow the convention of having links going to different pages with URLs. I know it's not "single page" and the interaction is not that "rich." But it's nice because all your logic is still on the server, all rendering and templates are on the server and the server responds with either a full page of HTML or a partial page of HTML depending on an HTTP header you set.
Oh yeah, it also works without Javascript, crazy!