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.

Ractive.js

264 pointsby dave1010ukalmost 12 years ago

26 comments

andrewvcalmost 12 years ago
Out of curiosity, where's the love for knockout? It's mature, and works well, but gets no press anymore.
评论 #6101028 未加载
评论 #6099869 未加载
评论 #6099161 未加载
评论 #6098428 未加载
评论 #6100351 未加载
评论 #6100554 未加载
评论 #6100858 未加载
skorealmost 12 years ago
Very interesting, but one thing Re: AngularJS<p>&gt; dependency injection minification headaches<p>Meh, that&#x27;s hand-wavy at best. The only thing you have to do to pass minification is to include the injected dependencies in an array like so:<p><pre><code> [&#x27;$stateProvider&#x27;, &#x27;$urlRouterProvider&#x27;, function ($stateProvider, $urlRouterProvider) { &#x2F;&#x2F; Stuff }] </code></pre> You get used to it in seconds and then it&#x27;s not really an issue anymore.
评论 #6101217 未加载
评论 #6097880 未加载
评论 #6099064 未加载
codereflectionalmost 12 years ago
Would be nice to see this up on <a href="http://todomvc.com/" rel="nofollow">http:&#x2F;&#x2F;todomvc.com&#x2F;</a>
评论 #6099976 未加载
nathansoboalmost 12 years ago
The examples for these kinds of frameworks always show you data binding for scalar values. That&#x27;s easy. What&#x27;s the story for more complex updates?
评论 #6100134 未加载
评论 #6099780 未加载
sambeaualmost 12 years ago
This is fascinating: I&#x27;ve been writing a very (and I mean <i>very</i>) similar library that also uses the concept of a Parallel DOM (dependents, views updating on a &#x27;data&#x27; property, nodes named by standard ids, all child nodes with IDs scanned for and bound to a property), I had just decided to create the concept of &#x27;Keypaths&#x27; as my events were clashing on ids.<p>The thing I have that I can&#x27;t see here is a selecting&#x2F;switching node: essentially a page or a tab that holds multiple states but only presents one at a time.<p>Thus makes me very happy and very sad: happy as I don&#x27;t have to write all things things now; sad becasue I don&#x27;t get to write all these things now.
评论 #6102177 未加载
jonahxalmost 12 years ago
Hi Rich,<p>This looks promising. Can you comment on similarities&#x2F;differences between Ractive and facebook&#x27;s React.js in terms of style and performance?<p>Also, looks like the github minified version is 72k, is that correct?
评论 #6097049 未加载
smagchalmost 12 years ago
Its naming is a bit conflicting to component&#x2F;reactive. The name &quot;reactive&quot; is so presumable that other people will choose in the future. <a href="https://github.com/component/reactive" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;component&#x2F;reactive</a><p>I haven&#x27;t looked into Rivet.js, component&#x2F;reactive or other equivalent library. I&#x27;m just planning to research which library is the best fit for me. I don&#x27;t really like full-stack framework like Angular. It was nice to know yet another candidate.<p>Does anyone know any other reactive template engine?
评论 #6097178 未加载
rubiquityalmost 12 years ago
So it&#x27;s data binding + templating? Why would I use this over something like Rivets.js?
评论 #6097252 未加载
bootheadalmost 12 years ago
Nice - looks very simple and lightweight! I especially like the effort put into the interactive tutorial documentation that these frameworks have. Angular and knockout both had stand out docs too!<p>Is there a particular niche for this framework would you say e.g. small, fast to market apps like news stories - or is is suitable for larger projects where you might normally reach for more of a &quot;framework&quot;?
评论 #6096879 未加载
评论 #6097089 未加载
xrdalmost 12 years ago
Can someone comment on where to find performance information on this framework? AngularJS has some very smart ideas that allow it to be magical and performant. This looks very cool, and I would like to make sure it is not just polling for changes. I&#x27;m suspicious because there is no $apply required. :)
评论 #6099735 未加载
mannixalmost 12 years ago
I have a question, since this has been bugging me with other js MV* frameworks lately... Is the set() method necessary for updating single attribute? All browsers have supported getter&#x2F;setter APIs (__defineGetter__ and Object.defineProperty), why not take advantage of them? Being able to say this would be cool:<p><pre><code> div.color = &#x27;blue&#x27;; </code></pre> instead of:<p><pre><code> div.set({ color: &#x27;blue&#x27; }); or div.set(&#x27;color&#x27;, &#x27;blue&#x27;); </code></pre> Or would this cause other problems that I&#x27;m not thinking of?<p>Edit: my ruby cap is on a little tight today. Javascript programmers might not expect extra logic to be run just by updating a property. I still think it would be cool though :)
评论 #6099429 未加载
评论 #6099848 未加载
评论 #6099438 未加载
评论 #6099101 未加载
评论 #6099046 未加载
Dekkualmost 12 years ago
Doesn&#x27;t seem to work in Firefox: &quot;TypeError: templateBlock.innerText is undefined&quot;
评论 #6099858 未加载
curveshipalmost 12 years ago
I like a lot of this, but one part I&#x27;m not so sure of is that, if I follow the docs, all get&#x2F;set operations need to be from the root of the model. They take a &quot;keypath&quot; that starts at root, like &quot;obj.get(&#x27;subObj1.subArray[3].prop&#x27;)&quot;. It seems to me like that would make it difficult to decompose a large application into component pieces. Your components, to do any get&#x2F;set operations, would need to know their path from root. And what if that path changes, like an array that&#x27;s modified? Seems like it could become a considerable barrier in mid-to-large applications.
评论 #6101584 未加载
scottmessingeralmost 12 years ago
I like it&#x27;s elegance, but it looks seems similar to using an Ember.js view and Handlebars templates. <a href="http://j.mp/reactiveinember" rel="nofollow">http:&#x2F;&#x2F;j.mp&#x2F;reactiveinember</a>
评论 #6102237 未加载
评论 #6098861 未加载
apidocalmost 12 years ago
Nice little library. I think i will have a close look and implement it into apiDoc (<a href="http://apidocjs.com" rel="nofollow">http:&#x2F;&#x2F;apidocjs.com</a>) Templates - for now i use crude jQuery events (quick &amp; dirty coded). With Ractive i think i can make the code cleaner and easier to modify.<p>At the moment i prefer Backbone in my other projects, but it is to &quot;heavy&quot; for a small single page (especially for users that did not know backbone and want to modify the templates).
boubiyeahalmost 12 years ago
Cool website and examples!<p>You should probably explain how ractive.js differentiates itself from knockout. It&#x27;s the direct competitor out there, not angularJS which is doing things very differently.<p>I glanced at the source and (correct me if I&#x27;m wrong) it seems array templating is done by simply comparing the length of the current and previous arrays? That&#x27;s naive and buggy?<p>Good luck
评论 #6112671 未加载
Narretzalmost 12 years ago
Sounds like a cool alternative to angularjs when you can&#x27;t use or don&#x27;t need a full-blown framework with routing, http layer etc.
评论 #6100407 未加载
modartsalmost 12 years ago
Can anyone comment on using Ractive as a replacement to Backbone.View? I&#x27;d think that making Ractive the view layer in a Backbone app would go a long way in augmenting a lot of the things that Backbone refuses to do in views (binding, smart DOM management&#x2F;manipulation, actual templating support)
评论 #6112689 未加载
d0malmost 12 years ago
I <i>really</i> like this library.. it&#x27;s been a while I&#x27;ve been looking for something similar. Angular was a bit &quot;too big&quot; for some of my projects, and backbone was just too verbose. Something like this will let me keep the code clean while still not getting involved in a big framework.
usethisalmost 12 years ago
@rich_harris:<p>1. Great library, thanks for contributing!<p>2. What was your motivation to add transitions and animations, isn&#x27;t that a bit out of scope?<p>3. I has no dependencies, why did you choose not to?
评论 #6097982 未加载
lekealmost 12 years ago
So as this is DOM manipulation, it&#x27;s a competitor to jQuery, right? If so, what are the advantages over jQuery, and would it make jQuery redundant now (for new projects)?
评论 #6102214 未加载
CoryG89almost 12 years ago
Is there anyway to use any other templating system with Ractive other than the Mustache style syntax? Couldn&#x27;t use microtemplates &#x2F; EJS style templating for example?
评论 #6101609 未加载
ghostdiveralmost 12 years ago
that is false statement actually<p><i>HTML is an amazing language for creating static documents, but it was never designed for interactive web apps</i>
oakazalmost 12 years ago
how would you compare it to github.com&#x2F;component&#x2F;reactive ?
alphonse23almost 12 years ago
another frontend framework for Dom manipulation, so would this be the 50th one out there on the web?
评论 #6098619 未加载
评论 #6098983 未加载
SkyMarshalalmost 12 years ago
It&#x27;s &quot;Ractive.js&quot;, not &quot;Reactive.js&quot;.
评论 #6096916 未加载