-
-
Notifications
You must be signed in to change notification settings - Fork 15.3k
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
Evaluate current Redux TS port status to determine remaining work for a 5.0 release #4129
Comments
It's difficult question what feature deserve it for bump up major version. Personally stability is strongest point in the state management libraries world. Lodash last release was 2016 but still feels like active. |
We could consider releasing this as a 4.2. Part of the issue is the whole debate over breaking changes in TS types. Ideally, there would be no breaking changes in our types and we could just do a release. But, it's also very likely that some change made in the conversion process will break people's code. On the flip side, TS itself doesn't follow semver and new TS releases themselves can break existing code at times. The questions atm are:
|
We most definitely have breaking changes for TS users. We have to make the next release a major version bump. |
One of the new changes that's in |
FWIW I just published https://github.com/reduxjs/redux/releases/tag/v4.2.0-alpha.0 from |
@markerikson Yeah, I saw that which is why I brought it up since I really don't think we should release |
Sure. To be clear, I don't intend to actually shove a 4.2.0 release out the door any time soon :) I'm just noting that since we were able to put out Reselect 4.1 with updated types as a minor, and this rewrite has been sitting around for two years now, I wanted to get a published alpha live to give people something to test out and push this issue forward. |
@markerikson Absolutely. Thanks for getting the ball rolling. The addition of a return type to |
Suggestion from https://twitter.com/sangster/status/1454563925480116225 :
|
This might be controversial, but I think it would be more helpful to make it so that the Any thoughts about restricting |
I don't think that's "controversial" at all :) tbh I'm actually surprised the types don't enforce that already. (I'd also be mostly surprised to see any real-world code out there at this point that is trying to use Frankly we oughta just have |
I'm actually against that. There is no design enforcement of what an action should actually contain, other than a I think what we can do is rather than default to |
Yeah, I'm saying we should start having that "design enforcement". We've always said they should be at least serializable:
In practice they're always strings. I can't see a good reason for them to not be strings. |
We have used enums in the past which basically boils down to number. This would intuitively be more memory efficient than a string but I have no measurements to back that up. I have no interest to block this idea that they must be strings, and this was way before TS supported union types with string literals. Figured I'd let you know, though, of one non string idea out there. Thanks for maintaining Redux! |
That is true. Hmmm... 🤔 I guess it's a thematic thing for this release: Do we want to start being more strict about things ( |
Yeah, like I quoted above, we've always said they should be serializable, and ought to be strings. Someone over on Twitter said they'd once tried to use Symbols to make them truly unique, but tbh slice namespacing gives you like 95% uniqueness anyway, so I don't see that as a reason to continue to allow them. As mentioned above, TS enums can have number values, but again why would you do that? We want them to be readable in the DevTools. So, given that we've always effectively said they should be strings, we might as well enforce it. And stuff like that definitely qualifies as a major :) As far as the original topic for this thread: I've been working with @JoshuaKGoldberg from CodeCademy on some Redux+TS updates to their codebase, and he just confirmed that Just a single data point, but it suggests that the TS types in |
Instead of creating an |
Update since someone asked on Discord: The notional plan atm is:
|
Vaguely related: for Redux 5.0 we should convert |
Pasting from #4127 :
That's sorta the issue - we're not sure what the breaking changes are, it's likely the types would benefit from more changes, and there's not enough reason to push it live and cause churn in the ecosystem atm :)
The conversion work was actually done in... late 2019, I think? And it's been sitting there in
master
ever since.Basically, the community contributed the work after we asked for it, and then the whole effort just stalled.
There's also some tie-in to
redux-thunk
's types being stuck in a holding pattern as well.Basically, what's live in 4.x right now works well enough, and especially with RTK now being the default, that there just isn't enough pressing reason to try to push through a 5.0 release any time soon.
I'd like to see 5.0 released, but it needs some meaningful attention to figure out what other types changes might be necessary, and given everything else going on it's just at the bottom of the priority list for us right now.
If someone else with serious TS knowledge wants to help us out and try to push the current TS port forward by evaluating it and seeing where things stand and how it can be improved, I'd love it.
The text was updated successfully, but these errors were encountered: