adrian

Tracy Debugger

Recommended Posts

Thanks for the penflip suggestion. I am hesitant to host the docs somewhere else though.

I am actually tempted to just use the README.md file and make use of a Table of Contents to make it easier to navigate. In some ways this is better than the pagination options in the wiki and in some ways worse.

I am also looking at the possibility of using Github pages, but that means a "docs" subfolder (which would be included in module installs), or a separate "pages" repo. Doesn't seem like there is anything really ideal, although maybe having offline docs with a module would be an advantage despite the larger download. Maybe the PW modules interface could actually read and display the contents of the docs folder? That could actually be really cool - offline docs available directly from within PW. Anyone interested in supporting a request for this from Ryan? Or maybe it could be built initially as a module. Of course it would only be useful if module authors were to get on board, so it might take some time before it was actually useful.

 

Thanks @bernhard and @szabesz for the donation button push. There are so many people here who do lots for the PW community, I never wanted to put pressure on anyone for donations. Also not sure how effective it will really be. If the plan is to do less client work and more PW modules, then I think you need a more robust/reliable source of income that might come from a killer paid module, or a module with a free and pro version. Obviously getting way OT here though.

 

  • Like 1

Share this post


Link to post
Share on other sites

I'm not a fan of docs as part of modules. Maybe its just me but I like to keep the codebase as light as possible. Also, we've been asking for "changelog" support in ProcessWire so it is hard to see why docs support would get priority but one never knows :) 

11 minutes ago, adrian said:

I am hesitant to host the docs somewhere else though.

I understand this but if that tool can export in a format which makes it possible to migrate the whole stuff – just in case – then why not give it a try? I'm not pushing penflip.com as I have only read its homepage, I just like tools which are designed for a specific need. As long as they work well, of course...

  • Like 1

Share this post


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

I never wanted to put pressure on anyone for donations

i think most of us can handle this pressure :D of course it will not pay back the time invested but it's nice to have the possibility to say thank you. but of course if someone wants to invest more time on a module making it commercial is totally fine. i'm also thinking about that topic...

regarding the docs i would love to see some kind of standardisation here. maybe someone knows a good solution already.

  • Like 1

Share this post


Link to post
Share on other sites
30 minutes ago, szabesz said:

I'm not a fan of docs as part of modules. Maybe its just me but I like to keep the codebase as light as possible.

Well if there is no support by PW for reading and displaying the content in the /docs folder, it can easily be excluded from downloads using .gitattributes in the repo:

docs export-ignore

will ensure it is not downloaded when you install the module.

This way I could have a dedicated docs pages for Tracy hosted on Github Pages and you guys could submit PRs to help (which would be hugely appreciated). I'd love to see lots of screenshots and examples - this could work out really nicely I think. To that end, I have set up a new docs page at: https://adrianbj.github.io/TracyDebugger/

I have checked and the docs folder is correctly excluded from the download, so I think we should be good to go to start working on these docs. I have set the theme to the default "Cayman" for now, but may change as I learn more about Github Pages.

I'll set up a basic structure and then hope to see some pull requests from you guys. Does that look / sound ok?

  • Like 2

Share this post


Link to post
Share on other sites

Hi @adrian,

What do you think about adding a way to label dumps in the console, similar to what is possible with barDump?

So you could do:

d($foo, 'Foo');
d($bar, 'Bar');

This would help to identify which dump is which.

  • Like 1

Share this post


Link to post
Share on other sites

Hey @Robin S - how's this?

The only thing I am concerned about is the lack of delineation between "2" and the untitled "3", but the Dumps panel with bd() calls has the same problem which is a Tracy core thing anyway. I think this is probably ok - if you feel the need to title dumps, then you'll probably title them all.

The other frustration (which also affects the Dumps panel), is the need for specifying a title if you need to adjust the maxDepth or maxLength setting because of the order of the function arguments. I have thought about maybe checking if the second argument is an array, then assume it's the maxDepth/maxLength etc options, and not intended to be the title. This approach always feels hacky to me though - any thoughts?

5a0a34d93ca62_ScreenShot2017-11-13at4_11_04PM.png.763d8c28ab0659b4bf567463c7525f68.png

Share this post


Link to post
Share on other sites

Or maybe this is a little nicer?

This looks more like the output of the Dumps panel - there really is no point to that blue background in the entire results div.

5a0a37c164947_ScreenShot2017-11-13at4_23_52PM.png.34fa978ae54ed87c55f94790ae81c883.png

  • Like 1

Share this post


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

Or maybe this is a little nicer?

Maybe remove the space between the label and the dump output?

5a0a37c164947_ScreenShot2017-11-13at4_23_52PM_edit.png.158e56fae704a35cc26e8953d5cf6789.png

