Introducing Discourse developer toolbar

When running the latest version of Discourse core in a development environment, you’ll notice a new toolbar on the left-hand-side of the screen:

This provides one-click access to commonly-needed developer tools. So far, we have:

:electric_plug: Plugin Outlet Debug

This shows all plugin outlets, with tooltips showing realtime values of all of the available @outletArgs.

This was inspired by the popular plugin outlet locations theme component, and the plugin before it. But unlike those, the tight integration with core means it can always be 100% up-to-date with the latest outlets & arguments.

:ambulance: Safe ​mode

Toggles safe mode on and off

:scroll: Verbose localization

Toggles the verbose localization feature


In development, this is enabled by default, and can be disabled using the ‘X’ button.

In production, it can be enabled by running enableDevTools() in the browser console. You can even try it here on Meta!

We hope to add more tools over the coming weeks/months, so watch this space! If you have any feedback, or ideas for tools, let us know below!

33 Likes

Clicking the :electric_plug: icon to show outlets makes Chrome crash, making the page/tab unresponsive. I disabled my Chrome extensions, but it still crashes.

More specifically, it crashes when clicking the icon while on a topic (not only on meta).

On Firefox/Edge, it works but there’s an error in the console:

Multiple connectors were registered for the discovery-list-area outlet. Using the first. 
Array [ undefined, "discovery-list-area/kanban-board (discourse/theme-351/discourse/connectors/discovery-list-area/kanban-board)" ]
3 Likes

I can reproduce it on Meta as well.

On Firefox, you can see that there is also a rendering infinite loop:

It works fine on a local dev installation, even with Kanban enabled. I see the same error, but there is no rendering loop.


By the way, thanks for bringing this tool, it’s really convenient, love it!

2 Likes

Huh! It definitely worked a few days ago, but now I see the same error. I’ll investigate - thanks for the reports!

6 Likes

Just merged this commit which will fix the infinite-rerendering on the topic page

8 Likes

Since I don’t see any way to do this on mobile, I’m working on a simple TC to add a button to the header (inspired by the Plugin Outlets TC).

When viewing a development environment on mobile, the toolbar will appear on the left of the screen so you can use it as normal.

In production environments, you’ll need to call enableDevTools() from the console (or from theme/theme-component javascript) to turn on the toolbar. Note that this has a performance cost, so you shouldn’t do it for all users on a real production site.

2 Likes

Yep. Users can click the button to activate dev tools for them. Not for all users.

1 Like