Hacker News new | comments | show | ask | jobs | submit login
Why does React.js truf other innovations like Cycle.js?
6 points by stardrive on July 26, 2015 | hide | past | web | favorite | 9 comments
I'm surprised to read the following tweet, made yesterday by Sebastian Markbåge of the React team.

"React tried and abandoned the Observable tree approach that @andrestaltz is using but but try out http://cycle.js.org/ incase we're wrong."

I agree Cycle.js is fully reactive while React.js is only partially reactive in it's state render function. Something that is missing in React.js is robust interaction and event handling. Both the front/data and back/event side of a app should be reactive and I think Cycle.js is just using Rx to show the way.

More React.js developers have seen the light of Rx recently so how can Rx be argued with? Maybe its just the MVI Framework that React.js does not like? Certainly Cycle.js brings a different sort of observable tree into the arena, exposing a whole new level of interactive computing for web apps.

Looking at another statement made by Sebastian Markbåge on April 10th, he admits that a better React.js event strategy is required. I see Cycle.js contributing to this acknowledged gap.


What is the verdict?

From what I've gathered throughout discussions[1], React has seen some experiments with RxJS Observables (or something inspired by Observables), but they want to avoid the learning curve associated with reactive programming, keeping React beginner-friendly.

MVI architecture[2] in Cycle.js is derived from thinking about UIs holistically, and realizing how the user is connected to the application. The user gives events to the application, flowing through a thick layer of abstraction: from hardware (mouse) to operating system, to browser, to DOM, then finally to your application. Intent in MVI is another layer of abstraction between those user events and the program's state. The key here is to realize what is the source/owner of events: the actual human user. I think it makes no sense to think about events as owned by view components, it doesn't match reality. PS: MVI arch can be done with React as well, you can e.g. use document.querySelector().addEventListener() globally and remove events from components. This is how Cycle.js just leverages DOM events (and custom DOM events too).

React has tougher challenges though, since they want to contain both DOM and Native and whatnot event systems in the same abstraction.

[1] https://twitter.com/sebmarkbage/status/589966228938063873

[2] http://cycle.js.org/model-view-intent.html

Okay, that explains a lot. It is also ironic because React's rejection of FRP in its completeness has also spawned a very poor substitute they call Flux.

The number of Flux versions that have been churned out as a result is obscene. That is certainly not keeping it beginner-friendly, that is just leading developers astray.

While all the Flux activity may make it look like a lot is going on with React it has instead just wasted everyone's time and kept them from learning a key paradigm like FRP.

I'm not sure how Fiber Reinforced Plastic helps. Seriously, if you want to be understood, define acronyms.

If you want to walk on the wild side and get out of the framework cage and take a breath in fresh air then checkout the following:


Interesting to see what was meant to be the most glorious and final (to end all Flux wars) version of Flux get revamped with Rx:


LOL, to be even more correct, precise and specific the above should read front/event and back/data :)

WTH is "truf"?

Typo, meant to be turf, as in "React tried and abandoned..." or to toss aside without explaination. Title was getting long so turf had the edge to express the tweet.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact