cakephp / debug_kit

Debug Toolbar for CakePHP applications.
http://cakephp.org
Other
852 stars 573 forks source link

Standalone version of toolbar #411

Closed ypnos-web closed 8 years ago

ypnos-web commented 8 years ago

For me, DebugKit is vital for debugging especially in the case of AJAX. As in theses cases I typically get the correct result, or just no result at all (json_encode() just fails).

Now how do you debug AJAX requests via DebugKit? You need to reload the page and then use the History panel. So what I do, is having a second tab with an unrelated page, which I refresh after doing some troublesome XHR requests, then open up the toolbar again, go to History, select the right request, then go to the other panels.

I suggest the following functionality which would be a tremendous help to me:

  1. Have a page that just renders DebugKit with the History panel always visible on the left, the toolbar tabs on the right (main page)
  2. Have the History panel automatically refresh periodically to show new requests
  3. The user can select a request in the History panel while the main page stays with the same open tab

Example scenario: I am adding functionality to my finder that causes no data being delivered. I open the DebugKit page in a secondary window/tab and select the ORM tab. Whenever I change the finder code, I trigger a new AJAX request. I can go through the different requests in the History panel and see how the generated SQL changes. Another example scenario: Working on performance optimization and keeping the Timer tab open.

Obviously this can also improve the workflow for regular page visits.

ravage84 commented 8 years ago

Have you ever had a look at the (Firefox) development console, when you have installed DebugKit and do an AJAX call? :smirk_cat:

dereuromark commented 8 years ago

Or chrome developer toolbar :) For that matter. Both developer friendly browsers come with it almost out of the box and contain very powerful AJAX debugging tools.

ypnos-web commented 8 years ago

Thanks for your comments, I use the chrome developer toolbar all the time and look at the network traffic to debug XHR responses. However am I missing an interaction between the Chrome debugging and debug_kit?

So naive question: Having debug_kit enable, how would I use the Chrome debugging to have a look at SQL querys?

ravage84 commented 8 years ago

You don't see something like this?

debugkit_console

ypnos-web commented 8 years ago

Ok so this is Firebug and not the built-in console. I installed Firebug. But the Fireburg console just stays empty, for whatever reason.

ravage84 commented 8 years ago

May be add:

// In AppController.php
App::uses('FireCake', 'DebugKit.Lib');
ypnos-web commented 8 years ago

I am using CakePHP 3.x.

dakota commented 8 years ago

@ypnos-web DebugKit 3 already catches all ajax requests on the current view

dakota commented 8 years ago

image

image

Clicking on it will load the details for that request.

ypnos-web commented 8 years ago

Yes it does! It didn't work before and I never realized it changed.

I still think what I propose would be useful (esp. the divided view with history vs the other tabs) but the need for it is not as imminent anymore.

Thanks for your patience.

markstory commented 8 years ago

If you have an idea on how to make the divided view work a pull request would be great. Closing this issue as the core ask (XHR debugging) already works.