Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with React-Redux 6 #95

Closed
k1sul1 opened this issue Feb 5, 2019 · 5 comments
Closed

Incompatible with React-Redux 6 #95

k1sul1 opened this issue Feb 5, 2019 · 5 comments

Comments

@k1sul1
Copy link

k1sul1 commented Feb 5, 2019

We've found ourselves locked into using React-Redux 5, as that's a the peerDependency for Kea. I tried using React-Redux 6 without luck:

image

This (probably) means that new projects started with Kea won't work, and older ones can't be updated until this issue is resolved, if it ever is. I'd like to see it resolved, but I'm not expecting anyone to work for free.

@mariusandra
Copy link
Member

Hi @k1sul1 , thank you for bringing up the issue with react-redux version 5 being needed as a peer dependency. Now that version 6 is out, it should be updated. Feel free to submit a PR that changes the 5.x to >= 5 in package.json.

However, despite the peerDependencies warning, I'm myself using the latest version of kea right now with react-redux version 6.0.0 and have no issues. The stacktrace shows that kea seems to want to get data from the store that isn't yet in there. However without digging in to your code more, I can't guess why it doesn't fallback to the defaults. I'm still on react 16.5.2, if that is relevant in any way.

Also, I'd like to refute the label "abandonware". Kea is definitely alive. It's actively used in many projects and there is activity in this repository. PRs get merged, bugs get fixed and small features are added every now and then. The library is stable and does what it needs to do.

However, it would indeed be nice to have more time/resources to refactor the internals, develop a nice plugin system, add typescript support, improve logic store extendability, support react hooks, etc... all towards a big "1.0" push. All help is welcome!

@mariusandra
Copy link
Member

Version v0.28.7 of Kea will no longer show the peer dependency warning with React-Redux 6.

@k1sul1
Copy link
Author

k1sul1 commented Feb 8, 2019

Fair enough, just looked like a bit like it, there's some issues you haven't commented on. I'll accept your refutation, and removed that part of the issue.

The reason I tried to upgrade our SPA to react-redux 6 was to migrate from react-router-redux v5 alpha to connected-react-router, and after I did that, those kind of errors were present, and our application didn't even init.

It's fairly complex & big, so it's not easy to give a reproducible example, but your description

kea seems to want to get data from the store that isn't yet in there

is at least somewhat correct, when I added logging to pathSelector params, state seemed to be empty (can't recall if it was null or undefined, or an empty object). IIRC, the first two console.logs contained something but the third one didn't, and caused that error.

I can't share code from that SPA, but I've another project where I'm using it, which is also pretty much abandonware, haven't had time for it in months 😂

I updated react-redux to 6 there, and now I'm seeing this:

image

If you're interested to see why, I've pushed the latest code here: https://github.com/k1sul1/wp-libreformbuilder-js/tree/feature/first-class-nesting-support

@mariusandra
Copy link
Member

Could the issue here be that the project is still using react-router-redux and not connected-react-router? That's what the errors seem to indicate... and on my own project I also had to upgrade the react router redux bindings at the same time I migrated to v6 of react-redux.

@k1sul1
Copy link
Author

k1sul1 commented Feb 10, 2019

Could be. I'm not even sure why it's using react-router-redux & migrating it to connected-react-router takes more than the 5 minutes I had time for.

But I guess kea will work just fine with react-redux 6, after we've fixed the other problems.

I wish I had more time to look into this, but I've a presentation deadline coming up in 3 weeks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants