rockerest’s avatarrockerest’s Twitter Archive—№ 14,420

          1. …in reply to @h4rishabh
            hrish4bh I would kind of think of lit-html like everything that happens when React renders. Or put another way: lit-html isn't a complete replacement for React. If that's what you want, I'd look into lit-element (which uses lit-html under the hood for rendering). 1/
        1. …in reply to @rockerest
          hrish4bh A huge benefit of lit-html over React is lit-html does not use a Virtual DOM. VDOM is super inefficient (checks every live node against every new virtual node), so the middle ground of lit-html (checks only dynamic nodes) gives you huge performance improvements 2/
      1. …in reply to @rockerest
        hrish4bh Another huge benefit of lit-html is you'll be writing extremely standard JavaScript and HTML. The only parts of the library that aren't standard are 3 declarative sigils: ".", "@", and "?" which allow you to programmatically bind to properties, events, and boolean attributes 3/
    1. …in reply to @rockerest
      hrish4bh Everything else you write will be normal JavaScript and tagged template literals, which means the skills and patterns you use will be reusable anywhere. 4/4?
  1. …in reply to @rockerest
    hrish4bh If what you're looking for *is* a complete React replacement, look into lit-element. All of the same statements apply with these added things: - The component model you'll be working in is built into the browser - You get CSS isolation by default (if you can use shadowDOM) 5/
    1. …in reply to @rockerest
      hrish4bh - You'll never be locked into a framework because what you're using is basically just a base Class on top of the platform-native component model. I sometimes recommend (if you have time) building your own component base class to see how you might solve the same problems 6/
      1. …in reply to @rockerest
        hrish4bh I found that after about a day of work, I had a base class similar to lit-element, but it was much less efficient and much less flexible. I switched to lit-element because I know if it ever becomes a problem, I can replace it with something else that depends on the platform 7/7