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

outdated @redux/toolkit #4468

Open
Yohandah opened this issue Jul 17, 2023 · 4 comments
Open

outdated @redux/toolkit #4468

Yohandah opened this issue Jul 17, 2023 · 4 comments
Labels
bug libdef Related to a library definition

Comments

@Yohandah
Copy link

Library definition file name

toolkit_v1.x.x.js

Your dependent version

1.9.5

Flow Version

0.191.0

Description

A lot of definitions are missing for @redux/toolkit, for instance, createAsyncThunk. I've tried to generate types from the TS definition files with the help of flow-gen, looks like it works (I have types now and my IDE understands), but it's many files and not only one file like the other flow-typed types definitions ... I don't know how go to further. It's really a bummer because redux toolkit is the recommended library by the React team

image

Do you want to submit a pull request to fix this issue?

No (hope someone else can)

@Yohandah Yohandah added bug libdef Related to a library definition labels Jul 17, 2023
@Brianzchen
Copy link
Member

Hey @Yohandah . Sorry for the late reply, I saw it but wasn't quite ready with an answer. I know the pain of redux toolkit and recently actually tried creating my own definitions for this. There's a very large API surface to go through and there's no good codemod tool as far as I can tell from TS to flow-typed.

What I think is best is to slowly contribute as needed so we can build up the definition interface, I can make a start over the weekend and submit them bit by bit, but is there anything in particular you'd like me to focus on?

@Yohandah
Copy link
Author

Yohandah commented Jul 25, 2023

Hello !! For now my team and I decided to not migrate to RTK and put the project on-hold while we have no type definition so there's absolutely no rush but it would be so cool of you to build the type definition 🙏🏻

The part where I really struggled was createAsyncThunk especially, and auto-completion/type-check inside reducers and extraReducers (builder.addCase) of createSlice

@Brianzchen
Copy link
Member

Sorry I didn't get to this and got caught up upgrading some more pressing issues the flow toolchain.. I tried looking into toolkit this morning but as you said the types are complex. Seems I need to put some dedicated effort to pull this off, I'll try next weekend if nothing else comes up.

Though if you or anyone else if open to contributing that'd be helpful 😬

@michaelmior
Copy link

Perhaps this should be a separate issue, but RTK 2+ is currently unsupported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug libdef Related to a library definition
Projects
None yet
Development

No branches or pull requests

3 participants