Jump to content
adrian

Tracy Debugger

Recommended Posts

wow! thank you for all your work! loving the logo - just updated my signature O0 :lol:

  • Like 2

Share this post


Link to post
Share on other sites
Just now, bernhard said:

loving the logo

The logo is so funny, I like it too. If Ryan does not mind that you use it this way, why change it?

  • Like 1

Share this post


Link to post
Share on other sites
4 minutes ago, bernhard said:

and working 200% faster thanks to favicon-16x16.png

Love it :)

  • Like 1

Share this post


Link to post
Share on other sites

Stoked about the new documentation site! I love it even more with the text size zoomed to 125% ;)

In due course it would be great to add a section about barDumpLive() / bdl() - I've never been clear on when it's okay to use this and when it should be avoided due to the dumped variable getting mixed up. I use it from time to time and when there is a variable mix-up it's usually pretty obvious, in which case I switch to bd() with max depth and max length options included. Although I still worry there might be situations where the mix-up is more subtle and could lead to confusion.

Related to this: what do you think about adding a new shortcut method for "big" bardumps? This could have options in the module config for max depth and max length. Just so there's a quick way to do a bardump where you need greater nesting depth and string length than with the standard bd(). I have added a custom shortcut in my IDE for inserting a bd() with max depth and length options, but it would be cool to have something like a "bdb()" method in Tracy (until the barDumpLive thing is resolved anyway).

 

  • Like 2

Share this post


Link to post
Share on other sites
1 hour ago, Robin S said:

I love it even more with the text size zoomed to 125%

Taken care of that here - will push with the next update.

 

1 hour ago, Robin S said:

In due course it would be great to add a section about barDumpLive() / bdl()

Agreed - it will be in there with details and warnings. I am sure if it will ever be 100% reliable because of the way it works, but from my experience it only ever seems to be an problem when used within hooks.

 

1 hour ago, Robin S said:

but it would be cool to have something like a "bdb()"

I see two possibilities here :

  • a bdb() with some config settings to determine what the depth and length will be - I think the defaults should probably be 6 and 999 - any thoughts?
  • or a simplified syntax for bd(), eg bd($page, [6, 999]) so you don't have to do bd($page, ['maxDepth' => 6, 'maxLength' => 999]) which is painful

The problem with a fixed dbd() is that in the case of PW objects, anything more than 6 can results in out of memory errors (at least with my dev machine setup), but working with smaller objects/arrays, I often want 6 or 7.

I have decided to go with this for now, which sets the maxDepth to 6. Obviously pre PHP 5.4 you will still need: array(6)

bd($page, [6]);

You still need to make the depth and length settings an array - this is because the second argument in the array can either be the "title" or the options array. It's get too confusing to take it any further away from that default.

You can also do:

bd($page, [6,999]);

or:

bd($page, 'Dump Title', [6,999]);

How does that look to you?

I'll post this to the closed beta version shortly.

  • Like 2

Share this post


Link to post
Share on other sites
3 minutes ago, adrian said:

You can also do:


bd($page, [6,999]);

or:


bd($page, 'Dump Title', [6,999]);

How does that look to you?

Good solution, thanks.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Robin S said:

what do you think about adding a new shortcut method for "big" bardumps?

great idea, thx! needed that several times and maxLength=>... was a pain

9 minutes ago, adrian said:

anything more than 6 can results in out of memory errors (at least with my dev machine setup), but working with smaller objects/arrays, I often want 6 or 7.

10 minutes ago, adrian said:

bd($page, 'Dump Title', [6,999]);

How does that look to you?

would it be hard to have the shortcut bdb() for bd($page, [6,999]) ?

i think it would totally be fine to have that shortcut with fixed values since we have the other option of defining it manually like you showed above. but i think in 99% of the cases the bdb() would work just well and it is less to write and a lot easier to remember :)

  • Like 2

Share this post


Link to post
Share on other sites
1 minute ago, bernhard said:

would it be hard to have the shortcut bdb() for bd($page, [6,999]) ?

Ok, I'm on it :)

  • Like 1

Share this post


Link to post
Share on other sites

It's been out for about 10 days now, but I never really announced the changes here - wanted to see if there were any issues before publicizing.

The new 4.9.x version is now available.

Here's a list of the main changes:

