# Resolving the \`this-property-fallback\` deprecation

**URL:** https://meta.discourse.org/t/resolving-the-this-property-fallback-deprecation/337276
**Category:** Development
**Tags:** dev-news
**Created:** [November 21, 2024, 7:08pm UTC](https://meta.discourse.org/t/resolving-the-this-property-fallback-deprecation/337276 "2024-11-21T19:08:58Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [November 21, 2024, 7:08pm UTC](https://meta.discourse.org/t/resolving-the-this-property-fallback-deprecation/337276/1 "2024-11-21T19:08:58Z")

</div>

## 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](https://deprecations.emberjs.com/id/this-property-fallback/)

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:

```markdown
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](https://github.com/discourse/discourse-plugin-skeleton) and [the theme skeleton](https://github.com/discourse/discourse-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!

---

_[View the full topic](https://meta.discourse.org/t/resolving-the-this-property-fallback-deprecation/337276)._