1 hour ago, adrian said:

I have thought about maybe checking if the second argument is an array, then assume it's the maxDepth/maxLength etc options, and not intended to be the title. This approach always feels hacky to me though - any thoughts?

Ryan does that sort of thing all through the core so I figure it's not too hacky. :-)

  • Like 1

Share this post


Link to post
Share on other sites

@Robin S - I've been playing a little more with this. I decided to do the check to see if the second parameter is an array or not. It still feels hacky, but I do like not having to add a title when I just want to adjust maxDepth/maxLength, so I think it's worth it.

I also tried removing the space between the label and the dump output (which I just got your reply about right now :)) and I think that works nicely.

What do you think - does this look ready to go?

BTW, I have also made both these changes to the Dumps panel.

5a0a46783030f_ScreenShot2017-11-13at5_26_37PM.png.c53d7853cb7e8dd3521847e2d53c4f3d.png

  • Like 2

Share this post


Link to post
Share on other sites

@Robin S - I have committed a new version with these changes - let me know if you see anything amiss.

Cheers!

  • Like 1

Share this post


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

It still feels hacky, but I do like not having to add a title when I just want to adjust maxDepth/maxLength, so I think it's worth it.

Could you just pass null as the title argument in that case? Or is that just as much hassle?

38 minutes ago, adrian said:

What do you think - does this look ready to go?

Looks great to me.

  • Like 1

Share this post


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

Could you just pass null as the title argument in that case? Or is that just as much hassle?

Yeah, you could pass null, but I do think it's just as much hassle, so went with the "hack". I know it's used in the PW core and l've seen it lots of other places and used it myself - it just feels dirty, but in this case, I don't think it will get out of hand and makes it much simpler to use. 

  • Like 2

Share this post


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

I have committed a new version with these changes

Thanks for the speedy implementation!

  • Like 1

Share this post


Link to post
Share on other sites
On 11/14/2017 at 6:01 AM, bernhard said:

@adrian just wanted to make sure you didn't miss my quick note ;)

Sorry, @bernhard - yes I did see it. I haven't investigated fully yet. I am still not totally convinced of the right way to go - the Github Pages site is ready to go and can accept PRs, but @netcarver also has something cool up his sleeve:

 

Amongst its many features, makes the ReadMe file viewable from the Module settings within PW, so maybe that is actually a good place for docs after all?

tracy-003.thumb.png.5467e2bec05728934d1a68174201c261.png.54a33f28264cfa0e13866f8d6c49e0e2.png

So, not forgotten, just percolating. 

Thanks again for the suggestion!

  • Like 1

Share this post


Link to post
Share on other sites

Hi everyone,

Relatively major new version just released:

1) New run on init, ready, finished option in Console panel

I am not sure how popular this will be, but it lets you inject code from the Console panel into the PW process at init, ready, or finished. This lets you test hooks and other code that you would normally add to the init.php, ready.php, or finished.php files without having to edit files, and also without affecting anyone else viewing or working on the site.

This screenshot should give you the idea:

5a10762b6221f_ScreenShot2017-11-18at10_03_51AM.png.ce211162e5759adafc5d50ce52670be5.png

As you can see, I have added a hook to change the page title on saveReady. 

The way it currently works is that you:

  • enter your code
  • click Run to "register" the code for the next page request
  • select "init", "ready", or "finished" as the place to have it injected
  • In this example, you would then save the current page and the hook would be injected into init() and the page title will change

If you don't switch back to "off" when you are done testing, it will expire in 5 minutes.

The Console panel icon will also change to a red color to provide a visual indicator that you have an injection running on each page request.

Please give me feedback on this feature - if you guys are annoyed by having those options visible and you never plan on using this, I'll make it an option that can be turned off completely.

 

2) Make User Switcher available without setting to "DEVELOPMENT" mode

When I initially built the User Switcher I was a little paranoid about the possible security implications so went a little overboard by making it only available when hardcoded to DEVELOPMENT mode. But in reality this didn't make any difference and just made it more difficult to use, so now you'll find it easier to use - it's such a great feature! If you haven't used it, give it a go!

5a171801aa5ac_ScreenShot2017-11-23at10_48_16AM.png.851d301bc0a866af845caab6a1a8494e.png

 

3) Options to hide debug bar from Form Builder iframe

Having the debug bar in a Form Builder iframe can be useful, but also a visual annoyance so now you can disable if you want.

 

4) Hide User Bar from Form Builder iframe

This is automatic as there is no reason for the User Bar to appear in a Form Builder iframe and it is confusing for users and ugly.

 

5) Restricted panels now works with "tracy-restricted-panels" role as well as permission (needed due to recent PW core change)

