Live data from Hacker News

Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

github.com

11–20 of 42 posts

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#11
post #7

I'm re-learning Redux now, does anyone else think that it might be overkill for an app that doesn't require any user input?

My suggestion is to not use until you need it, at which point it's easy to add. I find that most apps that I write benefit from it, but there's no point in using it if your use case doesn't need it.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#12
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

MobX is quite popular, and I wouldn't call it a variant of redux. Also, just storing state in your higher level components can work for much more complicated apps than many think.

I've done the latter and even though it's possible, it gets tedious/unproductive pretty quickly.

To elaborate: in 'response' to the webdev tendency I have to use the latest and greatest, and the HN articles about this phenomenon, I've done a few React projects with a conservative mindset.

React-router I don't miss too much for much of it. I could also do without a bunch of ES6/7 features, TypeScript, and so on. But with each of these projects I wish I'd used Redux, MobX, Baobab, and so on instead of the 'vanilla' approach of keeping state in my higher level components.

tl;dr: if you're gonna be conservative, leave state management as the last thing you 'conserve' on.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#13
post #6
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

I've been using baobab[1] which is: > a JavaScript persistent and immutable (at least by default) data tree supporting cursors and enabling developers to easily navigate and monitor nested data through events. It's a fairly simple library to read and understand and it's well written. I have a couple decent sized SPAs working on top of it, and I store the full data tree using localForage for offline use. 1: https://gi…

I've had good experiences with Baobab. The main reason I lean toward Redux is that I want my clients' product to be as 'standardized' as possible. While this is difficult in the JS world, React and Redux fit the bill (or are close to it).

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#14
post #7

I'm re-learning Redux now, does anyone else think that it might be overkill for an app that doesn't require any user input?

Quite possibly, and it's always a good exercise (and in this case justifiable) to do it the 'vanilla way'.

That said, even for relatively simple, non-input type projects I've found that Redux is worth it. I got thoroughly sick of passing props down multiple levels.

Furthermore, I found that I often ended up making mistakes where my components were too reliant on their context (even when considering variable/prop naming). Redux, I feel, extends the 'pit of success' effect that React has; when I use it I'm more likely to properly isolate components.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#15
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

Use Mobx if you're one of these people who like doing less work and writing less code to achieve the same end result as Redux.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#16
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

I'm doing well with storing state in multiple nested components, each state in the component it "belongs" to.

This approach matches well with GraphQL (without Relay -- but with Relay I imagine it would fit even better).

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#17
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

You might not need Redux, written by the author of Redux: https://medium.com/@dan_abramov/you-might-not-need-redux-be4...

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#18
Neat example of the kinds of things that Redux helps make possible (or at least more feasible).

If anyone is interested in learning Redux, I keep a big list of links to high-quality tutorials and articles on React, Redux, and related topics, at https://github.com/markerikson/react-redux-links . Specifically intended to be a great starting point for anyone trying to learn the ecosystem, as well as a solid source of good info on more advanced topics.

I also maintain a catalog of Redux-related addons and utilities at https://github.com/markerikson/redux-ecosystem-links , which lists things like middleware, store persistence management, pre-built logic for managing collections of data, logging/linting devtools, and much more.

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#19
This looks pretty solid, and the ability to create our own resolvers makes things much more flexible.

Currently creating a cross-platform react native app using realm.io for persistence. While it's is great, the debugging performance is slow (rerouted RPC calls) and it has a few quirks (each model is a proxy, odd optional field support, poor error messages when data is erroneous).

The benefits of this seem to be:

1. Pre-created retry logic, optimistic update logic

2. Less effort to save data to realm

3. Less effort to load data from realm on app reloads

4. Potentially shared actions across our apps/web projects, as there's no realm specific abstraction in our apps.

Gonna have a look at implementing this one day soon to compare and learn :)

Re: Show HN: Redux Offline – Build Offline-First Apps for Web and React Native

#20
post #2

Slightly off topic, but how do people manage state that aren't using Redux? When you google "redux alternatives", you typically get results for different flavors or variants of redux. But are there other fundamentally different paradigms for managing state? I love Redux, but I'm really curious what else is out. Also, the optimistic updates with rollbacks in this implementation is pretty neat.

Flux is a standard idea in the React world... I don't know that there are any "fundamentally different paradigms" for managing state in React.

Before Redux came out, I built my own state management system around Backbone. I recommend using Redux.

Post reply on HN