Major News in Tracy in 2019

4 years ago by David Grudl  

In the last year, Tracy has introduced a lot of innovations in improving the user experience. Let's summarize the most important ones.

10 times faster dump

Function dump() and all its variations, such as barDump() etc., prints arrays and objects in a clever way. They generate HTML code only for those parts that are immediately visible, without having to open them by click. The HTML code of the collapsed parts then generates JavaScript at the moment of clicking.

This, on the one hand, will significantly reduce the amount of HTML code, but above all it will speed up its display, because the browser does not have to parse the saved code. It might seem that HTML parsing is something so fast that this optimization won't have much effect, but the opposite is true. Acceleration is really dramatic, usually 10 times. Watch a video with the web developer console:

AJAX News

Tracy has been able to display AJAX requests for some time, even without the need for any additional configuration on the JavaScript side. There is a new feature in version 2.6, which is the ability to display more than one request. By default, 3 rows are displayed and the value can be changed by JavaScript in the variable window.TracyMaxAjaxRows.

Version 2.7.2 comes with another new feature, which is a visual distinction of ajax panels. “Ajax” now appears in the upper right corner.

CLI panel

The “BlueScreen” now contains a new CLI panel if the error occurred while running a command-line program.

Improved UX

Tracy has received a number of cosmetic enhancements that enhance the user experience. For example, I would like to mention the ability to sort tables by any column with one click:

GDPR ready

To avoid logging sensitive information in BlueScreen, you can determine contents of which keys will not revealed:

Tracy\Debugger::getBlueScreen()->keysToHide[] = 'login';

By default, the contents of these keys are not printed: password, passwd, pass, pwd, creditcard, credit card, cc and pin.

PSR-3 adapters

You can use PSR-3 loggers in Tracy, and vice versa. This is done by a pair of adapters Tracy\Bridges\Psr\PsrToTracyLoggerAdapter and TracyToPsrLoggerAdapter.

One more thing

And finally, one thing that connects Tracy and Latte. Tracy can utilize source mapping provided by Latte and display not only the line where the error occurred in the generated PHP code, but also in the template.