JSON Forms: Investigate performance issues
User Story
As a integrator I want the UI to feel snappy, so that I can quickly configure the assets I want.
Description
The JSON Forms re-renders for each input present even though only 1 value is changed.
Acceptance Criteria
- [ ] 1. The frontend inputs render faster
Implementation Notes
Seems that @Hackerberg43 may have resolved the issue https://github.com/openremote/openremote/compare/master...Hackerberg43:openremote:enhancement/or-asset-viewer-updating
Also the edit page seems to be saving values to the database (without pressing save), which shouldn't be happening, might be picked up in this issue if there is time.
Also the edit page seems to be saving values to the database (without pressing save), which shouldn't be happening, might be picked up in this issue if there is time.
Could not reproduce this, might be only on the referenced branch.
Tried the following to test this.
{
"type": "SimulatorAgentLink",
"id": "...",
"replayData": [
{
"timestamp": 1,
"value": 10
}
],
"schedule": {
"start": 1764630000000,
"recurrence": "FREQ=SECONDLY"
}
}
Hi Koen,
The _onMetaItemModified function is triggering this which is coupled to an event on line 435 or-edit-asset-panel:
content = html`<or-mwc-input @or-mwc-input-changed="${(ev: OrInputChangedEvent) => this._onMetaItemModified(attribute, metaItem, ev.detail)}" .type="${InputType.JSON}" .value="${metaItem.value}"></or-mwc-input>`;`
protected _onMetaItemModified(attribute: Attribute<any>, metaItem: NameValueHolder<any>, detail: OrInputChangedEventDetail | undefined) {
metaItem.value = detail ? detail.value : undefined;
attribute.meta![metaItem.name!] = metaItem.value;
this._onModified();
}
And as an agentlink with json form is also a metaitem, it follows the same behavior?