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/lib
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
..
bootstrap-json DEV: Remove support for legacy plugin JS compilation pipeline (#18293) 2022-09-21 12:38:02 +01:00
dialog-holder DEV: Restrict resolver lookups to known namespaces (#18599) 2022-10-17 09:33:52 +01:00
discourse-scss.js DEV: Make sass deprecations quieter during test build (#17369) 2022-07-07 11:03:16 +01:00
plugin-js.js DEV: Update plugin JS loading in Ember CLI testem environment 2022-01-18 10:16:29 +00:00
pretty-text-engine.js DEV: Compile markdown-it-bundle with ember-cli (#18104) 2022-08-29 19:11:59 +01:00
scripts.js FIX: Transpile start-discourse.js to fix iOS12 support (#18149) 2022-08-31 15:15:19 +01:00
translation-plugin.js DEV: Make wizard an ember addon (#17027) 2022-06-17 14:50:21 +02:00