Live data from Hacker News

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

muut.com

181–190 of 222 posts

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

#181

I just wish there was a way to fast forward 2 years into a 10k LOC project to find out what new problems this creates. After running after the new hotness in technology for the last 5 years, I've realised it's never about the problems it solves today. It's the shit that you have to maintain a couple of years down the line. (Not saying that this is bad -- just a random rant)

Nanda? Haha funny to run into you here. Kaisa chal raha hai?

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

#182
post #69

Earlier quoted context omitted.

I haven't used React in about 6 months, but I'm pretty certain the Riot code does the exact same thing. If you haven't used React, it has JSX as syntactic sugar for what would otherwise be a bunch of javascript: see the "render" function in createClass. So a component is written in JS. With Riot, the JS goes into the template to create a component. There's a lot of things to like about React, but it requires some boi…

> If you want something that keeps the HTML and JS separate ... I guess my JS knowledge is small enough that I just expect the HTML and JS to be primarily separated. (It seems like a best practice to me, but I haven't experimented with code that wasn't primarily separated, so I'm sure I'm missing some important insights). Thank you for making the knockoutjs.com recommendation. For someone, with primarily Angular expe…

I believe that React would offer you a very different perspective. It also has a strong developer community; React is already being used in a lot of places (although Azure's management interface was just recently redone using Knockout). I've also heard that you can combine React and Angular.

Reading this will take a bit of time, but it will help you to understand React's approach: http://jlongster.com/Removing-User-Interface-Complexity,-or-...

After this, the React tutorial should get you up and going. Once you start working on more complex apps, look into the Flux architecture (an approach to application structure that Facebook uses with React, like you'd use MVC/MVVM/etc otherwise).

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

#183
This bears no resemblance to react whatsoever. By taking out the render, getInitialState, componentWillMount and other lifecycle methods Riot.js completely misses the ideology behind react and becomes just another templating library. Waste of time, anyone reading this should stick with React.

Not to mention we've moved past code tags like "each={ item, i in items }".

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

#185
post #166
post #114

Earlier quoted context omitted.

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…

Thanks for the comparison. If you look in the demo code, you'll see you don't necessarily need the compile step, just write your custom tags with riot.tag and use strings for the would-be compiled part.

Should then be trivial to whip up a require.js plugin that leverages riot.tag for working on-the-fly in development, but which compiles during a build/optimize process.

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

#186
post #134

Earlier quoted context omitted.

Not sure but this might indeed fail. Can you place an issue to github? Thanks! Maybe it's good to split HTML and JS with the last HTML tag.

Idea: require a tag around the JS in the template (but just for your parser's benefit, not as a tag you intend to embed literally in the rendered DOM -- you can remove it at parse time as necessary). This has the nice side benefit that it will make editors happy. (E.g. emacs recognizes tags within HTML and does JS highlighting/indenting on their content.)

Agree, removing the need for any special editor support would be great, even if offered as a compiler option. Makes the detection of JS a non-issue too.

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

#188

Earlier quoted context omitted.

Not sure but this might indeed fail. Can you place an issue to github? Thanks! Maybe it's good to split HTML and JS with the last HTML tag.

The compiler also fails if a multi-line comment doesn't end at the end of a line. and more text It outputs an empty compiled file. My honest opinion is that you should consider rewriting the compiler in a classic tokenize-parse-compile style. Several projects (like mustache.js) have had to go through this evolution. Your current solution -- line-by-line with regexes and state flags -- will only get hairier and hairie…

I'm aware of this. Just wanting to avoid going there at this point and hoping that a smaller regex- based thing can do it.

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

#189
post #134

Earlier quoted context omitted.

Not sure but this might indeed fail. Can you place an issue to github? Thanks! Maybe it's good to split HTML and JS with the last HTML tag.

Idea: require a tag around the JS in the template (but just for your parser's benefit, not as a tag you intend to embed literally in the rendered DOM -- you can remove it at parse time as necessary). This has the nice side benefit that it will make editors happy. (E.g. emacs recognizes tags within HTML and does JS highlighting/indenting on their content.)

I can clearly see the benefits here. I'm also resistant to it because of the added syntax. Deciding later :)

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

#190

This bears no resemblance to react whatsoever. By taking out the render, getInitialState, componentWillMount and other lifecycle methods Riot.js completely misses the ideology behind react and becomes just another templating library. Waste of time, anyone reading this should stick with React. Not to mention we've moved past code tags like "each={ item, i in items }".

Glad you like React so much!

Maybe have another look for Riot on a later time and you can perhaps see the reason for it to exist.

Post reply on HN