1) New File Editor Panel

  • Supports editing all files in your PW install (you can define the root as /, /site, or /site/templates
  • Can be used as the handler for opening editor links from the debug bar (errors, log files, Captain Hook, ToDo, Template editor, etc), rather than your code editor.
  • Can be enabled as the link handler for live sites only, or local as well if you prefer.
  • Has "Test" functionality for all files so if you make a change, it will only appear for you and not other users.
  • Makes a backup of the old version each time you save a change and provides a "Restore Backup" button to instantly revert.
  • Supports in-code search & replace with CMD+F
  • Syntax highlighting/linting for PHP, CSS, and JS
  • This replaces the Template Editor panel, so that one has been removed.
  • Handles fatal errors gracefully - this is the biggest feature in my opinion. The problem with most online file editors is that if you accidentally make a code change that results in a fatal error, it can be impossible to fix and resave because the system is not functional. This editor gets around this problem by using Tracy's custom error handling which allows debug bar panels to continue to work, so you can manually fix the problem, or click the "Restore Backup" button. Of course if you used the "Test" option, you don't even need to worry, because you are the only one to see the version with the error anyway.

image.thumb.png.050d883e2f50b8359e5a84e4524515c0.png

As a follow up to that last point. I have used the excellent ProcessFileEdit module for helping to debug some issues on other people's sites without needing FTP access, but a couple of times I have made a fatal error mistake and had to get them to restore the file, so this really is a huge feature for me!

 

2) Support for Process File Edit

If you prefer ProcessFileEdit to this new File Editor Panel, so you can use it for handling debug bar links. Note that this won't give you the "Test" and "Restore" options, or the fatal error protection, so it's not really recommended. I added support for it before building the File Editor panel so decided to leave in case others prefer it.

3) Revamped Console Panel 

  • The code and results sections are now a "split" screen so you can adjust the size of one relative to the other with the bar in the middle. Handy for working, but especially handy when you want to post a screenshot to the forums
  • "Large and "Small" versions of the panel - click the arrows at the top right of the panel - the large version can be very handy when you have lots of code or results to display
  • Supports in-code search & replace with CMD+F

image.thumb.png.5f60f96951818223b0ba520e27643b56.png


4) New maxDepth and maxLength shortcuts and new barDumpBig() method

You can now replace dump or barDump calls like:

bd($var, array('maxDepth' => 7, 'maxLength' => 500));

with:

bd($var, [7,500]);

You can also make use of the new:

bdb($var);

as a shortcut to:

bd($var, [6,999]);

 

5) New SQL Query column in the Selector Queries section of the Debug Mode panel

This is a great learning tool to see the selector queries that are run for a given page request, and what SQL query these selectors are translated into:

image.thumb.png.6fba1698525c64823aa14d5c95c60937.png

 

6) Removed old Legacy version of Tracy core

  • It was getting too painful to maintain support for this old version. This means that TD now requires PHP 5.4.4+

7) Namespacing and refactoring lots of Javascript code

  • No feature changes, but code is now easier to follow and is much less prone to any name conflicts with your site

8) Reduced loading of unnecessary code

  • Lots of refactoring here too - should see some performance gains

9) New default server type indicator in the debug bar 

  • Not a big deal, but if you want a server type indicator and don't want the full height/width bar, you can now have one in the debug bar - I think it's a handy visual clue when looking at /working on live vs dev/test versions of a site at the same time.

image.png.fee9a07fbf469adfa336dcc06fa9f47b.png

 

10) Lots and lots of bugs fixes, layout, and styling improvements

  • It's amazing what you find when you're buried in the code for a couple of weeks solid :)
     

11) The new docs site that I mentioned earlier is now fairly complete - I just need to work on the Tips & Tricks section

  • https://adrianbj.github.io/TracyDebugger
  • Feel free to make a PR for improvements to the docs - everything is under the /docs folder in the main Github repo. There are also "Edit on github" links on each page so you can use those as well.
  • Like 13

Share this post


Link to post
Share on other sites

Tracydebugger has come a long way. Thanks for developing it into the powerful tool it has become. 

  • Like 3

Share this post


Link to post
Share on other sites
8 hours ago, pwired said:

Thanks for developing it into the powerful tool it has become.

Just a quick fix: "...the most powerful tool on this planet..." ;) 

  • Like 3

Share this post


Link to post
Share on other sites

JSON API response testing in the Console panel

I know we all know about json_decode($var, true), but here's a useful tip when working with APIs that return JSON.

Note that I am using the new shortcut for specifying a depth of 7 so I get to the deeper levels of the JSON response.

 

image.png.308bf5e4ecff17b0028200ed3d360439.png

 

Obviously that's a LOT nicer than:

image.png.49d3b2d1fe32a5950e604a8f609d5b22.png

 

  • Like 6

Share this post


Link to post
Share on other sites

thanks for that tip!

30 minutes ago, adrian said:

Obviously that's a LOT nicer than:

sorry, dont't get it ???

Share this post


Link to post
Share on other sites
1 minute ago, bernhard said:

thanks for that tip!

sorry, dont't get it ???

Sorry @bernhard - I replaced the first image after my initial post, and accidentally replaced the second one as well. Take a look now :)

  • Haha 1

Share this post


Link to post
Share on other sites

