2 ms·
+1 for Lit. It seems like they're mostly recommending that you use TypeScript and a build system, but you can 100% still just pull the library from a CDN with n
by kyle-rb 4y ago
+1 for Lit. It seems like they're mostly recommending that you use TypeScript and a build system, but you can 100% still just pull the library from a CDN with native JS modules [0].
It leans into a lot of the web components spec so the library is pretty small, and the templating system is just ES6 tagged template literals parsed by the browser's DOM parser and any embedded variables are updated dynamically [1].
[0] https://lit.dev/docs/getting-started/#use-bundles https://lit.dev/docs/getting-started/#use-bundles
[1] https://lit.dev/docs/templates/overview/ https://lit.dev/docs/templates/overview/
- benforreal 4y agoI think Lit is still recommending using web dev server (https://modern-web.dev/docs/dev-server/overview/ https://modern-web.dev/docs/dev-server/overview/), which no, its not a build system, but still a bit of a departure from a simple web server. And that's only needed to resolve imports that aren't a full relative path (like if I want to import Lit, I don't have to do import node_modules/lit/whatever). Someone else mentioned import maps here, and it's now supported in all browsers if you include the Safari preview release. I haven't tried it yet because I've been hung up on it being Chrome only until now, but it should complete the no-build experience. Except yeah, Typescript, but if you use it, you can just leave it watching in the background without much intervention.
- Juliennng 4y agoHopefully, the "Type Syntax in JavaScript" proposal is accepted one day, and you don't have to transpile ts => js anymore.