Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
rich_harris
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
31 ms
·
271.
▲
by
rich_harris
13y ago
No, Mustache only I'm afraid. The reason is that it's not actually using Mustache or any of the Mustache-based engines (such as Hogan.js) - it's using its own implementation. That's because almost all other templating en
272.
▲
by
rich_harris
13y ago
You're right, all keypaths start from the root. One approach for large apps is to split the UI up into several Ractive instances (which might all be bound to a single global model, but 'start' at different keypaths). Array mo
273.
▲
by
rich_harris
13y ago
That's very odd - which version of FF are you using? From the error I'm guessing you saw this on the tutorial pages?
274.
▲
by
rich_harris
13y ago
It's definitely something I've thought about. There are a few reasons I still prefer ractive.set( keypath, value ), which I'll try and articulate: 1. It's explicit, and therefore more predictable. I get itchy when librar
275.
▲
by
rich_harris
13y ago
Absolutely! We're all standing on the shoulders of giants like Steve Sanderson (KO creator).
276.
▲
by
rich_harris
13y ago
Ractive has a concept of 'expressions' - tutorial here: http://learn.ractivejs.org/#!/expressions/1 Hard to explain concisely but it allows fairly complex updates to be expressed very efficiently - see t
277.
▲
by
rich_harris
13y ago
Ractive does have a way of including JavaScript evaluations in the template which as far as I'm aware is unique: http://learn.ractivejs.org/#!/expressions/1 The JavaScript expression is parsed into an AST, an
278.
▲
by
rich_harris
13y ago
Definitely no polling! Model changes are done explicitly with ractive.set() (or ractive.animate(), or array mutator methods). It uses a dependency tracking mechanism to update the view with the fewest calculations and DOM touches necessary.
279.
▲
by
rich_harris
13y ago
1. Thanks! 2. Not at all - animation is something I need in my day job all the time, and having .animate() saves me so much time. I wasn't sure if I'd get much use out of transitions (I was jealous of ng-animate and wanted to see
280.
▲
by
rich_harris
13y ago
At the moment, Ractive doesn't really have an opinion on the subject - it was initially developed with news interactives in mind, where very often there isn't a need to communicate to a backend. Backbone et al are better at handli
281.
▲
by
rich_harris
13y ago
Hi! Yes, I was excited when React came out because it demonstrated that I wasn't the only one who felt that these problems hadn't been fully solved yet (though a part of me thought 'well I may as well give up now...'), Y
282.
▲
by
rich_harris
13y ago
Data-binding is the most obvious feature of Ractive but there are others - easier event handling, transitions, animations, JavaScript-ish expressions within templates, server-side parsing and HTML rendering, and so on. On the other hand, Ri
283.
▲
by
rich_harris
13y ago
$scope.$apply is necessary because sometimes changes to the model happen outside Angular's event loop. Ractive doesn't have this issue because updates always happen explicitly with ractive.set( 'key', value ) (or with ar
284.
▲
by
rich_harris
13y ago
Basically, items in the parallel DOM register themselves as dependants of 'keypaths', so a {{user.name}} mustache depends on the value of user.name. If you do ractive.set( 'user', { name: 'Bob' }), Ractive scan
285.
▲
by
rich_harris
13y ago
Thanks. Performance-wise, I haven't tested Ractive and React against each other, but that would be a test worth doing. Ractive is definitely built with performance in mind - it uses dependency tracking to ensure that the DOM is only up
286.
▲
by
rich_harris
13y ago
Yes, that slide is still a bit of a work in progress. You can certainly use D3 (or any other library) alongside Ractive, though things could go awry if two libraries were trying to manipulate the same bit of the page at the same time - e.g.
287.
▲
by
rich_harris
13y ago
Indeed - as in 'interactive'. Got the name from Neal Stephenson's The Diamond Age, in case anyone wondered... Though it is also reactive, in the 'reactive programming' sense.
288.
▲
by
rich_harris
13y ago
Not at all, these discussions are useful. I think React and Ractive actually handle this in a similar way - Ractive maintains a 'parallel DOM' (which is basically the result of populating the parsed HTML template with data), and i
289.
▲
by
rich_harris
13y ago
Library author here - thanks! The interactive tutorials borrow very heavily from Knockout (in fact Knockout was a big source of inspiration all round). It was initially designed to scratch my own itch - I'm a newsroom developer at the
290.
▲
by
rich_harris
13y ago
Definitely. Ractive has superficial similarities to Angular (e.g. Mustache templates) but is probably closer to React in concept. Poking under the hood of React is high on my todo list. I'm interested to know what you mean by 'rem
291.
▲
by
rich_harris
13y ago
Library author here. Will try to answer any questions! Edit: Direct link to the project homepage http://ractivejs.org
292.
▲
by
rich_harris
14y ago
Plus with SVG you get Retina support for free.
293.
▲
by
rich_harris
15y ago
Useful to know, though this has been supported since Chrome 14 (the post was written in August last year). Does anyone know which other browsers support it? Can't find info on html5please.com or caniuse.com.