4 ms·
I've been using web components now for years and I will do everything I can to never write frontends in anything else. I totally agree with point 2 though: the
by herpdyderp 3y ago
I've been using web components now for years and I will do everything I can to never write frontends in anything else. I totally agree with point 2 though: the Polymer phase was very weird, but, as mentioned, https://lit.dev https://lit.dev is great and, imo, the perfect abstraction.
- benatkin 3y agoLit seems functionally equivalent to Svelte. Might Lit only be better if you have a preference towards declaring classes? Perhaps tracing back to Backbone or React before hooks? Svelte supports custom elements: https://svelte.dev/docs/custom-elements-api https://svelte.dev/docs/custom-elements-api
- spankalee 3y agoLit uses standard languages, doesn't require a compiler, is faster, and is smaller as you amortize the library size over a collection of elements. Those are real differences.
- benatkin 3y ago> uses standard languages, doesn't require a compiler It recommends a build step, but yes, you can use it without one. Also, TypeScript isn't a standard language. So if you're using .ts you may as well use .svelte. > is faster I don't know that Svelte has been benchmarked with custom elements. Either way it's plenty fast. > is smaller as you amortize the library size over a collection of elements That's kind of a funny thing to worry about. It has improved in Svelte 4, though. https://svelte.dev/blog/svelte-4 https://svelte.dev/blog/svelte-4 I also don't know that Lit is so small in practice. With Lit you get to use map and the ternary operator and all that jazz, like React. https://lit.dev/docs/templates/conditionals/ https://lit.dev/docs/templates/conditionals/
- phpnode 3y agoWhen did @click and so on become part of HTML?
- dannye 3y agoIf Lit is equivalent to Svelte, then BASIC was equivalent to COBOL
- brianzelip 3y agoWould love to peruse a couple example repos for learning if you can share some public links.
- mariusor 3y agoNot parent, but I wrote some components based on lit-js, they're here: https://git.sr.ht/~mariusor/oni/tree/master/item/src/js https://git.sr.ht/~mariusor/oni/tree/master/item/src/js. The top level call would be oni-main-actor.render() However I am a total noob so it might not be entirely idiomatic. An example for the end result is at https://releases.bruta.link https://releases.bruta.link
- mock-possum 3y agoLit is so good. It’s just enough extra on top of native web components - to be useful, but without feeling like it stacks a bunch of extra bullshit. I really wish more teams were into it.
- rapnie 3y agoIt looks good. But it is a Google project, and with Google's DRM attack on the web I don't know if I'm willing to give these more traction by being among the user base.
- beanjuiceII 3y agolit looks like someone's trying to make a GUI in java, what is the need/deal with these annotations etc?