10 Commits

Author SHA1 Message Date
Jarek Radosz
038e5deb2a
DEV: Clean up imports ()
* `@ember/owner` instead of `@ember/application`
* `discourse-i18n` instead of `I18n`
* `{ service } from "@ember/service"` instead of `inject as service`
2024-07-25 15:09:06 +02:00
Jarek Radosz
cbe4b3d7d8
DEV: Add more details to getOwner deprecation ()
Co-authored-by: David Taylor <david@taylorhq.com>
2024-01-19 14:36:05 +01:00
David Taylor
8958b4f76a
DEV: Rename custom getOwner to getOwnerWithFallback ()
Our custom implementation of `getOwner` includes a fallback which returns an owner, even if the passed object does not have one set. This is confusing and creates a false sense of security. Generally if the fallback is used, it means there is a problem with the patterns being used.

This commit renames our custom implementation to `getOwnerWithFallback`, while maintaining the old `getOwner` export with a deprecation notice. Core code is updated to use the official `@ember/application` implementation, or the new `getOwnerWithFallback` function.

This commit updates all core uses of `{ getOwner } from discourse-common/lib/get-owner` to use `getOwnerWithFallback`. Future commits will work through and convert many of these to use the official `@ember/application` implementation
2023-09-26 14:30:52 +01:00
David Taylor
1b693d0d60
DEV: Set owner on widget instances ()
This allows us to use `getOwner(this)` on widgets (without needing to resort to our custom `discourse-common/lib/get-owner` implementation which has a hacky fallback)
2023-07-03 17:34:24 +01:00
David Taylor
392bafcd7e
DEV: Add unique ids to deprecations ()
This will improve the QUnit deprecation summaries introduced via 8c482851454d2a2aead6f072950bdbfae10a46a1
2022-11-16 10:00:39 +00:00
Roman Rizzi
bbe5d8d5cf
DEV: Sort imports alphabetically () 2020-12-01 15:31:26 -03:00
Joffrey JAFFEUX
52672b9eab
DEV: apply new coding standards () 2020-09-04 13:42:47 +02:00
Robin Ward
a3fb732b23 REFACTOR: We can reuse getOwner for some container stuff 2020-08-25 09:16:32 -04:00
Robin Ward
347a4981a0 REFACTOR: Remove Discourse constant from get-owner 2020-08-25 09:16:32 -04:00
Robin Ward
cbb27241c4
DEV: Make discourse-common an Ember addon. ()
This is to help with the migration to Ember CLI. In the current running
version of Discourse everything should be the same as before, just with
a few extra files that are not used. However, using Ember CLI this can
be installed as an Ember addon.

Co-Authored-By: Jarek Radosz <jradosz@gmail.com>
2020-04-29 12:18:21 -04:00