DEV: Update before-header-panel outlet arguments (#24796)

Passing through `attrs` is problematic for a few reasons:

1. Connectors could mutate it and cause issues in the parent widget

2. It doesn't provide a clean API boundary. The connector can access all attrs of the widget. As we move towards refactoring the header away from widgets, this may change. Better to explicitly call out the things we expect plugins/themes to access

3. `attrs` is a reserved property for classic components. Passing an argument called `attrs` into a classic component raises a 'computed property override' deprecation error under Ember 3.28, and causes an error in Ember 4+.

Unfortunately this will be a breaking change to the outlet. Fortunately, it was introduced fairly recently and does not have too many users. We will make immediate updates to themes/plugins we are aware of.

Followup to 9cc2b5cc20
This commit is contained in:
David Taylor 2023-12-08 17:02:25 +00:00 committed by GitHub
parent ce723caae2
commit 4adbcf3f2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -4,5 +4,5 @@ import { registerWidgetShim } from "discourse/widgets/render-glimmer";
registerWidgetShim(
"before-header-panel-outlet",
"div.before-header-panel-outlet",
hbs`<PluginOutlet @name="before-header-panel" @outletArgs={{hash attrs=@data}} /> `
hbs`<PluginOutlet @name="before-header-panel" @outletArgs={{hash topic=@data.topic}} /> `
);