
GraphQL/Relay Wins. Flux/Redux Considered Harmful - ilostmykeys
https://gist.github.com/idibidiart/04e4cf24e5d2c7aba92c
======
dustingetz
"Flux considered harmful" That is way too strong - GraphQL handles
server/client data sync, we still need a pattern for client/ui state, they are
mostly orthogonal concerns. UIs aren't stateless, there's more to it than just
transacting every state change directly to the server. It is a very narrow
class of UIs for which that could work.

~~~
hnbroseph
> UIs aren't stateless

i would agree that this is the traditional perspective.

i'm not convinced this is necessarily the case; there may be other ways to
look at it. it could be that the ui "value" is the output of a series of
functions, and that what might look like a "state" change is really a "new" ui
being rendered.

(maybe this is what "frp" gives us, or perhaps "immediate mode gui" that
sometimes pops up in game development circles; but i'm not very familiar with
either.)

~~~
dustingetz
It is always the case. Even if you model app state in a functional way, the
state is still _somewhere_ , for example a haskell program may be pure but
only because it pushed the unsafePerformIO call into the runtime. UIs _always_
have additonal state that is not modeled in the backend, we can only reduce
the surface area of code that is stateful, but we can't outright remove it, it
is essential complexity in all UIs.

------
aggronn
The title "GraphQL/Relay Wins. Flux/Redux Considered Harmful" is obviously
clickbait. Relay is clearly superior to Redux/Flux for data fetching and
object storage, and that isn't shocking to anyone who has looked into both of
them. But Relay isn't there yet (Relay is soon going to bring time travel, has
no way to manage local state, etc). With redux coming in at 2kb, there's no
reason no to use both relay & redux. This isn't about winning, and Redux is by
no means obsolete (yet).

------
smt88
Be forewarned: this is the definition of Giant Wall of Text.

Why on earth would someone write this in a Github gist? Just use one of the
billion blogging platforms out there or Github's own pages feature.

------
CuriouslyC
GraphQL is great if you are primarily producing native apps with multiple
versions coexisting simultaneously. For web applications, it is needlessly
verbose.

Relay sounds interesting. I expect that a lot of its good ideas will be
replicated by the community in more light-weight, less opinionated libraries.

