maailma / kansa

Open-source convention member services
Apache License 2.0
17 stars 6 forks source link

Kansa debug entrypoint #59

Closed heymatthew closed 5 years ago

heymatthew commented 6 years ago

As this codebase is rather dense and requires a lot of setup to have a single stood up server, it's important to get a feel for how the code is executing.

This PR introduces a new make target to allow you to open an interactive debugger against your local kansa to inspect the running code. This works for OSX.

To get a debugger open

  1. Run make debug from the root of the project
  2. Follow logs with docker logs -f kansa_kansa_1 | grep "Debugger listening on ws://"
  3. Take the application UUID printed out and substitute it into this URL in chrome:

chrome-devtools://devtools/bundled/js_app.html?ws=localhost:9229/e565eb6d-48ff-4dbe-8070-b6de4c30e2bd

screen shot 2018-09-04 at 6 36 26 pm

From there, you'll have an interactive debugging session where you can set breakpoints, watch for console.log printouts and more.

This is a WIP PR asking for early feedback.

TODO

heymatthew commented 5 years ago

This was an idea I threw together because I really wanted a REPL in the project to figure out the interactions between components. It turned out to be clunky and didn't generate much interest.

I'm closing this down because it's a stale concept and pretty easy to throw together again if you want to do this kind of debugging.