discourse/app/assets/javascripts/discourse-common
David Taylor 7e372b3a15
DEV: Restrict resolver lookups to known namespaces (#18599)
Ember's default resolver only looks for components/services/etc. which are namespaced under the app's `modulePrefix` (`discourse`, in our case). To use addon components/services/etc., the addon must re-export them in its `app/` directory.

In order to support plugins, our custom resolver does a 'suffix match'. This has an unintended side-effect of matching things which are not part of the discourse app or themes/plugins. We've come to rely on this for a few in-repo addons like `select-kit`, `admin` and `wizard`.

This unrestricted 'suffix matching' can cause some very unexpected behaviour. For example, the ember-inspector browser extension has a module called `ember_debug/service/session`. When looking up `service:session`, our resolver was choosing that third-party service over our own Session service. This means Discourse fails to boot when the Ember Inspector is open.

This commit restricts the 'suffix matching' to a known set of namespaces. This brings us one step closer to the default Ember Resolver implementation, and reduces the chance of unexpected behaviour like the ember-inspector issue.

This commit also updates the `dialog-holder` addon to export its service under the app directory, so that we don't need to account for it in the resolver. We may want to consider doing the same for things like `select-kit` and `truth-helpers`, but is beyond the scope of this commit.
2022-10-17 09:33:52 +01:00
..
addon DEV: Restrict resolver lookups to known namespaces (#18599) 2022-10-17 09:33:52 +01:00
app DEV: Make discourse-common an Ember addon. (#9578) 2020-04-29 12:18:21 -04:00
config DEV: Upgrade to Ember 3.28 2022-07-19 10:00:59 +01:00
tests DEV: Make addons buildable on their own (#17205) 2022-06-23 22:19:54 +02:00
vendor DEV: Make discourse-common an Ember addon. (#9578) 2020-04-29 12:18:21 -04:00
.npmrc DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
ember-cli-build.js DEV: Upgrade to Ember 3.28 2022-07-19 10:00:59 +01:00
index.js REFACTOR: Support bundling our admin section as an ember addon 2020-09-22 15:14:29 -04:00
package.json Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00