bjoluc / next-redux-cookie-wrapper

Sync a subset of your Redux state with cookies in Next.js :cookie: :sparkles:
MIT License
114 stars 4 forks source link

Any plans on updating this library to newest wrapper version? #13

Closed MaciejWiatr closed 3 years ago

MaciejWiatr commented 3 years ago

Hello, i really love this library however it's becoming more and more outdated. Do you plan to port it to the newest wrapper version?

bjoluc commented 3 years ago

Hi, glad to hear you're still interested; I absolutely do have plans and am currently working on a full rewrite! Unfortunately, I didn't manage to finish it in the semester break which is why it might still take a few month in the worst case (hopefully not). Here are my plans:

What do you think; any mistakes in my assumptions? If you find something odd or know better alternatives, please let me know! :)

VictorPulzz commented 3 years ago

@bjoluc Thank you for job! One small question, How will you organize the nested persist reducers. I mean the following: let's say we have a store with nested data:

root: {
  user,
  messages
  ... etc
}

Let's say for a user I store data in a cookie. I messages I store localStorage. How can I pass this nesting?

bjoluc commented 3 years ago

@VictorPullzz Hey! Well, currently you should be able to use something like

persistConfig: {
    whitelist: ["root.user"],
},

when you call withReduxCookiePersist. I did never try the current version of next-redux-cookie-wrapper alongside a plain redux-persist setup though, nor do I expect that to work. In the next version, however, this should work without any problems since redux-persist is off the next-redux-cookie-wrapper dependencies then. I guess we'll have something like a subtrees config option then where you can add "root.user" to be synced with cookies.

VictorPulzz commented 3 years ago

@VictorPullzz Hey! Well, currently you should be able to use something like

persistConfig: {
    whitelist: ["root.user"],
},

when you call withReduxCookiePersist. I did never try the current version of next-redux-cookie-wrapper alongside a plain redux-persist setup though, nor do I expect that to work. In the next version, however, this should work without any problems since redux-persist is off the next-redux-cookie-wrapper dependencies then. I guess we'll have something like a subtrees config option then where you can add "root.user" to be synced with cookies.

Thanks for answer! I hope that you will be able to upgrade to the new version of next-redux-wrapper :) I'm currently trying to connect your plugin and next-redux-wrapper v6, but so far there is little progress :D

github-actions[bot] commented 3 years ago

:tada: This issue has been resolved in version 2.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: