mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 13:32:45 +08:00
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:
parent
672f7523a1
commit
840ac6bd0a
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user