Deprecating .hbs file extension in themes and plugins

david
Fri, 20 Mar 2026 16:48:11 +0000
Development

In the latest version of Discourse, using .hbs files in themes and plugins is deprecated. Support for this file format will be removed after the next ESR release.

Handlebars templates should be replaced with the more modern .gjs format, which provides a much better development experience, and will enable large performance improvements in future versions of Discourse.

For simple cases, share your code with https://ask.discourse.com/, and ask it to rewrite in the .gjs format.

For more complex cases, updates can be automated using using this codemod:

Automatically updating themes and plugins to .gjs file format Dev

In the latest version of Discourse’s standard linting config, we’ve enabled the require-strict-mode ember-template-lint rule. This will raise a linting error for any .hbs files. To resolve the warnings, you should convert all your component, route, and connector templates to .gjs files. To make this easy, we’ve built the discourse-gjs-codemod, which builds on top of Ember’s @embroider/template-tag-codemod. To use the codemod, first ensure that your linting dependencies are up-to-date by copyin…

18 posts - 8 participants