From f9d5203610ad000d71ac1ef56d02e90d187ec071 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 31 Jan 2023 11:09:54 +0000 Subject: [PATCH] DEV: Deprecate PluginOutlet tagName argument --- .../discourse/app/components/plugin-outlet.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/app/assets/javascripts/discourse/app/components/plugin-outlet.js b/app/assets/javascripts/discourse/app/components/plugin-outlet.js index 11a7f28641c..ef837a68314 100644 --- a/app/assets/javascripts/discourse/app/components/plugin-outlet.js +++ b/app/assets/javascripts/discourse/app/components/plugin-outlet.js @@ -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,