maximebf / php-debugbar

Debug bar for PHP
phpdebugbar.com
MIT License
4.2k stars 400 forks source link

Fetch support #421

Closed stevelacey closed 1 year ago

stevelacey commented 5 years ago

Any plans to support fetch in addition to xhr?

I don't see a way to hook php-debugbar up to Apollo currently, whilst it works just fine with Axios, is lack of fetch support the reason? I came across the docs for manual integration but it seems to be xhr specific and throwing fetch as it doesn't go so well.

Would be great to hook this up to Apollo-based SPA's so I can see the horrendous number of database queries being ran easier 🙃

barryvdh commented 5 years ago

I think this is what we do now: https://github.com/maximebf/php-debugbar/blob/2a95c20da4c6965114e5773f3aaf974e12f9c92b/src/DebugBar/Resources/debugbar.js#L1151-L1169

And this is how Symfony does it, which supports fetch: https://github.com/symfony/symfony/blob/7788612c3cb63cc44b2cabb4644a7fbd75c61e97/src/Symfony/Bundle/WebProfilerBundle/Resources/views/Profiler/base_js.html.twig#L279-L331

So I think we should be able to support fetch also. Do you want to make a PR for that?

stevelacey commented 5 years ago

@barryvdh yep, done, please check out #422 🤘

fjorgemota commented 4 years ago

I think this issue can be closed, right?

parallels999 commented 1 year ago

I think this issue can be closed, right?

Yes, must be closed