Due to a recent change in the PW core, it is no longer possible to edit the permissions for the superuser role, so I have now added support for assigning a "tracy-restricted-panels" role to a user. The "Restricted Panels" defined will then be applied to users with this role. The permission option will continue to work for other non-superusers.

 

6) ACE editor update

7) Other bug fixes / tweaks

  • Like 8

Share this post


Link to post
Share on other sites
2 hours ago, adrian said:

3) Options to hide debug bar from Form Builder iframe

Having the debug bar in a Form Builder iframe can be useful, but also a visual annoyance so now you can disable if you want.

 

4) Hide User Bar from Form Builder iframe

This is automatic as there is no reason for the User Bar to appear in a Form Builder iframe and it is confusing for users and ugly.

Cool to have a dedicated option for these, but 3 and maybe 4 have been possible for a while now via the "No Debug Bar in Selected Templates" feature (the Form Builder iframe was what prompted my request for that feature ). :-)

  • Like 1

Share this post


Link to post
Share on other sites

@adrian These additions are great. I think the new console function is very useful. Thank you for all your efforts.

  • Like 2

Share this post


Link to post
Share on other sites

This is a minor change, but I am actually really excited by it :)

The Console panel now supports running just the selected code. 

I often find myself using the Console panel to test variations of code to see which is faster / more efficient. The time and memory usage is displayed after each request, but it's often a bit of a pain to keep commenting out some of the code, testing it, and then uncommenting that and commenting out the other, etc.

Now you can have multiple functional bits of code and just run one at a time.

You can see in these examples that I am selecting different chunks of code to be run and I can clearly see which one uses more time and memory.

5a19a2407a3a2_ScreenShot2017-11-25at9_02_27AM.png.81c27613461fd2355d4ce8e28e6e3065.png

5a19a2413fdd5_ScreenShot2017-11-25at9_02_08AM.png.4548706ff86f8a670e7bd45fa164d440.png

  • Like 9

Share this post


Link to post
Share on other sites

Sorry for the quick follow up.

The latest version now supports non-contiguous and partial line selections, so now you can do this:

5a19bb03eddd8_ScreenShot2017-11-25at10_42_22AM.png.2648edc489066f9f0faf888c4fc3a52c.png

Note the partial line selections in this example:

5a19bcd1e6e81_ScreenShot2017-11-25at10_55_44AM.png.a12cc3cd79011be588f7199b2a0f78df.png

 

  • Like 3

Share this post


Link to post
Share on other sites

Continuing on from yesterday's Console enhancements:

1) History stack now supports the state of text selection and the scroll position, so now much easier to run different versions without reselecting.

2) This selection and scroll position state is also recorded as you edit so it is also available if you reload your browser, etc so everything will be as you left it.

3) The editor window within the console should now always get focused when the panel itself is made visible (by hover or click). Previously this wasn't reliable. This makes running code much easier because the keyboard shortcuts for running will work without needing to click into the editor window to focus it.

historystack.gif.2ea1d55a8b34355be39aaf44183e21f3.gif

Unrelated to the Console panel - I have made the "Show debug bar in backend" checked by default on module install. Of course you can always uncheck this, but I find the debug bar just as useful in the backend, especially the Request Info panel when editing a page, template, field, or module settings. So consider this an attempt to enlighten new users to the benefits of it in the backend because I am sure many never bother to enable it.

Please let me know if you find anything amiss with the new Console functionality.

  • Like 3

Share this post


Link to post
Share on other sites