New version just committed that is a must for Windows users - a huge thanks to @matjazp for the report and also local access to his dev machine so I could find and fix all the issues. You Windows guys need to speak up when you see issues ;) - the Console, Snippet Runner, and Captain Hook panels in particular were a mess :) Please let me know if you see anything I have missed.

Other changes include:

  • Add custom register_shutdown_function() for Console and Snippet Runner panels - especially important for PHP 5.x. PHP 7 handles most errors as non-fatal.
  • Fix AJAX panel updating for Console/Snippet Runner when SessionHandlerDB not installed.
  • A few styling fixes.
  • Like 4

Share this post


Link to post
Share on other sites
11 minutes ago, adrian said:

the Console, Snippet Runner, and Captain Hook panels in particular were a mess

Nothing obviously wrong/messy with those panels for me with v4.9.9 on Windows 8.1. Maybe some other factor comes into it. Thanks for the update though!

  • Like 1

Share this post


Link to post
Share on other sites
5 minutes ago, Robin S said:

Nothing obviously wrong/messy with those panels for me with v4.9.9 on Windows 8.1

Interesting - the key thing was incorrect line numbers on errors when running code in Console/Snippet Runner. And with Captain Hook panel it was a lack of grouping of file under the Site Modules headings. Maybe PHP on different version of Windows IIS handle forward / back slashes differently. All the issues came down to using strpos() to see if the path to a file contained a certain subpath, eg /site/modules - the trouble being that on Windows, I had to look for \site\modules instead. I fixed things with a combination of DIRECTORY_SEPARATOR and in some cases converting the paths to all forward slashes before doing checks, displaying links etc.

Thanks for keeping an eye out for any persistent / new issues.

Share this post


Link to post
Share on other sites

Another useful update - the File Editor panel now remembers and reopens the folder tree to the currently open file and highlights that file. Should make navigation to related files much simpler after save when the page reloads.

  • Like 2

Share this post


Link to post
Share on other sites
10 hours ago, tpr said:

Shadow DOM sounds like the ideal treat for Tracy bar encapsulation headaches,  when it will widely supported:

https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_shadow_DOM

When you say "encapsulation headaches" are you talking mostly about css inheritance?

Sorry, I haven't had a good read of that link yet :)

Share this post


Link to post
Share on other sites

Yes, having a separated DOM inside the main DOM, with its fully separated CSS.

  • Like 1

Share this post


Link to post
Share on other sites
Just now, tpr said:

Yes, having a separated DOM inside the main DOM, with its fully separated CSS.

