News for hackers. Stuff that matters.
Re:ReasonML – React as first intended by dmitriid on Thursday May 24, 2018 @10:59AM (#17144624)
I'm always confused by statements like "You don't need Redux, you have reducer components".

Reducer components don't solve the problem of a centralized/shared/common state and interactions between components.

Re:ReasonML – React as first intended by boyswan on Thursday May 24, 2018 @11:29AM (#17144958)
I thought this and was put off at first, but have come to the conclusion that you really don't need redux (I've used it thoroughly for years).

We've been converting a large JS react app to Reason, and strongly typed props solves a lot of problems. Passing props down multiple children is no longer a burden, and you'll never have that "prop spreading madness". For anything that reaaally requires some sort of global state, you can use the new react context api.

The only danger of writing in reasonml is spoiling javascript for yourself

Re:ReasonML – React as first intended by burger_moon on Thursday May 24, 2018 @12:02PM (#17145287)
>We've been converting a large JS react app to Reason

Is the process like say converting to using Flow where you can just add it in where you want and the application still runs fine, or by convert do you mean write a whole new application and when it's complete then launch?

Re:ReasonML – React as first intended by boyswan on Thursday May 24, 2018 @12:11PM (#17145392)
Similar to flow. JS interop is great, so you can literally change bit by bit and refactor from the inside out.
Re:ReasonML – React as first intended by cies on Thursday May 24, 2018 @11:58AM (#17145249)
> The only danger of writing in reasonml is spoiling javascript for yourself

Curing yourself :)

Re:ReasonML – React as first intended by alde on Thursday May 24, 2018 @11:35AM (#17145024)
I think this is a valid point. I can't imagine effectively managing side effects without global state like in Redux.
Re:ReasonML – React as first intended by yashafromrussia on Thursday May 24, 2018 @11:11AM (#17144759)
Exactly my thought. It seems to me that it's just internal component state.. not application state
Re:ReasonML – React as first intended by lilactown on Thursday May 24, 2018 @11:39AM (#17145059)
I think that Redux provides two things that people like:

1. A pattern to organize their state in that was testable and repeatable

2. A way to maintain global app state without prop drilling

I think that (1) is actually the reason that many people pick Redux in the first place. The amount of global, app-wide state in /most/ applications is fairly small IME. I think that the ReasonML team (which works semi-closely with the React team) is banking on things like Apollo, "suspense", the new context API and other things to further reduce the need for a global state store like Redux.

The ReasonReact devs are trying to follow the principal of least power in providing something that solves (1) for component-level state, which solves the 80%, and wait for the rest of the ecosystem to shake out for the rest.