Skip to content

Smarter, efficient rendering (like Button Card does) #112

@kulmegil

Description

@kulmegil

Is your feature request related to a problem? Please describe.
Config Template Card requires that all entities used inside card: to be listed in the config under entities: key.
This is because it doesn't update hass object in the rendered card.

On the other hand Config Template Card will always re-render entire DOM content every time state changes.
Even if the resulting card config is identical then previous one.

You may say content never updates, only constantly re-renderes.

Describe the solution you'd like
Render smarter - like Button Card does.

Button Card does not require implicit entity_ids in order for rendered cards/rows to update.
It does require ids in order to evaluate JavaScript templates but the content can update independently.

When Button Card evaluates templates it compares result to previous one.
It only renders content when evaluated config actually changes.
Aside from performance improvement benefits this reduces issues of elements resetting state while being interacted:
e.g. dropdowns or Fold Entity Rows collapsing back because being re-rendered.

Describe alternatives you've considered
Using Button Card is a good (and only?) alternative because it can do client side JS templates (and config templates) very efficiently.

But at the same time it's bloated with features already, has complex syntax and comes with some built in css styling that are annoying to reset back when used as a general templating card. It was built to be a button card on steroids... and there are too much steroids already.

Additional context
none

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions