rtk-incubator / rtk-query

Data fetching and caching addon for Redux Toolkit
https://redux-toolkit.js.org/rtk-query/overview
MIT License
626 stars 31 forks source link

RTK Query Release Planning notes #175

Closed markerikson closed 3 years ago

markerikson commented 3 years ago

The maintainers (@phryneas , @msutkowski , and myself) are hoping to nail down plans within the next few days for finalizing and releasing the "RTK Query" APIs officially.

This will presumably involve migrating the source code for createApi over into the Redux Toolkit codebase itself, and moving the documentation from https://rtk-query-docs.netlify.app into the actual Redux Toolkit docs at https://redux-toolkit.js.org . This would be followed by releasing a new Redux Toolkit version with that functionality, likely a v1.6 release.

Key things for us to figure out:

ajcwebdev commented 3 years ago

In regards the last question, I think the level of separation from the rest of the docs will be dependent on how it is integrated into the larger RTK library.

markerikson commented 3 years ago

At the moment, the rough plan is that the createApi function currently in this "RTK Query" package will be just another API exported from RTK directly, like configureStore and createSlice. So, the intent is that there's one single @reduxjs/toolkit package, and you get everything at once - it's just a question of which APIs you import and use in your app.

There will be a new "@reduxjs/toolkit/react" entry point of some kind, which will specifically have the functionality that handles generating React hooks from the API endpoint definitions. (I'm actually still not entirely sure how that logic is organized in this package right now.)

As far as docs organization, I assume there'll be two aspects:

ajcwebdev commented 3 years ago

Makes sense, for the second point I'd lean toward putting it as its own category within "Using Redux Toolkit," instead of its own top-level category, as it'll be a decent sized chunk of docs but still comparable to the length of other content in that category. And it wouldn't make as much sense to have it separated because you would be recreating an API Reference section and a Using Redux Toolkit section within the new top level section.

msutkowski commented 3 years ago

From twitter:

Jakob Heuser @jakobo · 1m Tweet sized fast feedback:

  • Less animated checks
  • “invalidates: ['Posts']” isn’t hyped up enough. Cache invalidation is a PITA & having a “good enough” pattern is Hundred points symbol
  • I’d prefer the feature list be in terms of benefits, as some of the terms like “lagged queries” are jargon
msutkowski commented 3 years ago

@gfortaine Just wanted to give you a quick ping as you've contributed quite a few things - if you have any additional feedback, please let us know! We have a few more features pending right now that we're aiming to roll out soon. If we're missing anything you've come across, let us know!

@kahirokunn Your input would also be valuable here, thanks!

tobybaratta commented 3 years ago

What final tweaks to the APIs and functionality are needed to consider this "done" and ready for initial stable release?

I can think of three things that would be useful, but I don't think absolutely necessary; in my experience, pagination is frequently done using a skip token rather than just incrementing the page number. I think overall just having another explicit example of changing a query based on the response of a previous query to the same endpoint. I could see pagination using a skip token as an example, or having the polling time set by the retry-after header.

I think overall documentation could be easier to have some more explicit walkthroughs - though perhaps some of that could be done through an updated example to use rtk-query for RTK core's examples.

How should the "RTK Query" docs content be structured inside of the RTK docs? Should there be some kind of an "RTK Query" category, just put this content under "Usage Guides", or something else?

I think it should be its own header, but can also see it being fine as a subheader under "Using Redux Toolkit" as mentioned above.

I feel like the rest of RTK can be seen as a more clean drop-in substitute for Redux for new projects, where rtk-query is more of an additional feature that RTK has that is wonderful integration, but not a default thing that people would think of (the way createSlice/Action/Reducer are). You could maybe make the argument that it should go alongside createAsyncThunk, but even then the use case is related but not really a drop-in.

I think with the amount of documentation and examples you have already on the rtk-query documentation site, it makes the most sense to keep it as a separate header.

msutkowski commented 3 years ago

Adding some notes from our call:

RTKQ

RTK

RTK Misc:

RTK Docs:

phryneas commented 3 years ago

adding from memory:

gfortaine commented 3 years ago

@msutkowski It looks like that we don't have any additional comments on our side 😀 For your kind reference, we have successfully moved from a homemade fetcher to RTK query like a breeze in our production project. Now, we are eagerly waiting for the 0.3.0 to move forward 👍 Thank you for the great work guys 🎉 @phryneas @msutkowski

phryneas commented 3 years ago

So, another TODO would be a rename for:

entity -> tag entityTypes -> tagTypes provides -> providesTags invalidates -> invalidatesTags

markerikson commented 3 years ago

Also prefetchThunk -> prefetch

phryneas commented 3 years ago

see https://github.com/rtk-incubator/rtk-query/pull/213

phryneas commented 3 years ago

So, stuff that happened since the last release:

"new apis":

potentially breaking

tweaks & fixes

And of course Docs docs docs by @Shrugsy, @markerikson but also quite a lot of smaller tweaks in master and next. I'm not gonna name all of them here now to avoid a mass ping though.

markerikson commented 3 years ago

The primary RTKQ migration work is now done, and I've just published https://github.com/reduxjs/redux-toolkit/releases/tag/v1.6.0-alpha.1 containing the RTKQ APIs as part of the RTK package!

This is basically rtkq@0.3, but moved over to be under @reduxjs/toolkit/query and @reduxjs/toolkit/query/react.

phryneas commented 3 years ago

I'm closing everything here now. If there's any need for further discussion, that should take place in a new issue over at https://github.com/reduxjs/redux-toolkit/