sorry for my confusion, but didn't the P icon used to have a link to edit the page being viewed? I used to use this all the time to get from front end to backend edit page - was that link moved somewhere - the appearance of that P panel seems to have changed a lot.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By BitPoet
      MediaLibrary
      Update: MediaLibrary can now be found in the official module list.
      Out of necessity, I've started to implement a simple media library module.
      The basic mechanism is that it adds a MediaLibrary template with file and image fields. Pages of this type can be added anywhere in the page tree.
      The link and image pickers in CKEditor are extended to allow quick selection of library pages from dropdowns. In the link picker this happens in the MediaLibrary tab, where you can also see a preview of the selected image. In the image picker, simply select a library from the dropdown at the top, everything else is handled by standard functionality.
      I've put the code onto github. This module is compatible with ProcessWire 3.
      Steps to usage:
      Download the module's zip from github (switch to the pw3 branche beforehand if you want to test on PW 3.x) and unpack it into site/modules Click "Modules" -> "Refresh" in the admin Click "Install" for MediaLibrary For testing, create a page with the MediaLibrary template under home (give it an expressive title like 'Global Media') and add some images and files Edit a differnt page with a CKEditor field and add a link and an image to see the MediaLibrary features in action (see the screencap for details) Optionally, go into the module settings for MediaLibrary Note: this module is far from being as elaborate as Kongondo's Media Manager (and doesn't plan to be). If you need a feature-rich solution for integrated media management, give it a look.
      Feel free to change the settings for MediaFiles and MediaImages fields, just keep the type as multiple.
      There are some not-so-pretty hacks for creating and inserting the correct markup, which could probably be changed to use standard input fields, though I'm a bit at a loss right now how to get it to work. I've also still got to take a look at error handling before I can call it fit for production. All feedback and pointers are appreciated (that's also why I post this in the development section).

      Edit 09.03.2016 / version 0.0.4: there's now also a "Media" admin page with a shortcut to quickly add a new library.

      Edit 01.05.2016:
      Version 0.0.8:
      - The module now supports nested media libraries (all descendants of eligible media libraries are also selectable in link/image picker).
      - There's a MediaLibrary::getPageMediaLibraries method you can hook after to modify the array of available libraries.
      - You can switch between (default) select dropdowns or radio boxes in the module configuration of MediaLIbrary to choose libraries.
      Edit 10.10.2018:
      Version 0.1.3:
      - Dropped compatibility for ProcessWire legacy versions by adding namespaces
      - Allow deletion of libraries from the Media overview admin page
      - Added an option to hide media libraries from the page tree (optionally also for superusers)
    • By Robin S
      This module corrects a few things that I find awkward about the "Add New Template" workflow in the PW admin. I opened a wishlist topic a while back because it would good to resolve some of these things in the core, but this module is a stopgap for now.
      Originally I was going to share these as a few standalone hooks, but decided to bundle them together in a configurable module instead.
      Add Template Enhancements
      A module for ProcessWire CMS/CMF. Adds some efficiency enhancements when adding or cloning templates via admin.

      Features
      Derive label from name when new template added: if you like to give each of your templates a label then this feature can save some time. The label can be added automatically when templates are added in admin, in admin/API, or not at all. There are options for underscore/hyphen replacement and capitalisation of the label. Edit template after add: when adding only a single template, the template is automatically opened for editing after it is added. Copy field contexts when cloning: this copies the field contexts (a.k.a. overrides such as column width, label and description) from the source template to the new template when using the "Duplicate/clone this template?" feature on the Advanced tab. Copy field contexts when duplicating fields: this copies the field contexts if you select the "Duplicate fields used by another template" option when adding a new template. Usage
      Install the Add Template Enhancements module.
      Configure the module settings according to what suits you.
       
      https://github.com/Toutouwai/AddTemplateEnhancements
      https://modules.processwire.com/modules/add-template-enhancements/
    • By Mike Rockett
      As I mentioned in this issue, I've create a new textformatter for ParsedownExtraPlugin, which adds some oomph to your markdown.
      Repo: Parsedown Extra Plugin
      Unlike the built-in textformatter for Parsedown and Parsedown Extra, this should be used when you want to use Extra with additional configuration/customisation.
      Some examples:
      ### Test {.heading} - A [external link](https://google.com/){.google} with `google` as a class that opens in a new tab if the config property is set. - [Another link](/page){target=_blank} that opens in a new tab even though it isn't external. ```html .html <p>Test</p> ``` There's some config options available to you, such as setting attributes on all/external images and links, setting table and table-cell alignment classes, adjusting footnote classes and IDs, adding <code> attributes to their parent <pre> elements, and changing the <code> class if your syntax highlighter does not use language-*.
      I was thinking about adding the ability to make links open in a new tab by appending a plus to the link syntax, but only external links should be opening in a new tab anyway. Further, this would add extra, unnecessary processing time.
      Please let me know if you bump into any problems. ☺️
    • By Mike Rockett
      TextformatterTypographer (0.4.0 Beta)
      A ProcessWire wrapper for the awesome PHP Typography class, originally authored by KINGdesk LLC and enhanced by Peter Putzer in wp-Typography. Like Smartypants, it supercharges text fields with enhanced typography and typesetting, such as smart quotations, hyphenation in 59 languages, ellipses, copyright-, trade-, and service-marks, math symbols, and more.
      Learn more on my blog
      It's based on the PHP-Typography library found over at wp-Typography, which is more frequently updated and feature rich that its original by KINGdesk LLC.
      The module itself is fully configurable. I haven't done extensive testing, but there is nothing complex about this, and so I only envisage a typographical bug here and there, if any.
      Please do test it out and let me know what you think.
      Also note that I have indicated support for PW 2.8, but I haven't tested there as yet. This was built on PW 3.0.42/62.
    • By Mike Rockett
      Jumplinks for ProcessWire
      Release: 1.5.50
      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!