In https://github.com/elastic/kibana/pull/146714, we migrated all data fetching in the Integrations UI application to use @tanstack/query (otherwise known as react-query). This issue is a place to track the follow-up work involved in migrating the remainder of the migration effort.
Ideally, when each of these hooks is migrated to react-query, its corresponding references should also be updated, and the outdated/unused references to the non-react-query implementation of the hook should be removed. This may not be possible in all cases, based on the number of references each hook has. It might be necessary to follow up a migration PR with another one to complete a given migration.
There are also a few one-off modules that use existing data fetching patterns outside of use_request/ which are tracked separately below.
This issue is broken up into task lists to make tackling individual migrations a little more approachable. We should try not to migrate the entire Fleet app at once.
### Other hooks
- [ ] [`use_fleet_status`](https://github.com/elastic/kibana/blob/main/x-pack/plugins/fleet/public/hooks/use_fleet_status.tsx)
- [ ]
It'd also be a good idea to evaluate file names and such as we go through this process. For example, does the folder name use_request really make the most sense to store all of these hooks?
Another part of this that I haven't had time to dive into is tracking down any hand-spun useEffect request chains, etc. RQ should make it easier to get rid of things like that.
In https://github.com/elastic/kibana/pull/146714, we migrated all data fetching in the Integrations UI application to use
@tanstack/query
(otherwise known asreact-query
). This issue is a place to track the follow-up work involved in migrating the remainder of the migration effort.Essentially, we'll want to migrate all hooks in
x-pack/plugins/fleet/public/hooks/use_request
to use the newreact-query
helpers as specced out in the linked PR and in the dev docs writeup.Ideally, when each of these hooks is migrated to
react-query
, its corresponding references should also be updated, and the outdated/unused references to the non-react-query implementation of the hook should be removed. This may not be possible in all cases, based on the number of references each hook has. It might be necessary to follow up a migration PR with another one to complete a given migration.There are also a few one-off modules that use existing data fetching patterns outside of
use_request/
which are tracked separately below.This issue is broken up into task lists to make tackling individual migrations a little more approachable. We should try not to migrate the entire Fleet app at once.
It'd also be a good idea to evaluate file names and such as we go through this process. For example, does the folder name
use_request
really make the most sense to store all of these hooks?