koba04 / swr-devtools

A DevTool for SWR
https://swr-devtools.vercel.app
MIT License
217 stars 3 forks source link

Network tab #51

Closed shuding closed 2 years ago

shuding commented 2 years ago

Closes #28.

This PR adds an initial implementation of a Network tab (waterfall chart) similar to Chrome DevTools' Network Tab. Basic design behind this:

I tested the virtual scroller with 500 useSWR hooks and 1000+ requests and it's still pretty smooth on my laptop. Also, I added some random delay to the API and enabled the failing hook.

I noticed a couple of bugs, such as ongoing request that never ends, but should be good at the moment. Another thing to be done is supporting useSWRInfinite.

CleanShot 2022-05-30 at 00 12 35@2x
vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
swr-devtools ✅ Ready (Inspect) Visit Preview Jun 2, 2022 at 11:32AM (UTC)
koba04 commented 2 years ago

Great work!!! 👏 👏 This is a great starting point 🚀 so I think It's ok to get merged this even if this still has bugs. I'll merge this after passing CI.

image

(We should support the Dark theme as well)

shuding commented 2 years ago

I'll fix the lint error as well as dark mode support :)

shuding commented 2 years ago

It should look better under dark mode now!

CleanShot 2022-06-02 at 13 31 15@2x