3 ms·
The author of this article really gets web components wrong. You don't use JS for everything. Web components have a built in DSL. The below from the article i
by nickthemagicman 10y ago
The author of this article really gets web components wrong. You don't use JS for everything. Web components have a built in DSL.
The below from the article is ridiculous and HORRIBLY INNACURATE:
['Hello', 'world'].forEach(('text') => {
const p = document.createElement('p')
const span = document.createElement('span')
span.textContent(text)
p.appendChild(span)
MyComponent.appendChild(p)
})`
In RiotJs you would build a web component this way:
<text-breaker-upper>
<p each={this.input_str as out_text}>
<span>{out_text}</span>
</p>
<script>
this.input_str = input.split(" ");
</script>
</text-breaker-upper>
Then you declare it ON THE PAGE.
<text-breaker-upper
input_str="Hello World">
<text-breaker-upper>
Web components much more intuitive, reusable, better separation of concerns, less bloat, and more elegant than React..no bastardization mixing of JSX, CSS, and JS, and how the web (and any sane technology) was meant to be.
The sooner this JS front end framework B.S. wasteland nightmare is behind us, the gournd salted on where it stood, and we laugh at JS like we laugh at COBOL.... the better in my opinion.
- woah 10y agoLooks like Riot.js is just another frontend library that has a templating pseudo-language like so many others. Maybe they use the words "web component" on their site or something? Looks like they parse their templates out of the DOM and then do what any frontend framework does. Strange that you get so emotional about whether your templating language is shoehorned into some DOM nodes that get thrown away and replaced once the framework reads them. This is not the web components that the article is talking about and it is not interoperable.
- nickthemagicman 10y agoThis and Polymer are the precursor to built in browser web components that the author claims React is superior to.