DEV: Avoid using @tracked as a decorator in RenderGlimmer object literal

Decorators in object literals are non-standard, and we're working to remove them.
This commit is contained in:
David Taylor 2024-04-17 15:19:23 +01:00 committed by GitHub
parent 672f7523a1
commit 840ac6bd0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 3 deletions

View File

@ -152,13 +152,13 @@ export default class RenderGlimmer {
component.name = "Widgets/RenderGlimmer";
setComponentTemplate(template, component);
this._componentInfo = {
this._componentInfo = new ComponentInfo({
element,
component,
@tracked data: this.data,
data: this.data,
setWrapperElementAttrs: (attrs) =>
this.updateElementAttrs(element, attrs),
};
});
this.parentMountWidgetComponent.mountChildComponent(this._componentInfo);
}
@ -209,3 +209,14 @@ export function registerWidgetShim(name, tagName, template) {
createWidgetFrom(RenderGlimmerShim, name, {});
}
class ComponentInfo {
@tracked data;
element;
component;
setWrapperElementAttrs;
constructor(params) {
Object.assign(this, params);
}
}