Live data from Hacker News

Riot – A React-like, 2.5K user interface library

muut.com

111–120 of 222 posts

Re: Riot – A React-like, 2.5K user interface library

#111

After using ember's router and react-router, I can't do client side routing with a router like this (or backbone's, or anything that is sinatra like). The layout management part of nested routes is crucial and way too hard to do with something as minimal as this. That said, great work on this library! I'm impressed with how much functionality you guys have in such a small package.

Which (if any) client side router library do you prefer then?

react-router, I assume.

See more on nesting: https://github.com/rackt/react-router/blob/master/docs/guide...

Re: Riot – A React-like, 2.5K user interface library

#112
post #110

One thing I like React is it is plain javascript. Therefore I can use coffeescript to describe the component: {div, p, ul, li} = React.DOM ... render: -> div className: 'foo', p className: 'bar', 'blabla' p className: 'bar', 'blabla' ul className: 'somelist', @state.items.map (x) -> li key: x.id, x.content If Riot.js uses a custom parser, it may not be able to do this.

The above is not possible with Riot.

Re: Riot – A React-like, 2.5K user interface library

#114

Hm. How does this compare to Mithril JS ( http://lhorie.github.io/mithril/ )? I just looked at the doc and read this thread (at 61 comments). Same: * virtual dom * has its own tag syntax * Mithril has MSX, but also supports regular JS data structure with m("tag", {attr:val, onclick: func, [more tags, "text"]} * router Different: * Where Mithril allows you to build and transform resulting template structure before vir…

Hi, Mithril author here.

A few important differences as far as I can tell:

- Riot apparently requires a compile step (at least as far as being able to follow the docs goes), Mithril doesn't

- Riot has no AJAX support, Mithril does (plus promises, plus an idiomatic workflow to work with async ajaxy stuff: `var prop = m.request(...)`)

- I could not find anything about keys in the Riot docs. Keys are a very important part of the virtual dom diff algorithm (basically it's the mechanism that lets you sort tables without rebuilding the whole thing from scratch)

- Riot's router appears to support only hash mode. Mithril's also supports HTML5 mode (which allows you to skip the # symbol), and a querystring mode that is step in between the two in terms of tradeoffs.

- Both Riot and Mithril redraw by default on events, but Riot appears to lack APIs to control when NOT to redraw. This is kind of a big deal with cases like expensive oninput, complex event bubbling behavior, etc.

Other than that, I just have a small nitpick:

> Riot mixes HTML tags and JS, builds tags from that which can be composed

As far as I can tell, Riot components can be nested, but I'm not sure they can be composed per se. Real composition would allow you, for example, to have lazy components (i.e. pass a component A to another component B and evaluate A at a specific point in B's virtual dom tree). A modal is an example of this.

> RiotJS' size and web component approach intrigue me

Mithril supports the `is` attribute, and I saw someone using custom elements with a polyfill ( https://github.com/WebReflection/document-register-element ) and Mithril. It's basically "Web components, the good parts". Worth looking into.

Re: Riot – A React-like, 2.5K user interface library

#118
post #114

Hm. How does this compare to Mithril JS ( http://lhorie.github.io/mithril/ )? I just looked at the doc and read this thread (at 61 comments). Same: * virtual dom * has its own tag syntax * Mithril has MSX, but also supports regular JS data structure with m("tag", {attr:val, onclick: func, [more tags, "text"]} * router Different: * Where Mithril allows you to build and transform resulting template structure before vir…

Hi, Mithril author here. A few important differences as far as I can tell: - Riot apparently requires a compile step (at least as far as being able to follow the docs goes), Mithril doesn't - Riot has no AJAX support, Mithril does (plus promises, plus an idiomatic workflow to work with async ajaxy stuff: `var prop = m.request(...)`) - I could not find anything about keys in the Riot docs. Keys are a very important pa…

riot.mountTo() lets you "lazily" render a tag on a specific node.

Thanks for the analysis.

Re: Riot – A React-like, 2.5K user interface library

#120

One of the biggest selling points for React/Flux for me was the fact that it had been proven by Facebook and Instagram on some very large projects. What has this been used on?

And? Instagram's web app is still kinda crappy.

Dojo has also been used on a bunch of huge projects, but nobody gets excited about it...

Post reply on HN