Live data from Hacker News

Rendr - Use Backbone on both the server and client

github.com

21–30 of 35 posts

Re: Rendr - Use Backbone on both the server and client

#21
post #7

I remember reading their blog post about their "Holy Grail" framework, but I couldn't really understand what made it so cool. Can someone explain to a noob like me why someone would consider Rendr the Holy Grail of frameworks?

IIRC, it bridges single page web apps and standard websites. I.e. on the initial request, the page is rendered server-side, similarly as it would say with Rails and will work even if the client has JS disabled. If the client has JS enabled, it will work as a SPA.

More important than the JS-disabled case is the speed of the first page.

Given my experience with the very similar highbrow, I expect that rendr can return a fully functional page in 10-20 ms. In a typical client-side JS framework, the first page takes 300-3000 ms to render. Subsequent pages are lightning quick, but in many cases it's the first page that's the important one.

Re: Rendr - Use Backbone on both the server and client

#22
We used a similar approach with Bones (https://github.com/developmentseed/bones) for a while and ended up dropping it for a more decoupled architecture (API on side and static client on the other).

I remember chatting with Spike about this at a Backbone.js meetup at Airbnb's office last year, I think they were aware of the limitations similar frameworks were running into.

I'd be interested in seeing how this play outside of Airbnb's use case, but from experience I think sharing backbone.js on both client and server, while neat, end up being pretty constraining.

Re: Rendr - Use Backbone on both the server and client

#23
We @sc5io decided to release our own research regarding this very same issue.

I love the Rendr approach, yet we feel that our backbone-serverside framework provides an even more flexible way to tackle the same issue.

Read more at SC5 blog (http://blog.sc5.fi/2013/04/serving-backbone-for-robots-legac...) or at the Mozilla Hacks article: https://hacks.mozilla.org/2013/04/serving-backbone-for-robot...

Re: Rendr - Use Backbone on both the server and client

#24
post #6

I have gone through the blog post and bit of code but I am a bit stomped. Can anyone tell what is the flow here? If I go directly to /search/q=hello, the request will go to server, it will render the HTML on server and send it to client. What happens next? Do they send all the Javascript + client-side templates alongside as well so that further requests are catered on client? Think I should fiddle around with the sam…

Do they send all the Javascript + client-side templates alongside as well so that further requests are catered on client?

Yes.

Re: Rendr - Use Backbone on both the server and client

#25

Earlier quoted context omitted.

IIRC, it bridges single page web apps and standard websites. I.e. on the initial request, the page is rendered server-side, similarly as it would say with Rails and will work even if the client has JS disabled. If the client has JS enabled, it will work as a SPA.

More important than the JS-disabled case is the speed of the first page. Given my experience with the very similar highbrow, I expect that rendr can return a fully functional page in 10-20 ms. In a typical client-side JS framework, the first page takes 300-3000 ms to render. Subsequent pages are lightning quick, but in many cases it's the first page that's the important one.

These types of frameworks also offer better SEO, because despite popular claims about Google crawlers rendering Javascript, "single page apps/blogs/whatever" get a lot less Google-juice than sites rendered on the server.

Re: Rendr - Use Backbone on both the server and client

#26

My brother released a very similar project about 8 months ago.[1] He never did properly announce or document it so it's no surprise that nobody else is using it. Of course, it's not like rendr has any real documentation, either. However it has been working very well for us, so it is validation of the rendr approach. A quick glance at their documentation indicates a very similar design, comparing the two projects shou…

This is really nice, thanks for sharing. When this thread hit the front page last night I was very surprised that no one had done this before with Backbone--as it turns out, a few people have!

Re: Rendr - Use Backbone on both the server and client

#29
post #7

I remember reading their blog post about their "Holy Grail" framework, but I couldn't really understand what made it so cool. Can someone explain to a noob like me why someone would consider Rendr the Holy Grail of frameworks?

MVC is being used for web development. The M part, model, handles the rules for inputs. This would trigger validation errors. In a typical stack, we code the server-side model in, say, Ruby on Rails, and duplicate the same model in client-side model in JavaScript so it can detect things like minimum password lengths without sending data back to the server. The holy grail is to have both server-side and client-side in…

This approach doesn't help. With highbrow and presumably rendr, you still have 'client side' & 'server side' components to your project. The 'server side' is typically just a JSON REST API. In our case, it uses mongoose to talk to mongodb. The 'client side' talks to the API and renders HTML; on first load it actually runs on the server. The client side uses Backbone.js models.

So you still need both backbone & mongoose/whatever validations if you want them both on the client & server side. In practice, the system is fast enough that server side validations may be sufficient.

Re: Rendr - Use Backbone on both the server and client

#30
post #15

Wow, their samples sure look like Batman.js. Also, I'm a fan of them for going with CoffeeScript, they have taste. But seriously, looks very much like Shopify's batman.js http://batmanjs.org

They're both written in coffeescript, and they're both written about the same time so have very similar influences. I think most of the similarities you see stem from those two points. But there are some massive differences: - batman.js is Rails-style MVC, rendr is based on Backbone so you must supply your own controllers. A good argument can be made that Rails is not truely MVC, but it at least attempts to do so. re…

I wasn't pointing out on those portions, I was merely just reflecting over the API design :) keywords and etc
Post reply on HN