3 ms·
I'm Daniel Kehoe, interviewed by Richard MacManus for his article. I suppose we can nitpick semantics, but I think it should be said that Lit is properly a libr
by DanielKehoe 5y ago
I'm Daniel Kehoe, interviewed by Richard MacManus for his article. I suppose we can nitpick semantics, but I think it should be said that Lit is properly a library (and a small one), not a framework. Significantly, since Lit relies only on the component model defined by the HTML spec, a web component built with Lit can be used as if it was ordinary HTML by any framework (except maybe React which doesn't play nice). Yes, as you observe, instead of using a framework for most web things, you can "use the platform." The newest features built into the browser allow us to do almost everything we would do with a framework. Glad to see this getting some attention on HN!
- nikodunk 5y agoHi Daniel! Thanks for the great summary on your website. That said I'd love a few more examples - like _how_ to * import a navbar from one html snippet into another (thereby making some static site use cases obsolete). * how to import from CDNs (it took me a while too realize what you were talking about for the case below). Love your position - but I'd argue your position would be a lot stronger with examples! Thanks, Niko <!DOCTYPE html> <head> <script type="module"> import {LitElement, html} from 'https://jspm.dev/lit-element@2'; class MyFooter extends LitElement { render(){ return html`<footer><p>© ${new Date().getFullYear()} My Company</p></footer>` } } customElements.define('my-footer', MyFooter); </script> </head> <body> <my-footer name="World"></my-footer> </body>