Introducing a 'js' tab for local themes

In the latest version of Discourse, we’ve introduced a new “JS” tab to the admin theme editor:

Behind-the-scenes, this corresponds to a file named javascripts/discourse/api-initializers/theme-initializer.gjs.

Our recommendation for most themes is still that they should be authored using a proper IDE, the discourse_theme CLI, and version-controlled using git. However, we understand that this isn’t a good fit for everyone, and that there’s still a place for simple admin-panel-authored themes.

This change means that everyone will be able to move towards more modern syntaxes, and away from the old <script> patterns. Over the next few weeks, we’ll be updating the Documentation > Developer Guides to describe the more modern (g)js patterns.

Let us know if you have any questions or feedback!

11 Likes