Live data from Hacker News

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

muut.com

41–50 of 222 posts

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

#41
post #24
post #22

One of React's selling points is that it uses a virtual DOM to minimize the amount of manipulations it does to the real DOM - http://facebook.github.io/react/docs/reconciliation.html . The virtual DOM is an implementation detail (riot could re-render everything on each change), but it's what makes React fast, and good for handling big apps. I don't think you can call a lib "react-like" if it doesn't have something li…

It’s advertised as having a Virtual DOM.

You are right, I will have to investigate more. I don't know how much of react's virtual dom diff can you cram in 2.5kb though :)

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

#42
post #38
post #22

One of React's selling points is that it uses a virtual DOM to minimize the amount of manipulations it does to the real DOM - http://facebook.github.io/react/docs/reconciliation.html . The virtual DOM is an implementation detail (riot could re-render everything on each change), but it's what makes React fast, and good for handling big apps. I don't think you can call a lib "react-like" if it doesn't have something li…

> I don't think you can call a lib "react-like" if it doesn't have something like the virtual dom diff. You could say it has react-like syntax, maybe. Sorry, I don't follow. The Riot.js project site DOES tout "Virtual DOM" as one of its features. You say it doesn't actually have that?

I somehow missed that (quite incredible, being one of the main subsections), and I simply assumed that you can't cram something like that in 2.5kb - I apologize.

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

#43
post #41
post #24

Earlier quoted context omitted.

It’s advertised as having a Virtual DOM.

You are right, I will have to investigate more. I don't know how much of react's virtual dom diff can you cram in 2.5kb though :)

Not much. The point is that such heavy diffing can be avoided if loops and conditionals are enough and if you don't need random HTML changes.

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

#46
post #41
post #24

Earlier quoted context omitted.

It’s advertised as having a Virtual DOM.

You are right, I will have to investigate more. I don't know how much of react's virtual dom diff can you cram in 2.5kb though :)

As a point of reference, virtual-dom is 17k when minified with the same settings and 5.8k when gzipped.

That's starting from the 42k 1.2.0 distfile.

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

#47
post #11

Does this support nesting custom tags? How do I communicate between different tags? Is the opts variable accessible outside the definition of the tag?

Unlimited nesting is supported. You pass options with HTML attributes: this.data = { foo: 'bar' }

Is that only when defining a custom tag, or when using it as well? All the examples seems to be of nesting when defining a custom tag. If it supports it when using the tag, how do you get access to the nested content?

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

#48
post #41

Earlier quoted context omitted.

You are right, I will have to investigate more. I don't know how much of react's virtual dom diff can you cram in 2.5kb though :)

Not much. The point is that such heavy diffing can be avoided if loops and conditionals are enough and if you don't need random HTML changes.

[deleted]
Post reply on HN