by acemarke · 8y ago · 0 comments
I'm a Redux maintainer. I'm really excited about the changes in this release. They're primarily internal, but it should help React-Redux work a lot better with React's changes down the road.
In case anyone's wondering, this _should_ be a drop-in release for most users. Just bump your package version and update. If you do run into any problems, please file an issue!
I recently wrote a blog post that goes into more details on how the implementation has evolved over time, and why we changed several aspects of behavior for this release:
https://blog.isquaredsoftware.com/2018/11/react-redux-histor...
If anyone's got questions, ask away!
The big blocker for us shipping a `useRedux()` hook is that there's currently no way for a function component to bail out of re-rendering once it starts, and calling `useContext()` subscribes that function component to _any_ update of the context value. The React team has an issue tracking that (https://github.com/facebook/react/issues/14110 ), and as far as I know that's something they intend to include before 16.7 goes final.
Once that's available, we can look at implementing an official `useRedux()` hook, and ship it in a future release.
That same release would likely also rewrite the guts of `connect` to actually use hooks internally as well. I already threw together a proof-of-concept PR that does this (https://github.com/reduxjs/react-redux/pull/1065 ).
No specific timeline for that, largely because Suspense itself is still very much in development. The React team recently published a roadmap for features like Hooks and Suspense [0], and the data fetching aspects aren't expected until sometime next year. So, there's not a lot we can do on our end until there's a lot more clarity on how to actually work with this stuff in React itself.
Having said that, I don't immediately see anything that would prevent us from having a React Suspense cache that is backed by a Redux store. I've seen a couple people playing around with hacky prototypes that look intriguing.
There's some other concerns we'll need to figure out around React's upcoming "Concurrent" rendering capabilities as well. I wrote up some thoughts in a Reddit comment recently [1].
[0] https://reactjs.org/blog/2018/11/27/react-16-roadmap.html
[1] https://www.reddit.com/r/reactjs/comments/9xnvs2/how_does_co...
I have nothing against the package but is this the norm for package development these days to treat people like testers?
They're saying, "we've tested this to work without any code changes, but since we're not Gods there might be some edge case we missed. In that case, please let us know so we can fix it for you and everyone else who might have the same issue."
We published beta releases and asked for feedback [1]. I honestly would really have liked more actual responses, but at this point we have no indication that there are any issues beyond what's expected from the known published breaking changes. At some point, you just gotta ship it :)
In the real world, people always use software in ways that you didn't anticipate. I'm pretty confident in the quality of this release, but I'm also realistic and know that it's quite possible there's some edge case that we weren't aware of. So, I'm just saying that if anyone sees issues, we'd like to know about them.
[0] https://github.com/reduxjs/react-redux/tree/9d50c2bd57642477...