-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
React-Redux v6 beta feedback thread #1083
Comments
Known libraries that break in v6, and tracking issues if available: |
I'll post now since you asked :) There are two things which I've noticed, neither of which I have reproducible test cases for yet:
Switching to 6.0.0-beta.2 fixes it. I never could get it to render badly.
|
I feel bad leaving a thumbs down, but with a very basic test and not delving too deep, upgrading to 6.0.0-beta.2 didn't work for me. I tried it on two large corporate eCommerce applications. I'm not altogether surprised though, they are very large and complex applications touched by a wide range of developers and both have significant redux reliance. Unfortunately I can't share the source with you as it is private code :( node: 8.11.4 Application uses SSR including server side redux store hydration Application 1
Application 2 Both of the applications are architecture as similarly as possible from the same custom template. Of course there is a little drift as you'd expect from separate dev teams though. Behaviour was a bit different. Server starts and webpack builds successfully, SSR works correctly, no errors in the console. Client side execution results in an error though. Visiting the page in the browser flashes with the full server side rendered application (looking good for that brief second), then turns to a blank page when client render kicks in. Sorry if there isn't enough context here for you to go on, I hope some of this is of help! |
@yjimk : that's okay, that's the feedback we're asking for :) It looks like both of those issues are actually called out in the release notes already:
Hmm. I may be sorta wrong on the last one - you said you're using |
As you noted, upgrading from v5.0.7 to v6.0.0-beta.2 breaks since we're using redux-forms (v7.1.1). Our app is running React v16.6.3. With redux-form/redux-form#4216 + I get this error when rendering react-bootstrap's OverlayTrigger with a popover that's connected to the store, also probably an issue with refs? Reproduced with this (edited): https://codesandbox.io/s/4xqkxr0377 |
@jeffchheng : interesting. I traced If you can set up some CodeSandboxes or repos that reproduce these issues, that would certainly help us investigate. |
For react-bootstrap: https://codesandbox.io/s/4xqkxr0377 |
Related, here's a poll I ran a few months ago asking about people using |
This is a known issue, but currently the |
@brunolemos : Our use of context internally is considered an implementation detail and not part of our public API. Besides, the entire point of context is to pass down data, and the We have a bunch of reasons for switching from having individual components subscribing to having just the The React team plans to allow function components to bail out of updates - see facebook/react#14110 . |
@markerikson got it |
Hey @yjimk @markerikson That one looks like what I've encountered with Here's the open issue for it: connected-react-router: #176. Meanwhile, on the side, I'm trying to come up with an alignment for Is there an expected way for related libraries to gain access to the store with v6? |
Maybe there should be a (Note that it would still eventually break when legacy context is removed.) |
Can our Provider not provide both APIs? |
Note that legacy context creates a cost for the entire app. There are many bailouts that don't work because there is legacy context in the tree. So there should be a way for users to avoid it completely. |
@wgao19 : my assumption has been that libraries that still want access to the store can use the exported default Example: import {connect, ReactReduxContext} from "react-redux";
class MyComponent extends React.Component {
render() {
return (
<ReactReduxContext.Consumer>
{({store}) => {
// do something useful with the store here
}}
</ReactReduxContext.Consumer>
);
}
} |
We could provide a copy/pastable snippet for users who need store passed through legacy context. Or we could use this time to do PRs to external projects that break? Or both? |
Thanks @markerikson for the hints, it's working! |
I was using react-helmet in a connected component that updates a lot. This blew up the stack somehow. I removed react-helmet from that component and now everything works fine. |
@evertbouw : can you provide a CodeSandox that reproduces the issue, or at least let us know what kind of error was happening? |
In discussions with Evert on Reactiflux, it sounds if this may be somehow related to No idea how that ties into our beta, though. |
This is fixed in react-bootstrap 1.0.0 betas. They are using the older unstable_renderSubtreeIntoContainer in the current 0.32.4 release, which doesn't support the new context API. |
Aha, so it's a diff between master and latest release. Good to know. |
It doesn't. It's their fix to make, not ours. I think we're close to a full release. Might as well have our release so dependent libraries have a stable release to target. Both connected-react-router and redux-form are peer dep'd correctly to prevent (or at least warn about) installing an incompatible version. Users of those libraries can hold off until they have compatible releases. I'm thinking an RC on Monday and then get it out that week as long as no one raises any alarms. |
Part of me really wants to see some more people replying with "YES, I've tried it in our prod app and it works fine!". Not sure how to get more responses, though. |
It was the same with 5.0 and 4.0, so I'm not particularly worried. If it's that bad, you just deprecate it on npm and set the latest tag back to 5.1.1. Live to try again another day. |
It's been running on pixiv.net for a bit over a week now 😇 I had already gotten rid of previous uses of withRef so I dodged that breaking change. I wrote a tiny reimplementation of connected-react-router that supports only the minimal features we needed to work, and both react-redux and react-router are running I haven't tried StrictMode yet but I think I actually got rid of all uses of legacy context with these updates. |
For |
Went ahead and gave it a shot on a project (it's in production and used quite widely) with "100+ matches in 100+ files" when searching for |
I had an issue with v5 regarding forwarding refs on a personal project. Been using the beta ever since #1000 version and it has worked great. I really appreciate all the work done on upgrading this, and looking forward to the 6.0.0 release. |
I've tried 6.0.0-beta.3 and my connected components were re-rendering even when mapStateToProps returned identical ( EDIT: Confirmed it's specific to v6. Rolled back to 5.1.1 and those re-renders don't happen. |
@gustavopch : can you please provide a project repo or CodeSandbox that reproduces the issue? We can't do anything with a short description like that. |
And v6 has gone final! https://github.com/reduxjs/react-redux/releases/tag/v6.0.0 I'll close this thread now. If there are any other new issues, please open up a new thread (with repros, please!). |
Opening this as a place to get user feedback on our React-Redux v6 beta releases. We're specifically interested in bug reports and info on performance behavior, but would also appreciate feedback if it's working correctly as well.
To simplify the comment thread a bit: if you've tried it and it works okay, please add a 👍 reaction to this comment. If something broke, leave a 👎 reaction, plus a comment with details, including a link to your project if publicly available.
We'd also be interested in hearing details on:
The current beta is: React-Redux v6.0.0-beta.3
The text was updated successfully, but these errors were encountered: