Repository navigation
RTK 3.0 breaking changes: feedback wanted #5535
Replies: 1 comment
|
Most of it either looks good or doesn't really affect our projects that much. One of our applications use I saw you mentioned suspense hooks in issue 5519 but I'm not sure on how this would workout in practise. Here's some code that we use today so you know how we use it. Small wrapper for handling suspense: Example of usage in a react componet: And we create our api like so: Basically as long as we are on the server I.E. On client side it will just behave like regular react and RTK Query and we won't suspend while waiting. As long as there is a reasonable solution for this kind of thing going forward it should be fine. In regard to the other changes I don't see any problem with any of them, and most of them seams reasonable. If you like I could give you more detailed feedback on them as well but I don't think it would provide much value for you. And as always, thanks for your great work! |
Uh oh!
There was an error while loading. Please reload this page.
The 2.x and 3.0 roadmap lists the breaking changes we're planning for RTK 3.0. Most of them are still at the design stage. Tell us what would hurt, what you'd like to see, and what we've missed.
These are the main changes we'd like opinions on:
Endpoint definitions:
queryβrequest, andbuild.query.fn()Reference:
request:andbuild.query.fn()endpoint definitionsΒ #5521We plan to rename the
queryfield in endpoint definitions torequest, and to movequeryFnendpoints into a separatebuild.query.fn()call. Are you for or against either change? How many endpoints would you have to change, and would a codemod cover them?Replacing the
createApimodule systemReference:
reactifyand build the ReactcreateApion the core APIΒ #5519The current module system is going away. In its place, a core API instance will get React support added at runtime, similar to
injectEndpoints().buildCreateApiwith custom modules? What for: custom hooks, a custom React context,unstable_sideEffectsInRender, or a module of your own?unstable_sideEffectsInRender? We expect to remove it.extraReducersβrespondTorespondToas an alias forextraReducers, replacing it in 3.0Β #5526respondToarrives as an alias in 2.17, andextraReducersis removed in 3.0. Any objections to the name or to the timing?createSlicecustomization and creatorsWe're revamping how
createSliceis customized, so you can add your own reducer "creators" (for example, an entity adapter creator) and so the async thunk support doesn't get bundled when you don't use it. We have an earlier draft of the concept that will be revamped for integration into 3.0:Do you use
buildCreateSliceorasyncThunkCreatortoday? What creators would you write?Swappable immutability library
Reference:
buildCreateSliceandcreateApiΒ #5527Immer stays the default, but you'd be able to swap in another equivalent immutability library behind a standard interface. Would you use this? Which alternate library would you use (or a no-op setup and handwritten reducers), and why?
Packaging and support floors
Reference:
RTK 3.0 will be shipping ESM-only and requiring TS 6.0 or newer. We also plan on moving the
redux-thunkpackage directly into thereduxcore.redux-thunkdirectly?Anything else
What pain points should 3.0 fix that aren't on the roadmap? What do you need from the upgrade path: codemods, lint rules, a migration guide, deprecation warnings in 2.x? What problems did you run into upgrading from 1.x to 2.x?
Questions about current RTK Query behavior (cache access,
initiate()promises, invalidation timing, SSR and hydration) go in the RTK Query usage discussionAll reactions