dev tools: invoke debugger/logger ineractively
Offen
Dieses Issue hat noch niemand übernommen.
feature
P3
- Vorherrschende Sprache
- Python
- Sterne
- 24.4k
- Forks
- 2.3k
- Ø Merge
- 2 T. 7 Std.
- Gemergte PRs (30 T.)
- 13
Beschreibung
Now that we have the callback graph in the dev tools UI, let's use that to enable interactive callback debugging!
- Use clicks on a callback in the graph, and you get extra debugging of that callback. Not sure what the UI looks like to choose one, but either:
- It becomes a breakpoint (maybe the callback circle changes from green to red?)
- It gets a verbose logger - in Python there's https://github.com/cool-RR/PySnooper for example (callback circle turns orange?)
- That flags this callback (based on its output list) for debugging, somewhere in the redux state.
- When any callback is triggered, we check this state and if the requested outputs are flagged, add a key to the request like
debug: ('breakpoint'|'logging') - On the back end, if we see such a key AND the app was run with
dev_tools_ui: True(we don't want hackers to be able to hang the back end or dig into back-end code from production apps!), we invoke the specified debugger:- For
breakpoint, wrap the callback inpdb.runcall, which startspdbat the beginning of the function, in the server console (eventually perhaps we could pull this to the front end, but that sounds like a much bigger project). Then it's up to the user to run the debugger and allow the function to finish and return. - For
loggingwe wrap the callback in the appropriatepysnoopercall, capture the output, and return it with the output data, and display it in the error console. - @rpkyle do both of these modes have equivalents in R?
- For
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit der Überprüfung des bestehenden callback graph in der dev tools UI und der Verarbeitung von callback requests im Backend. Das Issue lässt die Auswahl-UI und die Details der Protokollierung offen; für die Fertigstellung müsste eine Interaktion zum Setzen eines Breakpoints oder zur Protokollierung ausgewählt, diese Auswahl durch State und Requests weitergereicht und nur bei aktiviertem dev_tools_ui sicher aktiviert werden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python, react
- Bereich
- backend, devtools, frontend
- Issue-Typ
- Feature
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 25/100