TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: hr.js - Build large client-side applications in a structured way

69 pointsby SamyPesseover 11 years ago

8 comments

villeover 11 years ago
It feels a lot like Backbone.js. However when building a large application with Backbone, by time lots of things need to be added on top of it: i18n, caching, paged loading of collections, queues...<p>Looks like hr.js includes most of these things out of the box and is built in a modular way with AMD modules (no more framework in one single file like Backbone). It looks like an amazing piece of work.<p>That being said, I have a couple of questions.<p>1) Why was this not build on top of Backbone.js? This way it could benefit of a battle tested codebase used in many production systems and the Backbone apps out there could immediately benefit from the added features by just adding a few new modules (instead of rewriting to use this framework). Many core parts look very similar to Backbone, at least Models, Views and Router&#x2F;History, with useful extensions on top.<p>2) Why is the build tool not a separate project? While the framework looks useful, I don&#x27;t want to switch to a new toolchain to be able to use it. Many people already have some preferred way of building their apps, be it Grunt, GNU Make, r.js optimizer, a combination of those or something different. A specialized build tool can add value to the framework (e.g. sensible defaults), but IMHO the framework should no have a lock-in to any particular build tool. Provide the build tool as a separate project, but let people also use whatever they like. This is the beauty of using standardized module systems such as AMD.<p>EDIT: Looks like you answered my first question in another thread, while I was writing this and Backbone core not being modular is a good argument to break apart from it. The second question still is open, though. Why not take modularity even further and separate the framework and build tool?
评论 #6580645 未加载
评论 #6580570 未加载
评论 #6580569 未加载
jonahxover 11 years ago
As with most new js frameworks, the first thing I&#x27;d like to see in the docs is a comparison with similar popular frameworks, and a brief description of what makes this one different and better.
评论 #6580016 未加载
jcutrellover 11 years ago
Seems like this page could definitely benefit from some sort of Hello World. What are the primary components, and how do I run it? Perhaps it&#x27;s not meant to be a simple library, so I&#x27;m not trying to say dumb it down. But is there a more digestible way to understand hr.js without having to read the full documentation?<p>I&#x27;d love to see comparisons (as said in another comment). I like the idea of a grown-up Backbone. I&#x27;d like to see if there are any smart view rendering optimizations (like Ember has).
评论 #6580442 未加载
nilgradisnikover 11 years ago
This seems like a step in the right direction to me.<p>I was wondering about the flexibility of templating engine and CSS preprocessing. It seems like hr.js is using it&#x27;s own templating engine, which is ok and also LESS as a CSS preprocessor.<p>Is there a way to use something like Handlebars, ejs,... or maybe switch to Stylus or SASS? (is it just a matter or defining a css compiler in the build configuration)<p>Great work, keep it up.
评论 #6580949 未加载
calebgilbertover 11 years ago
This looks really awesome - like a fully grown up Backbone.js! The nested&#x2F;complex modeling, thoughtful subview handling, and ability to use backends other than rails&#x2F;rest pretty much solves some of the biggest complaints against Backbone, while keeping the good parts. (Not to mention the other considerable niceties hr.js lists)<p>I may actually give this a shot for a project of mine.
评论 #6580365 未加载
k3nover 11 years ago
How is it going to scale, since it&#x27;s using package-by-layer (as opposed to package-by-feature[1])? Most systems like that become highly annoying to work in with even a moderate amount of complexity.<p>1. <a href="http://www.javapractices.com/topic/TopicAction.do?Id=205" rel="nofollow">http:&#x2F;&#x2F;www.javapractices.com&#x2F;topic&#x2F;TopicAction.do?Id=205</a>
lobster_johnsonover 11 years ago
Looks very interesting.<p>The only thing I couldn&#x27;t find in the introduction was how hr.js interfaces with a backend for loading and storing models. Care to explain? One of my complaints against Backbone was that it tightly coupled models&#x2F;collections to REST resources, which yoru framework seems not to do, and that&#x27;s obviously a good thing.
logical42over 11 years ago
Of the number of comparisons drawn here, I&#x27;m rather surprised that this hasn&#x27;t been compared to ember.