Re:YouTube Video as Background in React
by dismantlethesun on Sunday March 27, 2022 @08:20PM
(#30825579)
What 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.
Re:YouTube Video as Background in React
by pcthrowaway on Sunday March 27, 2022 @09:08PM
(#30825911)
I suspect a lot more LoC are fetched when you visit youtube anyway, even if it is edge-optimized
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.