3 ms·
> What do you think web components are if not a way for people to dump a bunch of Javascript onto a page (and dozens of Javascript-only specs to accompany them)
by mbgerring 3y ago
> What do you think web components are if not a way for people to dump a bunch of Javascript onto a page (and dozens of Javascript-only specs to accompany them)?
You can get most of what you need onto a web page with HTML. Some components need to be interactive. For that, you need JavaScript. The question is, do you:
1. Keep the rest of the HTML in place, and add JavaScript to that HTML for the interactivity you need (the web components approach)
Or,
2. Re-write the entire web page as a JavaScript “app”, including the parts that are just fine as static HTML, for the “convenience” of the pieces that need interactivity (the React approach)
Both involve “dumping JavaScript onto a page,” sure, but they are totally different approaches.
For a decade, the entire industry picked “2”, and now the internet is a bloated disaster.
- troupo 3y ago> Keep the rest of the HTML in place, and add JavaScript to that HTML for the interactivity you need (the web components approach) It's not the web components approach. Almost nothing about web components is about progressive enhancement. > Re-write the entire web page as a JavaScript “app”, including the parts that are just fine as static HTML That is literally what web components are. They can't even participate in forms without Javascript