Giter VIP home page Giter VIP logo

Comments (6)

iantrich avatar iantrich commented on July 20, 2024

I don't think I'll add it as I don't think you should really be doing it in the frontend. Easy to get some big performance issues. You can check out https://github.com/thomasloven/lovelace-template-entity-row/blob/master/src/main.js for ideas on how to implement it though.

The main thing is that you want to restrict when you call it so that you only re-evaluate when necessary.

from boilerplate-card.

Savjee avatar Savjee commented on July 20, 2024

Thanks for the feedback!

Am I correct to say that performance impact could be limited if you only render the template when the entity has changed state?

from boilerplate-card.

iantrich avatar iantrich commented on July 20, 2024

yes

from boilerplate-card.

Savjee avatar Savjee commented on July 20, 2024

Thank you for the feedback. I've implemented it like this.

from boilerplate-card.

Savjee avatar Savjee commented on July 20, 2024

Sorry to reopen this issue.

I want to reiterate the notion of having templating support in this boilerplate card. I recently found that button-card has support for Javascript-based templates. These are executed in the front-end and have no performance impact.

I implemented it into my own card (button-text-card) and I feel like this way of templating is very powerful. I can't shake the thought that it would be nice to offer a standard way of front-end templating.

What are your thoughts? I can open a PR if you think it's a good idea to include in this project.

from boilerplate-card.

iantrich avatar iantrich commented on July 20, 2024

I don't think the boilerplate-card is the place to do it, first off. I think this would be better suited for something in a node module, like custom-card-helpers

from boilerplate-card.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.