Background
Essentially, if you’re using something like {{foo}}
in a handlebars template to reference a property on the controller/component, then it needs to be updated to {{this.foo}}
.
Upstream information: Property Fallback Lookup | Ember.js - Deprecations
To get Discourse through the Ember 4.x upgrade, we introduced a backwards-compatibility shim so that themes and plugins did not need to rush through this change. However, it’s not feasible to maintain this shim indefinitely, so we need to get themes and plugins updated to the modern syntax.
Deprecation
In the latest version of Discourse, using the legacy syntax will cause a deprecation message to be printed to the console. It’ll look something like this:
DEPRECATION: [PLUGIN discourse-calendar] The `loading` property path was used in the `discourse/plugins/discourse-calendar/discourse/templates/admin-plugins-calendar.hbs` template without using `this`. This fallback behavior has been deprecated, all properties must be looked up on `this` when used in the template: {{this.loading}}
As with any other deprecation, we will slowly increase the visibility of this warning, until we eventually remove the backwards-compatibility shim. We are tentatively targetting Q2 2025 for final removal, but will adjust that based on real-world data.
Upgrading your code
For small themes/plugins, you can update the templates manually to add this.
before any property name.
To make the transition easier for larger themes/plugins, we’ve introduced a new ember-template-lint rule which includes an auto-fixer.
So, if you use the latest version of our standard linting configuration (as per the plugin skeleton and the theme skeleton), then all affected code will be automatically updated next time you run ember-template-lint --fix
.
If you have any questions/concerns, please let us know below!