寻求无需在JavaScript中编写HTML的Web Components实现方案
My Frustration with Web Components Implementation Approaches
I've explored and tested several Web Components implementation approaches, but there's one consistent pain point that drives me crazy: all of them require writing component HTML code within JavaScript/JSX/TypeScript. That's just not the workflow I want to stick with.
Let me walk through my experience with Polymer, one of the frameworks I've spent time on:
- Polymer 1 and 2 used HTML imports to define components, which achieved a clean separation between HTML markup and JavaScript logic. The development experience felt really intuitive and aligned with how I prefer to structure code—this was exactly what I was looking for.
- But then Polymer 3 shifted to a React-like syntax, forcing developers to embed HTML directly inside JavaScript files. This change was a total deal-breaker for me; I just can't stand mixing markup and logic in that way.
内容的提问来源于stack exchange,提问作者Vignesh T.V.
相关产品推荐
相关产品推荐

