3 ms·
Do we really need react for this ? Also it looks like there are thousands of LOC for just this
by zfxfr 5y ago
Do we really need react for this ? Also it looks like there are thousands of LOC for just this
- pcthrowaway 5y agoYou certainly don't need react to embed a youtube video in a background.. this library provides a react component that does this, which is useful to react users who want this effect.
- BigJono 5y agoThe amount of code used here to do something so simple is absolutely staggering. This library abstracts over youtube-react, which abstracts over youtube-player, which abstracts over the Youtube API itself, each one proving hundreds or thousands of LoC. This is a serious dependency sandwich. If you want to put a single Youtube video in the background of a div then you don't need thousands of lines of code for managing player controls and state changes. You could probably take 1/10th of that code in youtube-react (the bit that integrates a react component with a 3rd party lib that wants control over the DOM, common pattern with React) and get the same result.
- dismantlethesun 5y agoWhat you are saying is a worthy fault for a front end library, but it’s kind of funny that no one thinks this way when it’s the backend. To do a simple k-means clustering on a textual corpus, someone might pull in all of scipy and ntlk which is tens of thousands of lines of code. I think programmers don’t generally consider dependency size unless it’s on the order of multiple gigabytes.
- pcthrowaway 5y agoI suspect a lot more LoC are fetched when you visit youtube anyway, even if it is edge-optimized
- wackget 5y agoYou just described the entire pantheon of modern development tools.