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?
Riot – A React-like, 2.5K user interface library
121–130 of 222 posts
Re: Riot – A React-like, 2.5K user interface library
#122One 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.
Re: Riot – A React-like, 2.5K user interface library
#123Question: do I read your compiler right, that any line starting with 'var', 'function' or 'this' is assumed to be javascript? So for instance: How will riot.js compile this line? would fail? [Don't mean to sound negative: I've been playing around with my own minimalist framework, so this is right up my alley. I'm reading the code to get a feel for how we've solved problems the same or differently, including the compi…
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.
Re: Riot – A React-like, 2.5K user interface library
#124Question: do I read your compiler right, that any line starting with 'var', 'function' or 'this' is assumed to be javascript? So for instance: How will riot.js compile this line? would fail? [Don't mean to sound negative: I've been playing around with my own minimalist framework, so this is right up my alley. I'm reading the code to get a feel for how we've solved problems the same or differently, including the compi…
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.
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 hairier.
Re: Riot – A React-like, 2.5K user interface library
#125Hm. 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…
Definitely some similarities exist like you listed. Riot offers following to the (massive) client-side table: 1. Custom tags (with unscary HTML + JS syntax) 2. Minimalism (both size and API surface) 3. Performance (minimizing DOM operations with virtual DOM) The 3rd item is not battle-tested / benchmarked yet and there is probably room for improvements.
Re: Riot – A React-like, 2.5K user interface library
#126One 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.
Re: Riot – A React-like, 2.5K user interface library
#127Great, another framework mixing concerns and doing custom HTML. What's wrong with React?
The point of React is to mix HTML and JS together. They deliberately mix templates with logic, which is actually the main inspiration for Riot. But we felt that what React does could be simplified. We didn't need full diffing and batching of HTML and we didn't like the verbosity on how components are created. minimalism is where Riot starts from.
In React, there are no "templates." There's just JavaScript, and then more JavaScript that looks kind of like HTML (JSX). But it's all still JavaScript.
Also, FWIW, I find that one of the largest benefits of React is to have the logic and the representation of the markup inline, together in the same file. It really helps productivity by eliminating the context switching going from js to markup.
> We didn't need full diffing and batching of HTML
^^^ That's the point of React. You don't have to do the diff in your head (or in your code).
Re: Riot – A React-like, 2.5K user interface library
#128I'm planning to evaluate integrating this for flow [1] I've already created a card for it [2]
[1] https://github.com/flow-stack/flow [2] https://trello.com/c/6gwqvq5l/91-riot-integration
Re: Riot – A React-like, 2.5K user interface library
#129One 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.
Re: Riot – A React-like, 2.5K user interface library
#130Question: do I read your compiler right, that any line starting with 'var', 'function' or 'this' is assumed to be javascript? So for instance: How will riot.js compile this line? would fail? [Don't mean to sound negative: I've been playing around with my own minimalist framework, so this is right up my alley. I'm reading the code to get a feel for how we've solved problems the same or differently, including the compi…
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.