Skip to content

Commit 77c240e

Browse files
DEV: Drop deprecated PluginOutlet @tagName argument (#32770)
This has been deprecated with an admin warning for some time
1 parent 975fb92 commit 77c240e

File tree

3 files changed

+1
-59
lines changed

3 files changed

+1
-59
lines changed

app/assets/javascripts/discourse/app/components/plugin-outlet.gjs

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Component from "@glimmer/component";
22
import { cached } from "@glimmer/tracking";
3-
import ClassicComponent from "@ember/component";
43
import { concat } from "@ember/helper";
54
import { get } from "@ember/object";
65
import { getOwner } from "@ember/owner";
@@ -19,8 +18,6 @@ import {
1918

2019
const GET_DEPRECATION_MSG =
2120
"Plugin outlet context is no longer an EmberObject - using `get()` is deprecated.";
22-
const TAG_NAME_DEPRECATION_MSG =
23-
"The `tagName` argument to PluginOutlet is deprecated. If a wrapper element is required, define it manually around the outlet call. Using tagName will prevent wrapper PluginOutlets from functioning correctly.";
2421
const ARGS_DEPRECATION_MSG =
2522
"PluginOutlet arguments should now be passed using `@outletArgs=` instead of `@args=`";
2623

@@ -67,12 +64,6 @@ export default class PluginOutletComponent extends Component {
6764
constructor() {
6865
const result = super(...arguments);
6966

70-
if (this.args.tagName) {
71-
deprecated(`${TAG_NAME_DEPRECATION_MSG} (outlet: ${this.args.name})`, {
72-
id: "discourse.plugin-outlet-tag-name",
73-
});
74-
}
75-
7667
if (this.args.args) {
7768
deprecated(`${ARGS_DEPRECATION_MSG} (outlet: ${this.args.name})`, {
7869
id: "discourse.plugin-outlet-args",
@@ -133,39 +124,8 @@ export default class PluginOutletComponent extends Component {
133124
);
134125
}
135126

136-
// Older plugin outlets have a `tagName` which we need to preserve for backwards-compatibility
137-
get wrapperComponent() {
138-
return PluginOutletWithTagNameWrapper;
139-
}
140-
141127
<template>
142-
{{~#if @tagName~}}
143-
{{!
144-
Older outlets have a wrapper tagName. RFC0389 proposes an interface for dynamic tag names, which we may want to use in future.
145-
But for now, this classic component wrapper takes care of the tagName.
146-
}}
147-
<this.wrapperComponent @tagName={{@tagName}}>
148-
{{~#each (this.getConnectors) as |c|~}}
149-
{{~#if c.componentClass~}}
150-
<c.componentClass @outletArgs={{this.outletArgsWithDeprecations}} />
151-
{{~else if @defaultGlimmer~}}
152-
<c.templateOnly @outletArgs={{this.outletArgsWithDeprecations}} />
153-
{{~else~}}
154-
<PluginConnector
155-
@connector={{c}}
156-
@args={{this.outletArgs}}
157-
@deprecatedArgs={{@deprecatedArgs}}
158-
@outletArgs={{this.outletArgsWithDeprecations}}
159-
@tagName={{or @connectorTagName ""}}
160-
@layout={{c.template}}
161-
class={{c.classicClassNames}}
162-
/>
163-
{{~/if~}}
164-
{{~/each~}}
165-
</this.wrapperComponent>
166-
{{~else if (this.connectorsExist hasBlock=(has-block))~}}
167-
{{! The modern path: no wrapper element = no classic component }}
168-
128+
{{#if (this.connectorsExist hasBlock=(has-block))~}}
169129
{{~#if (has-block)~}}
170130
<PluginOutlet
171131
@name={{concat @name "__before"}}
@@ -208,5 +168,3 @@ export default class PluginOutletComponent extends Component {
208168
{{~/if~}}
209169
</template>
210170
}
211-
212-
class PluginOutletWithTagNameWrapper extends ClassicComponent {}

app/assets/javascripts/discourse/app/services/deprecation-warning-handler.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const CRITICAL_DEPRECATIONS = [
1717
"discourse.bootbox",
1818
"discourse.add-header-panel",
1919
"discourse.header-widget-overrides",
20-
"discourse.plugin-outlet-tag-name",
2120
"discourse.add-flag-property",
2221
"discourse.breadcrumbs.childCategories",
2322
"discourse.breadcrumbs.firstCategory",

app/assets/javascripts/discourse/tests/integration/components/plugin-outlet-test.gjs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1026,21 +1026,6 @@ module(
10261026
}
10271027
);
10281028

1029-
module("Integration | Component | plugin-outlet | tagName", function (hooks) {
1030-
setupRenderingTest(hooks);
1031-
1032-
test("supports the `@tagName` argument", async function (assert) {
1033-
await withSilencedDeprecationsAsync(
1034-
"discourse.plugin-outlet-tag-name",
1035-
async () =>
1036-
await render(
1037-
<template><PluginOutlet @name="test-name" @tagName="div" /></template>
1038-
)
1039-
);
1040-
assert.dom("div").exists();
1041-
});
1042-
});
1043-
10441029
module(
10451030
"Integration | Component | plugin-outlet | legacy extraConnectorClass",
10461031
function (hooks) {

0 commit comments

Comments
 (0)