Live data from Hacker News

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

github.com

31–40 of 42 posts

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

#31
post #27
post #24

Please note: This is certainly a very helpful library, but it's made to work with some kind of server/API. The defaults assume you get a connection again within one hour. Obviously, you can tweak the defaults. But if you want to build an app with its own real functionality that has sync added (like a TODO list that syncs with other devices) and is entirely offline-first where you can go weeks without a connection, yo…

Other than Couch/Pouch, are there any other projects providing solutions to this problem? The one thing I dislike about couchdb is the default "user-per-db" model. I'm interested in solutions that allow a traditional relational db instead of a key-value store. Seems like with indexeddb on the client, and postgres on the server, you could probably keep a segment synced.

Realm is awesome for this. It is not a relational database in the traditional (SQL) sense, but more of an object database that allows for relations between the objects. Their sync backend is pretty neat.

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

#32
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?

We're building a project management tool over at Braid [0] and it made a lot of sense for us. It saved us a lot of nasty prop-passing business.

What does your app do?

[0] - http://braidhq.com/

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

#33
post #31
post #27

Earlier quoted context omitted.

Other than Couch/Pouch, are there any other projects providing solutions to this problem? The one thing I dislike about couchdb is the default "user-per-db" model. I'm interested in solutions that allow a traditional relational db instead of a key-value store. Seems like with indexeddb on the client, and postgres on the server, you could probably keep a segment synced.

Realm is awesome for this. It is not a relational database in the traditional (SQL) sense, but more of an object database that allows for relations between the objects. Their sync backend is pretty neat.

Realm has no real support for web apps. It's for native platforms only. Dealbraker for me.

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

#34
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.

A huge, global, shared state makes it much harder to have an arbitrary number of a component, compared to each instance of the component holding its own state.

It's also a lot of boilerplate when you just want to add a simple toggle to some component.

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

#35
post #24

Please note: This is certainly a very helpful library, but it's made to work with some kind of server/API. The defaults assume you get a connection again within one hour. Obviously, you can tweak the defaults. But if you want to build an app with its own real functionality that has sync added (like a TODO list that syncs with other devices) and is entirely offline-first where you can go weeks without a connection, yo…

Hi! I'm the author of the library, and just wanted to say that you are absolutely correct about Redux Offline not being a suitable solution for weeks of active offline use :)

Regarding the "get a connection within one hour", that's only for automated, scheduled retries. When your app becomes online or is started up, no matter after how many hours or days have elapsed, we do continue retrying the messages unless you have a discard policy in place to remove them. The limited retry policy is related to not banging on a backend that is down or unreachable, etc.

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

#36
post #27
post #24

Please note: This is certainly a very helpful library, but it's made to work with some kind of server/API. The defaults assume you get a connection again within one hour. Obviously, you can tweak the defaults. But if you want to build an app with its own real functionality that has sync added (like a TODO list that syncs with other devices) and is entirely offline-first where you can go weeks without a connection, yo…

Other than Couch/Pouch, are there any other projects providing solutions to this problem? The one thing I dislike about couchdb is the default "user-per-db" model. I'm interested in solutions that allow a traditional relational db instead of a key-value store. Seems like with indexeddb on the client, and postgres on the server, you could probably keep a segment synced.

I haven't found one and I really wonder if everybody rolls their own sync solution.

> The one thing I dislike about couchdb is the default "user-per-db" model.

Why exactly? I think the overhead of the DBs is rather small. It's not like having a MySQL DB for every user ;)

Also, you can achieve something like "global data" as well: Either replicate from users' DBs to a shared DB or maybe make some kind of "system" user that has access to the users' DBs. I'm not an expert, but that's what I figured out so far with my limited experience.

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

#37
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.

Not a strict replacement, but I am really enjoying Elm.

The architecture is very similar - I think it was the inspiration behind Redux. You get to use a more succinct syntax and there is a compiler underneath it that supports the whole process. I have only recently started with it, bit I am finding the adage that 'if it compiles it will work' is proving remarkably accurate.

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

#38
post #27
post #24

Please note: This is certainly a very helpful library, but it's made to work with some kind of server/API. The defaults assume you get a connection again within one hour. Obviously, you can tweak the defaults. But if you want to build an app with its own real functionality that has sync added (like a TODO list that syncs with other devices) and is entirely offline-first where you can go weeks without a connection, yo…

Other than Couch/Pouch, are there any other projects providing solutions to this problem? The one thing I dislike about couchdb is the default "user-per-db" model. I'm interested in solutions that allow a traditional relational db instead of a key-value store. Seems like with indexeddb on the client, and postgres on the server, you could probably keep a segment synced.

Also not relational, but Meteor (MongoDB) with GroundDB for the client provides optimistic UI, offline persistence, and sync on reconnect. Unlike Couch / Puch, you can easily share a DB between users with authentication / authorization. Synced content can be controlled with subscriptions.

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

#39
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 also like Baobab. Way easier to debug when things go wrong and it works very reliably so you very rarely need to do that.

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

#40
post #26

Earlier quoted context omitted.

I've been using Mobx very successfully on many of my projects now (both React & React Native). I'll prefer Mobx any day over Redux, just due to it's sheer simplicity and ease of use. Read: No need to burden your brain with the cognitive load of actions, reducers, dispatching actions, selectors etc. Mobx v/s Redux does kick off the OOP v/s Functional debate, but as a developer my productivity and effectiveness is meas…

Do you pass the MobX stores down to every child component as props or do you use @inject? I started with the former but all of a sudden all my components had all these "default" props that cluttered things up. @inject seems great but the documentation doesn't push it enough to make me believe it's best practice.

I was using global stores but recently moved to @inject. I needed a way to reset my stores on logout. Hence now i create a root store and initialize rest of the stores.
Post reply on HN