This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse
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
..
app FEATURE: Add sidebar link for admin to configure default tags (#18593) 2022-10-17 12:08:32 +08:00
config DEV: Enable jquery-integration runtime deprecation (#18057) 2022-08-23 19:28:22 +01:00
lib DEV: Restrict resolver lookups to known namespaces (#18599) 2022-10-17 09:33:52 +01:00
public/assets/scripts DEV: Use DiscourseJsProcessor for theme template compilation (#18135) 2022-09-01 11:50:46 +01:00
scripts DEV: Compile splash screen JS with ember-cli before inlining (#18150) 2022-09-01 09:58:48 +01:00
tests FEATURE: Add sidebar link for admin to configure default tags (#18593) 2022-10-17 12:08:32 +08:00
.ember-cli REFACTOR: Sync up master with changes for Ember-CLI (#11671) 2021-01-12 10:13:21 -05:00
.npmrc DEV: Prevent npm usage (#13945) 2021-08-04 22:04:58 +02:00
ember-cli-build.js DEV: Use npm for forked backburner.js version (#18559) 2022-10-12 11:14:41 +01:00
jsconfig.json DEV: Add jsconfig (#17800) 2022-08-04 22:50:47 +01:00
package.json Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
testem.js DEV: Fix testem output (#18609) 2022-10-16 19:38:20 +02:00