discourse/app/assets/javascripts
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
..
admin Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
confirm-new-email DEV: Update linting setup and fix issues (#17345) 2022-07-06 10:37:54 +02:00
discourse DEV: Restrict resolver lookups to known namespaces (#18599) 2022-10-17 09:33:52 +01:00
discourse-common DEV: Restrict resolver lookups to known namespaces (#18599) 2022-10-17 09:33:52 +01:00
discourse-ensure-deprecation-order DEV: Silence 3.x deprecations 2022-07-19 10:00:59 +01:00
discourse-hbr Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
discourse-plugins Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
discourse-widget-hbs Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
docs
ember-addons
ember-cli-progress-ci DEV: Add progress output in CI during ember-cli build (#17977) 2022-08-17 22:39:52 +01:00
locales FEATURE: Add Croatian language (#17130) 2022-06-18 00:18:22 +02:00
pretty-text Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
select-kit Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
truth-helpers Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
wizard Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00
.licensee.json DEV: Add Ember CLI workspace license checks (#16603) 2022-05-03 13:06:19 -04:00
.npmrc
discourse-js-processor.js DEV: Use DiscourseJsProcessor for theme template compilation (#18135) 2022-09-01 11:50:46 +01:00
handlebars-shim.js
mini-loader.js DEV: Support inline-hbs compilation in themes (#18112) 2022-08-29 19:53:42 +01:00
package.json DEV: Introduce flag for compiling Plugin JS with Ember CLI (#17965) 2022-08-22 09:56:39 +01:00
polyfills.js DEV: Add polyfill for String.prototype.replaceAll (#16301) 2022-03-28 17:18:56 +01:00
service-worker.js.erb DEV: Rename secure_media to secure_uploads (#18376) 2022-09-29 09:24:33 +10:00
yarn.lock Build(deps): Bump ember-auto-import in /app/assets/javascripts (#18618) 2022-10-16 23:57:28 +02:00