3 ms·
> Web components that encapsulate state and interactivity, usable alongside a regular HTML page, were an emerging direction They weren't. By 2013 web component
by troupo 3y ago
> Web components that encapsulate state and interactivity, usable alongside a regular HTML page, were an emerging direction
They weren't. By 2013 web components were still flailing around completely ignoring everyting that was happening in the world and coming up with an unusable and badly design API while crippling a bunch of other things in the process (like forcing C++-like OOP onto prototype-based Javascript)
> when React shipped and forced everyone to re-write ‘class=‘ to ‘className=‘.
React is basically just Javascript. What do you think className is? https://developer.mozilla.org/en-US/docs/Web/API/Element/className https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...
> And being forced to re-write every app as an SPA was a dumb idea the day people started doing it, even in light of other available approaches.
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)?
- deleted 3y ago[deleted]
- 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