Hacker News new | ask | show | jobs
by wokwokwok 765 days ago
They won't last longer than a react component (that's not even the claim the linked post is making); you can just use them in a different framework, if you care about that.

...which is the point the parent comment was making.

2 comments

> code saved on laptops that hadn’t been turned on in a full decade. The more dependencies a website had, the more difficult it was to restore

is the crux for me. When I clone one of my Vue projects from a few years ago and try to run it, it is always broken. My (new) node version is incompatible with a Vue core library, then updating the core library breaks some other libraries and requires config file changes.

I wish vendoring dependencies wasn’t viewed with such suspicion in tech.

I store dependencies in-repo whenever I can get away with it; it eliminates whole classes of devops/CI issues.

I read the point as WebComponents will last longer because "a standard" while React is "a Facebook standard".
There's also the "React is the industry standard that tons of developers and companies use" vs. the "WebComponents is the 'official' standard that nearly nobody uses".

Yes, I'm being hyperbolic. But if you're worried about longevity I would certainly hitch my wagon to React before I hitched it to WebComponents.

React is like JQuery.
Unfortunately I don’t think that comparison quite holds. jQuery is mentioned less and less because core browser APIs implemented a lot of what it does and made it unnecessary.

Even if Web Components solve the “create a component” part of React there’s still an absolute ton of stuff it provides that Web Components don’t. I tend to think of WC as a low level API you want a library interfacing with rather than your own code, e.g. the way Svelte exports web components.

If it's a choice between removing the JQuery dependency from old JQuery code, or updating equally old vanilla javascript, I'm going to be picking the first option a lot.
The point isn't that it's a standard, it's that it's implemented in browser (not in a framework), and is a lot closer to the web equivalent of "bare metal". There are less moving pieces that will break backwards compatibility in the next 10 years (is the hope)