DEV: Deprecate PluginOutlet tagName argument

This commit is contained in:
David Taylor 2023-01-31 11:09:54 +00:00
parent 15b546978f
commit f9d5203610
1 changed files with 14 additions and 0 deletions

View File

@ -14,6 +14,8 @@ const PARENT_VIEW_DEPRECATION_MSG =
"parentView should not be used within plugin outlets. Use the available outlet arguments, or inject a service which can provide the context you need.";
const GET_DEPRECATION_MSG =
"Plugin outlet context is no longer an EmberObject - using `get()` is deprecated.";
const TAG_NAME_DEPRECATION_MSG =
"The `tagName` argument to PluginOutlet is deprecated. If a wrapper element is required, define it manually around the outlet call.";
/**
A plugin outlet is an extension point for templates where other templates can
@ -56,6 +58,18 @@ export default class PluginOutletComponent extends GlimmerComponentWithDeprecate
},
};
constructor() {
const result = super(...arguments);
if (this.args.tagName) {
deprecated(`${TAG_NAME_DEPRECATION_MSG} (outlet: ${this.args.name})`, {
id: "discourse.plugin-outlet-tag-name",
});
}
return result;
}
get connectors() {
return renderedConnectorsFor(
this.args.name,