feat: using tanstack query for search#1763
feat: using tanstack query for search#1763gnugomez wants to merge 1 commit intoeclipse-openvsx:mainfrom
Conversation
9347601 to
9bfed0e
Compare
9bfed0e to
fc74155
Compare
|
the changes look very promising, the question I have is about using tanstack. I understand that this is a powerful framework but we should discuss whether we want to buy into that or look at alternatives. I found https://tanstack.com/start/v0/docs/framework/react/start-vs-nextjs |
|
@netomi that's a fair concern.. I looked at the article and I think there is an important distinction to make: TanStack Start is their full-stack framework (their answer to Next.js), not TanStack Query. Those are two separate things in the TanStack ecosystem. The proposal is only to use TanStack Query, which is a much smaller commitment. It was originally called React Query and was renamed when it expanded to support other frameworks like Vue and Solid. It has been around for years and is one of the most adopted libraries in the React ecosystem. It has no opinion about routing or build tooling, and both Next.js and TanStack Start work with TanStack Query, not instead of it. On the "buying in" concern: every option requires buying into something. SWR is also a third-party library. Custom hooks means we own the maintenance. TanStack Query's footprint is small: it wraps around our existing ExtensionRegistryService and can be adopted one hook at a time. If we ever needed to remove it, each query would just go back to a useEffect + useState block. One thing also worth mentioning is the devtools it ships with. You get a floating panel that shows every request, its status, and what is cached. That alone would help us catch the duplicate request problems we have today and make it much easier to debug data fetching issues going forward. |
|
ty, that makes sense, the library also has a very small set of dependencies, I was just wondering if there are alternatives to tanstack but from your description it sounds like that it's the stuff we want. |
|
yep, SWR is the main alternative but TanStack Query has a higher feature ceiling and the devtools tip the balance for our case imo |
fc74155 to
b93788d
Compare
|
with SWR you mean that: https://swr.vercel.app/? |
|
@netomi yes |
Relates to #1764