dev tools: invoke debugger/logger ineractively
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 24.4k
- Fork
- 2.3k
- Merge medio
- 2g 7h
- PR unite (30g)
- 13
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia esaminando il callback graph esistente nella dev tools UI e la gestione delle callback requests nel backend. L’issue lascia da decidere la UI di selezione e i dettagli del logging; per completare il lavoro sarebbe necessario scegliere un’interazione di breakpoint o di logging, trasferire questa scelta attraverso lo state e le requests e attivarla in modo sicuro solo quando dev_tools_ui è abilitato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, react
- Ambito
- backend, devtools, frontend
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100