Choo: How does it compare to RiotJS?

Created on 14 Jul 2016  路  3Comments  路  Source: choojs/choo

Hi, loving the idea, considering using choo, but unsure how it compares to RiotJS. Maybe you can share your opinion...

Most helpful comment

I've never used riot, but just from looking at it, I see a few differences.

Riot allows custom XML-style elements (like <todo></todo>) and their own custom curly braces solution for intermingling JavaScript in templates. They do require a little bit of extra work to setup. Looks like one line of separate JS code per custom element. riot.mount('todo')
Choo templates are standard ES6 strings. View functions take the place of custom elements. There's currently no transform step that would associate <todo></todo> with a view function like todoView(state), so you just use the function directly in your template within the ${}.

It looks like Riot uses traditional Observables (event emitter wrappers around your plain object literals & arrays). Choo uses plain JS objects & arrays and would probably work better with "modern" Observables (RxJS-style), but again, I haven't used Riot, so I really don't know specifically.

Riot doesn't seem to enforce any specific architecture, but does claim the same flexibility as is allowed in Flux. This is probably related to Riot using traditional Observables, as it's pretty typical to register callbacks on event emitters. (callbacks and event emitters go together, after all)
Choo is based on the Elm architecture / Redux. You can check out these articles on the pros and cons of Redux vs Flux.

As a disclaimer, I'm new here. So if I'm off base on anything, then hopefully the community will help clarify. :)

All 3 comments

I've never used riot, but just from looking at it, I see a few differences.

Riot allows custom XML-style elements (like <todo></todo>) and their own custom curly braces solution for intermingling JavaScript in templates. They do require a little bit of extra work to setup. Looks like one line of separate JS code per custom element. riot.mount('todo')
Choo templates are standard ES6 strings. View functions take the place of custom elements. There's currently no transform step that would associate <todo></todo> with a view function like todoView(state), so you just use the function directly in your template within the ${}.

It looks like Riot uses traditional Observables (event emitter wrappers around your plain object literals & arrays). Choo uses plain JS objects & arrays and would probably work better with "modern" Observables (RxJS-style), but again, I haven't used Riot, so I really don't know specifically.

Riot doesn't seem to enforce any specific architecture, but does claim the same flexibility as is allowed in Flux. This is probably related to Riot using traditional Observables, as it's pretty typical to register callbacks on event emitters. (callbacks and event emitters go together, after all)
Choo is based on the Elm architecture / Redux. You can check out these articles on the pros and cons of Redux vs Flux.

As a disclaimer, I'm new here. So if I'm off base on anything, then hopefully the community will help clarify. :)

@yoshuawuyts feel free to close this and/or add an according section in the Readme.

haha, so I haven't tried Riot; remember seeing stuff I didn't like - don't feel I can quite say anything sensible about it hah - but yeah cool, I'll close this issue then (':

Was this page helpful?
0 / 5 - 0 ratings