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.

Rivets.js - Binding data to views

69 pointsby ansmanalmost 13 years ago

14 comments

joshonthewebalmost 13 years ago
I've never been able to get behind defining data relationships in the DOM. I do like the idea of not having to re-render the entire view or explicitly update individual elements on data change events, but i wish there was a better way. Perhaps a view could contain a hash associating data change events with element selectors. Then the view knows which element to update. That way the html clean and ignorant of the underpinnings of the app.
评论 #4212412 未加载
评论 #4212366 未加载
lylejohnsonalmost 13 years ago
Why would I choose Rivets over competing options, such as Knockout?
评论 #4211925 未加载
jashkenasalmost 13 years ago
Take a peek at the implementation if you haven't already -- it's easy to browse through in a minute or two:<p><a href="https://github.com/mikeric/rivets/blob/master/src/rivets.coffee" rel="nofollow">https://github.com/mikeric/rivets/blob/master/src/rivets.cof...</a><p>... although one thing to note is that it looks like it doesn't currently support IE (&#60; 9).
nateabelealmost 13 years ago
How is this different from/better than Angular?
pantsbirdalmost 13 years ago
Every time we move away from this ugly logic embedded in the view idea some Rube Goldberg fan (probably with a java struts or other such messy room coding) stacks this stuff back into the world. The fact of the matter is program problems are never difficult enough to merit this kind of abstraction and if in some future where this is necessary it certainly won't be this version or in this syntax.<p>To summarize; Not only do I think this is excessive beyond MVC, but it is also jumping the gun by a decade minimum. I don't need smarty templates, I don't need overloaded HTML attributes and I don't need this. Good day to you.
评论 #4214181 未加载
jarek-foksaalmost 13 years ago
It would be great if we could just have Object.watch('property', callback) or similar method defined in ES.next.<p>I don't want to wrap my models with ugly frameworks, all I need is a way to fire a callback when my model changes.<p>There is a lot of talk on various MVC frameworks, but lets not forget that manual syncing of views and models has some advantages, e.g. you can improve performance by combining many subsequent DOM operations or by temporarily detaching the parent from DOM tree.
nestlequ1kalmost 13 years ago
Looks like a pretty nice little alternative to Handlebars/Ember.js for really simple data bindings. I could see myself using this quite often.
netghostalmost 13 years ago
Neat idea, I like that it's agnostic about the model layer. I have to admit that I'm fiddling around with a very similar library (still a work in progress):<p><a href="https://adamsanderson.github.com/ivy/" rel="nofollow">https://adamsanderson.github.com/ivy/</a><p>Lots of people are looking for better ways to deal with data in their views :)
zimbatmalmost 13 years ago
After a quick glance it seems that it doesn't support iterations. How would you use it with a list of users ?
评论 #4212135 未加载
1qaz2wsx3edcalmost 13 years ago
This is most similar to AngularJS. `data-hide` &#60;=&#62; `ng-hide`
swahalmost 13 years ago
How do you work when you have two or more of those depending on each other?<p>Also, when a data value changes do you re-render the whole thing, of just the affected node?
评论 #4212154 未加载
bdfh42almost 13 years ago
lots of knowledgeable comments being made here already so clearly this is an interesting area but - what is the use case for this? I don't understand why I might need it.
评论 #4212068 未加载
arunodaalmost 13 years ago
Great idea. I like it. I'm looking at this as a template engine? Or am I missing something?
评论 #4214176 未加载
arunodaalmost 13 years ago
Can you please describe what is the use of the adapter? How can it be useful?