4 ms·
Fully agree. It's usually the people that have never worked with it that share their opinion, always ending with "why do we need this" Can encourage others to
by zoover2020 5y ago
Fully agree. It's usually the people that have never worked with it that share their opinion, always ending with "why do we need this"
Can encourage others to give it a try as well. Dev productivity through the roof indeed :)
- runarberg 5y agoComparing Tailwind with Web Components might be a bit unfair. It is well known that Web Components have terrible dev ergonomics. It would be more fair to compare with frameworks that work with scoped styles (such as Svelte or Vue’s single file components). Developing in these is also an excellent productivity boost.
- johnnypangs 5y agoCan anyone give some references on that Web Components have bad dev ergonomics? Is it just that Web Components don't allow passing of complex types so you have to stringify everything?
- runarberg 5y agoI see many people have problem with that in the comments here. However I don’t find that to be an issue. Passing properties (as opposed to attributes) allows complex types and many popular frameworks have a handy shorthand for it (e.g. in lit-html you write `<my-component .prop=${[1, 2, 3]}>`). In my opinion the bad ergonomics is actually when authoring the components (not consuming it). Many of the faults have been excellently pointed out previously[1]. The most glaring the boilerplate you have to write if you want your attributes to reflect a property. This has an easy fix though, which is that you simply don’t write your web components by hand. You either use a library (like lit-element[2]) or a compiler (like stencil[3]). I’m personally waiting for a less opinionated compiler with a smaller runtime then stencil (preferably no runtime; perhaps that is Svelte with a web component target, I haven’t tried it). There is also a proposal for a declarative shadow DOM[4], which aims to tackle some of the bad dev experience we have with web components. However I’m personally a little skeptic that it is a good proposal, or that it will fix what most web component devs are concerned about. 1: https://dev.to/richharris/why-i-don-t-use-web-components-2cia https://dev.to/richharris/why-i-don-t-use-web-components-2ci... 2: https://github.com/lit/lit-element https://github.com/lit/lit-element 3: https://stenciljs.com/ https://stenciljs.com/ 4: https://github.com/whatwg/dom/issues/831 https://github.com/whatwg/dom/issues/831
- johnnypangs 5y agoThanks for the response, I appreciate it!
- spankalee 5y agoIt is not well known that web components have terrible dev ex, because it isn't true.
- pineconewarrior 5y agoTrying to get my team to consider the switch from Bootstrap to Tailwind. All of this talk makes me jealous
- gherkinnn 5y agoNothing beats a live demo.