10 ms·
React Redux 6.0 released
- acemarke 8y agoHah, beat me to posting this! 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-history-implementation/ https://blog.isquaredsoftware.com/2018/11/react-redux-histor... If anyone's got questions, ask away!
- revskill 8y agoWhen will Redux have its cache ?
- acemarke 8y agoI assume you're talking about in relation to React's upcoming "Suspense" capabilities? 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 https://reactjs.org/blog/2018/11/27/react-16-roadmap.html [1] https://www.reddit.com/r/reactjs/comments/9xnvs2/how_does_concurrent_react_update_priorities_work/e9toant/?context=3 https://www.reddit.com/r/reactjs/comments/9xnvs2/how_does_co...
- nothrows 8y agoI'm curious about the direction react redux will take with the new hook api. What will the react redux hooks will look like? Will that be something that lands soon in an alpha?
- tlrobinson 8y agoHere's the issue for hooks: https://github.com/reduxjs/react-redux/issues/1063 https://github.com/reduxjs/react-redux/issues/1063
- acemarke 8y agoYeah, @tlrobinson linked our issue discussing it. 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 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 https://github.com/reduxjs/react-redux/pull/1065 ).
- h1d 8y ago> Just bump your package version and update. If you do run into any problems, please file an issue! I have nothing against the package but is this the norm for package development these days to treat people like testers?
- seattle_spring 8y agoWow, way to assume the worst out of something that's obviously well intentioned. 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."
- acemarke 8y agoWe have an extensive unit test suite for React-Redux [0]. v6 passes that test suite, and the test suites for v5 and v6 are largely the same (minus tests that related to specific parts of the implementation, like the switch from old to new context). 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/9d50c2bd5764247710d37c1bfac8676f095421cf/test/components https://github.com/reduxjs/react-redux/tree/9d50c2bd57642477... [1] https://github.com/reduxjs/react-redux/issues/1083 https://github.com/reduxjs/react-redux/issues/1083
- cetra3 8y agoIt would be nice to see benchmarks between the versions. I am assuming that this should be faster since it uses react's "proper" API?
- acemarke 8y agoWe did do a lot of benchmarking during the development of v6, and have a standalone benchmarks repo that you can clone yourself [0]. Unfortunately, while I'd also hoped that v6 would be faster for the same reasons, it's a lot more complicated than that. I wrote about the performance implications of the changes specifically in my "implementation" blog post [1]. If you do see performance issues with v6 in your own production apps, please file an issue and let us know. [0] https://github.com/reduxjs/react-redux-benchmarks https://github.com/reduxjs/react-redux-benchmarks [1] https://blog.isquaredsoftware.com/2018/11/react-redux-history-implementation/#performance-implications https://blog.isquaredsoftware.com/2018/11/react-redux-histor...
- acemarke 8y agoSince it's a Redux-related thread, I'll toss out one other sub-thread to let people know what we're working on, and ask for feedback. We've already completely revamped the React-Redux docs [0]. They're now published as a separate site, and we're writing all-new content, like guides on how to best use `connect`. There's plenty more topics we plan to cover, but it's a big improvement already. Meanwhile, we're also working on a new build setup for the Redux core docs. Once that's ready, we'll turn our attention to actually revamping the actual Redux docs content and structure. (There's an existing issue if you'd like some info on some of the plans [1]). So, with that in mind, I'd specifically like to ask: - What do you think are the biggest strengths and weakness of the current Redux docs at https://redux.js.org https://redux.js.org ? - What topics do we do well? - What is not covered, or explained poorly? - What would be the biggest improvements we can make to the docs structure and content? I'd appreciate any constructive feedback people can offer. Finally, we've got a new `redux-starter-kit` package [2] that can help simplify common use cases like store setup, writing reducers, immutable update logic, and even creating "slices" of your store automatically. I'd encourage people to try it out. I talked some about this package in my recent ReactBoston talk on "The State of Redux" [3]. We'll be emphasizing this package when we rework the tutorials and other parts of the docs in the near future. [0] https://react-redux.js.org https://react-redux.js.org [1] https://github.com/reduxjs/redux/issues/2590 https://github.com/reduxjs/redux/issues/2590 [2] https://github.com/reduxjs/redux-starter-kit https://github.com/reduxjs/redux-starter-kit [3] https://blog.isquaredsoftware.com/2018/10/presentation-state-of-redux/ https://blog.isquaredsoftware.com/2018/10/presentation-state...
- davidcsally 8y agoThanks for the great Redux docs. I was not able to find any solid information on how to use Redux with typescript in the docs. Since redux now comes with typescript types (I think), it would be nice to have documentation around how to use them and any best practices to follow and pitfalls to avoid.
- acemarke 8y agoWe've got a work-in-progress PR on adding a docs page to discuss using TS with Redux: https://github.com/reduxjs/redux/pull/3201 https://github.com/reduxjs/redux/pull/3201 . But, neither Tim nor I use TS ourselves (yet), so we're not experts and don't have the expertise to write this ourselves, or maintain the typings. That's gotta come from the community. The React-Redux typings are separate, in Definitely Typed. We're considering moving the Redux typings over there as well.
- archarios 8y agoHuh. My coworkers have been talking about React's context API as an alternative/replacement for Redux and that the industry is generally "moving away from using Redux." Is this at all true/valid? I've been skeptical since I like Redux a lot and haven't been able to understand how Context is a true replacement for Redux given what I have read.
- acemarke 8y agoI wrote a post earlier this year that talks about how things like context, GraphQL, etc, all relate to Redux. It's still relevant: https://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet/ https://blog.isquaredsoftware.com/2018/03/redux-not-dead-yet... Also, Dave Ceddia wrote a good post comparing Redux and the context API: https://daveceddia.com/context-api-vs-redux/ https://daveceddia.com/context-api-vs-redux/ FWIW, my rough stats indicate that somewhere around half of all React apps use Redux, and Redux is also used with other UI frameworks as well. Redux definitely isn't going away any time soon :)
- oh-kumudo 8y agoVote for Mobx to replace Redux. Having done so, not missed a bit.
- manigandham 8y agoAgreed. State lifecycle is all the same but Mobx automates 2/3rds of the tedious work and is much more natural to use.
- oh-kumudo 8y agoNot to mention that the API is very intuitive and programmer friendly. For me, using Mobx doesn't force me to write things its own way, but instead enables me to write things MY way, but just hook it up with Mobx when needed. It is a more of a library than a framework, a guest not a intruder. While with Redux, not that I am bitching about it, it first states that I need to accept several principles before I can better appreciate it. Then here comes all the middlewares, like redux-saga/redux-thunk and the list goes on. As a causal, meaning I am not writing js fulltime but do use it in some non-trivial situtation when needed, I feel it quite heavy and burdensome, making hesitant to adopt it unless being asked to.
- davidy123 8y agoI used Redux in a major project, and really appreciated using a fairly standardized framework that translates between projects with support including Redux DevTools. However, all the boilerplate was a big drawback. There are scattered solutions, but adopting one takes away from the mainstream appeal of Redux. Is there any hope of a standard way to "reduce" some of the boilerplate?
- acemarke 8y agoYes, absolutely! Per my other comment in this thread [0], please check out our `redux-starter-kit` package [1]. I'd appreciate any feedback on whether or not it helps you, and what other capabilities would be beneficial to include. Lots of people throw around the word "boilerplate", but everyone seems to mean something different by it [2]. Can you clarify what _specific_ things you mean by that? [0] https://news.ycombinator.com/item?id=18605421 https://news.ycombinator.com/item?id=18605421 [1] https://github.com/reduxjs/redux-starter-kit https://github.com/reduxjs/redux-starter-kit [2] https://github.com/reduxjs/redux/issues/2295 https://github.com/reduxjs/redux/issues/2295
- davidy123 8y agoredux-start-kit looks great. It's been over a year since I've bootstrapped a redux project, but I'd definitely use it next time. One area that I always felt "there has to be a better way" was defining action names. Typing the same thing twice, as insignificant as it is in the grand scheme. I saw a few libraries that had answers for this, but none were "standard." Well outside the scope, but it would be nice to easily use action names as navigators via an editor extension. Rekit is doing some really interesting work to use Redux as the way to access an application.
- 3KQgt0Cl 8y agoNo.