app.co icon indicating copy to clipboard operation
app.co copied to clipboard

Replace redux-localstorage with redux-persist

Open aulneau opened this issue 6 years ago • 6 comments

Since we're in an SSR environment, using redux-localstorage isn't the best as localstorage is only available on the client. redux-persist has a cookie storage driver which we can use on the client and the server.

see -> https://github.com/rt2zz/redux-persist

aulneau avatar Aug 13 '18 13:08 aulneau

@aulneau What's the resulting enhancement in the user's experience as the result of this? Or otherwise what's the rationale for making the change?

markmhendrickson avatar Sep 06 '18 12:09 markmhendrickson

@markmhx the rationale is that we're caching data from our redux store to localstorage, but because our application is server rendered, it can't access data in localstorage because it's not available in node (the server). The data we're saving is mostly related to the admin panel, so the user's we'd be working for are administrators. Things that would be improved would be no more loading states, (or less, as the data would be accessible on the server). Also the application errors when we use the package we are (redux-localstorage) and causes intermittent errors for certain users and not for others, eg I cannot actively work on the application without disabling the import and then re adding it before I commit a change.

aulneau avatar Sep 06 '18 13:09 aulneau

without disabling the import

Which import is this?

It seems then this is ultimately worth doing if we feel the pain point for administrators is high enough. And loading states for admins feel worth tolerating to me, at least until we have to do a ton of regular admin work.

If you're eager to make this switch and it's not a big time sink, then I'm happy to tackle it. But if it's a significant investment, I'd recommend we wait on it until the results are clearly needed.

markmhendrickson avatar Sep 06 '18 14:09 markmhendrickson

Oops, premature close =)

markmhendrickson avatar Sep 06 '18 14:09 markmhendrickson

Right now our admin panels use some components from AtlasKit that aren't compatible with SSR, so we'd actually need to take those out before even being able to do SSR in admin. Which I am definitely interested in doing, because they aren't necessary, and actually add a lot to our page load size (even outside of admin!). For now, this is more of just a developer experience issue, because it definitely must be annoying for Thomas to have to disable it (still not exactly sure why it doesn't work for him shrug).

Whenever we add user authentication for makers / end users, this issue will become a definite necessity.

hstove avatar Sep 06 '18 15:09 hstove

@aulneau you cool with us sitting on this until we do user auth? If so, I may move it to this project, which is predicated on the ability for users to auth: https://github.com/blockstack/app.co/projects/11

markmhendrickson avatar Sep 07 '18 09:09 markmhendrickson