Repository navigation
RTK 3.0 breaking changes: feedback wanted #5535
markerikson
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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