Git Product home page Git Product logo

canary's People

Contributors

michaelrog avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

canary's Issues

[FR] Inline editor to fix template issues

For errors in Twig templates, it'd be dope if the dev can open a code editor right from the error page, and Cmd-S to save, which writes the change to disk and reloads the page.

  • For front-end templates (i.e. not CP/Craft/plugin templates)
  • if the user is logged in Admin
  • only in Dev Mode.

[FR] Link to Craft class reference

For classes/methods in Craft app files, link to the docs where appropriate.

  • For called methods that Craft owns
  • In classes that Craft owns

[FR] Add "Chirps" in the Debug tab

Projects that use the Canary package can add "Chirps" throughout their code, which are displayed in the Debug tab in chronological order, serving as "waypoints" in the code execution.

Canary::chirp("This is a message!", $someExtraInfo, $someOtherInfo)

[FR] Twig template awareness

For doDisplay frames in compiled Twig template classes, display the source template path rather than the compiled template class path.

(Code snippet will still show the doDisplay call from Template.php.)

Maybe still show the compiled class name, in the meta pane? (Would anybody ever need it?)

[FR] SuggestionProvider functionality

Exceptions that implement CanaryException contract can register Suggestions individually.

Additional SuggestionProvider classes can be registered on the system via config.

Each SuggestionProvider has a chance to visit a caught exception, and optionally register Suggestions on it at runtime.

[FR] Abbreviated mode

Shows only error & suggestion(s).

(Not stack frames, context, system vars, etc.)

  • Can be triggered as a default via system config, or when instantiating an individual Exception
  • Analogous to Error vs Exception display mode in Craft's ErrorHandler

Open questions:

  • Should it show a code snippet? (Is that a potential security risk for non-admins / non-dev-mode?

[FR] Suggestion objects

Rather than just a dumb string, a Solution can also be an object, which encapsulates:

  • Heading
  • Solution text (Markdown-parsed)
  • Array of invokable Solutions, keyed by caption/label

Plugin disregards 404 template in Production mode

We had an issue with our 404 template not showing in production and on a whim I disabled Canary and the 404 template showed up again.

This is the behavior in production mode when a 404 fires:
image (8)

I've added ./craft plugin/disable canary to my production deploy script so I can keep it on in dev and test environments, but it would be great if it didn't do that!

[FR] Add `ddd` function

Global function to "dump, die, and debug" โ€”

Will require a DumpDieDebug Exception. We should give special treatment to that Exception class in the handler, whereby instead of showing the typical error/code frame for the actual ddd() call, we show the dump instead (using Symfony VarDumper?).

Should take variable number of args โ€” ddd($thing1, $thing2, ...)

[FR] Invokable Solutions

Suggestions can register an invokable Solution class.

Only admins, in dev mode, can invoke Solutions.

The Solution accepts the Exception and invoking Suggestion as dependencies for context.

[FR] Errors inside Twig templates

If a frame is from a Twig template (i.e. the file is in storage/runtime/compiled_templates):

  • Display the source template path rather than the compiled class path
  • (Maybe still make the compiled class path available, in the meta pane?)
  • Show code snippet from source template, mapped back to original Twig line numbers.
  • Show a nice dump of the Twig context

[FR] Dark mode

  • By default, toggles based on user's system preference.
  • Dev can force light or dark mode all the time via config.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.