Sounds awesome - thanks for the heads up. I wonder how hard it will be to implement and whether it really needs to be implemented in the Tracy core or not?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.56
      Composer: rockett/jumplinks
      Jumplinks is an enhanced version of the original ProcessRedirects by Antti Peisa.
      The Process module manages your permanent and temporary redirects (we'll call these "jumplinks" from now on, unless in reference to redirects from another module), useful for when you're migrating over to ProcessWire from another system/platform. Each jumplink supports wildcards, shortening the time needed to create them.
      Unlike similar modules for other platforms, wildcards in Jumplinks are much easier to work with, as Regular Expressions are not fully exposed. Instead, parameters wrapped in curly braces are used - these are described in the documentation.
      Under Development: 2.0, to be powered by FastRoute
      As of version 1.5.0, Jumplinks requires at least ProcessWire 2.6.1 to run.
      View on GitLab
      Download via the Modules Directory
      Read the docs
      Features
      The most prominent features include:
      Basic jumplinks (from one fixed route to another) Parameter-based wildcards with "Smart" equivalents Mapping Collections (for converting ID-based routes to their named-equivalents without the need to create multiple jumplinks) Destination Selectors (for finding and redirecting to pages containing legacy location information) Timed Activation (activate and/or deactivate jumplinks at specific times) 404-Monitor (for creating jumplinks based on 404 hits) Additionally, the following features may come in handy:
      Stale jumplink management Legacy domain support for slow migrations An importer (from CSV or ProcessRedirects) Feedback & Feature Requests
      I’d love to know what you think of this module. Please provide some feedback on the module as a whole, or even regarding smaller things that make it whole. Also, please feel free to submit feature requests and their use-cases.
      Note: Features requested so far have been added to the to-do list, and will be added to 2.0, and not the current dev/master branches.
      Open Source

      Jumplinks is an open-source project, and is free to use. In fact, Jumplinks will always be open-source, and will always remain free to use. Forever. If you would like to support the development of Jumplinks, please consider making a small donation via PayPal.
      Enjoy! :)
    • By BitPoet
      As threatened in Ryan's announcement for 3.0.139, I built a little module for sliding toggles as a replacement for checkboxes. Styling of the input is CSS3 only (with all the usual caveats about older browsers), no JS necessary, and may still be a bit "rough around the edges", so to speak, since I didn't have much time for testing on different devices or brushing things up enough so I'd feel comfortable pushing it to the module directory. But here's the link to the GitHub repo for now:
      InputfieldSlideToggle
      Fieldtype and Inputfield that implements smartphone-style toggles as replacement for checkbox inputs. The visualization is CSS-only, no additional JS necessary.
      Status
      Still very alpha, use with caution!
      Features / Field Settings
      Size
      You can render the toggles in four different sizes: small, medium, large and extra large.
      Off Color
      Currently, "unchecked" toggles can be displayed either in grey (default) or red.
      On Color
      "Checked" toggles can be rendered in one of these colors: blue (default), black, green, grey, orange or red.
      Screenshots

      Some examples with checkbox label


      View all Size and Color Combinations
      Small toggles Medium toggles Big toggles Extra big toggles  









    • By Orkun
      Hi Guys
      I needed to add extended functionalities for the InputfieldDatetime Module (module is from processwire version 2.7.3) because of a Request of Customer.
      So I duplicated the module and placed it under /site/modules/.
      I have added 3 new Settings to the InputfieldDatetime Module.
      1. Day Restriction - Restrict different days based on weekdays selection (e.g. saturday, sunday) - WORKING

       
      2. Time Slots - Define Time slots based on custom Integer Value (max is 60 for 1 hour) - WORKING

       
      3. Time Range Rules per Weekday - Define a minTime and MaxTime per Weekday (e.g. Opening Hours of a Restaurant) - NOT WORKING PROPERLY

       
      The Problem
      Time Slots and Day Restriction working fine so far. But the Time Range Rules per Weekday doesn't work right.
      What should happen is, that when you click on a date, it should update the minTime and maxTime of the Time Select.
      But the change on the select only happens if you select a date 2 times or when you select a date 1 time and then close the datepicker and reopen it again.
      The time select doesn't get change when you select a date 1 time and don't close the picker.
      Here is the whole extended InputfieldDatetime Module.
      The Files that I have changed:
      InputfieldDatetime.module InputfieldDatetime.js jquery-ui-timepicker-addon.js (https://trentrichardson.com/examples/timepicker/) - updated it to the newest version, because minTime and maxTime Option was only available in the new version  
      Thats the Part of the JS that is not working correctly:
      if(datetimerules && datetimerules.length){ options.onSelect = function(date, inst) { var day = $(this).datetimepicker("getDate").getDay(); day = day.toString(); var mintime = $(this).attr('data-weekday'+day+'-mintime'); var maxtime = $(this).attr('data-weekday'+day+'-maxtime'); console.log("weekday: "+day); console.log("minTime: "+mintime); console.log("maxTime: "+maxtime); var optionsAll = $(this).datetimepicker( "option", "all" ); optionsAll.minTime = mintime; optionsAll.maxTime = maxtime; $(this).datetimepicker('destroy'); $(this).datetimepicker(optionsAll); $(this).datetimepicker('refresh'); //$.datepicker._selectDate($(this).attr("id"),date); //$.datepicker._base_getDateDatepicker(); // var inst = $.datepicker._getInst($(this)); // $.datepicker._updateDatepicker(inst); /*$(this).datetimepicker('destroy'); InputfieldDatetimeDatepicker($(this), mintime, maxtime); $(this).datetimepicker('refresh'); */ // $(this).datetimepicker('option', {minTime: mintime, maxTime: maxtime}); } } Can you have a look and find out what the Problem is?
      InputfieldDatetime.zip
       
      Kind Regards
      Orkun
    • By teppo
      This module tracks changes, additions, removals etc. of public (as in "not under admin") pages of your site. Like it's name says, it doesn't attempt to be a version control system or anything like that - just a log of what's happened.
      At the moment it's still a work in progress and will most likely be a victim of many ruthless this-won't-work-let's-try-that-instead cycles, but I believe I've nailed basic functionality well enough to post it here.. so, once again, I'll be happy to hear any comments you folks can provide
      https://modules.processwire.com/modules/process-changelog/
      https://github.com/teppokoivula/ProcessChangelog
      How does it work?
      Exactly like it's (sort of) predecessor, Process Changelog actually consists of two modules: Process Changelog and Process Changelog Hooks. Hooks module exists only to serve main module by hooking into various functions within Pages class, collecting data of performed operations, refining it and keeping up a log of events in it's own custom database table (process_changelog.) Visible part is managed by Process Changelog, which provides users a (relatively) pretty view of the contents of said log table.
      How do you use it?
      When installed this module adds new page called Changelog under Admin > Setup which provides you with a table view of collected data and basic filtering tools See attached screenshots to get a general idea about what that page should look like after a while.
      For detailed installation instructions etc. see README.md.
       


    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




×
×
  • Create New...