Hey folks, the debugtoolbar has undergone a massive number improvements. Most of the changes are under the hood or for debugtoolbar addon developers that want to provide custom panels.
Here are the user-facing highlights:
- The toolbar now keeps the same panel active when switching between requests.
- The toolbar now emits a warning and does not activate when running on a multiprocessing / forking web server. Previously it was not clear to users why the toolbar was not showing up.
- Added an event source polyfill to provide a working toolbar on browsers that do not support server-sent-events directly (microsoft edge, internet explorer).
- The "debugtoolbar.panels" (and related settings) accept panel names instead of dotted python paths making them simpler to use.
- The toolbar is now explicitly over pyramid_tm such that it follows more of the critical request lifecycle.
- Sometimes the BeforeRender events would fail to show up in the toolbar due to the order in which libraries were included. The toolbar should consistently be able to see other library's BeforeRender events now.
Here are some highlights for developers writing custom panels:
- The toolbar has grown full support for the "debugtoolbar.includes" setting and it is now the recommended way to add custom panels to an application.
- Inside of an includeme function included via "debugtoolbar.includes" it is possible to add custom panels via "config.add_debugtoolbar_panel" and write actions that affect the parent application via "config.inject_parent_action". More features will be added to further extend the toolbar application as necessary.
- Custom panels can access a "request.toolbar_panels" dictionary from within "render_content" and "render_vars" to view captured data from other panels.