Coder Social home page Coder Social logo

htmel's People

Contributors

dependabot[bot] avatar lefetmeofefet avatar

Stargazers

 avatar

Watchers

 avatar  avatar

htmel's Issues

CSS: Smart <style> tag updates

Currently when style tag content is updated, the whole css inside is recalculated, that's bad for performance.
Instead, it's possible to change the style object directory: styleTag.sheet.cssRules[0].style.color="red".
Use cases to cover:

  • property value (green)
  • property name (color)
  • whole css line (color: green;)
  • whole css selector content (color: green; font-size: 24px;)
  • css selector (.things>#ikaramba)
  • whole css rule (selector + content)
  • multiple css rules

Support for promises as expressions

Support for the following syntax:

async function getStuff() {
  ...
}
html(state)`
<div>${() => getStuff()}</div>
`

Not sure how important this is as of now

Cache calls to htmel

Calling htmel a lot of times can become slow, especiall if we're updating a list frequently, causing the whole list to be calculated and each item in the list calls htmel.
Caching will save the extra time of processing the template. Basically, the flow is:

  • htmel is called, check if cache contains the state object
  • if contains, clone the existing template
  • otherwise create a new template, and save to cache

Spread operator attributes dict

Allow inserting a json object as attribute dict. example:

let attrs = {class: "classname", style: "color: red"}
htmel()`<div ${attrs}>this will be red</div>`

Lists keyed performance

When overwriting list, instead of deleting the whole list and adding the new one, only apply the diff.
Possible ways to achieve this:

  • compare references to the old list.
  • special key prop

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.