flow-typed icon indicating copy to clipboard operation
flow-typed copied to clipboard

outdated @redux/toolkit

Open Yohandah opened this issue 2 years ago • 4 comments

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 avatar Jul 17 '23 09:07 Yohandah

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?

Brianzchen avatar Jul 25 '23 13:07 Brianzchen

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

Yohandah avatar Jul 25 '23 13:07 Yohandah

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 😬

Brianzchen avatar Jul 30 '23 08:07 Brianzchen

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

michaelmior avatar Dec 29 '23 21:12 michaelmior