3 ms·
“Most frontend developers still remember the dark days of JavaScript dependency management.” As opposed to now, where even the smallest “app” has hundreds if n
by LeoNatan25 9y ago
“Most frontend developers still remember the dark days of JavaScript dependency management.”
As opposed to now, where even the smallest “app” has hundreds if not thousands of dependencies for the most basic of functionality (‘need to iterate an array, better bring lodash’), often there being multiple copies of the same dependency due to conflicting versions?
- bfred_it 9y agoDo you prefer handling these conflicts by hand by shuffling global variables?
- LeoNatan25 9y agoI would prefer there be a comprehensive base library, thus cutting dependencies to a minimum. Beyond that, I would prefer to handle those manually, yes, rather than have multiple versions of these libraries just load into memory. Conflicting dependencies is not a coherent development state.
- bshimmin 9y agoYou beat me to the punch: I really don't remember "you would copy and paste a library into a vendor folder, rely on global variables, try to concat everything in the right order and still would had to deal with namespace issues" as being all that big of a problem! It was (is!) simple enough, and it mostly worked; if you were trying to deploy something to a customer site where they already accidentally had two different old versions of jQuery loaded in the page, sure, that could be problematic... but deploying stuff to customer sites is always problematic one way or the other. (I accept this is something of a rose-tinted over-simplification, but a paragraph titled "An ancient fear" probably deserves some slightly flippant commentary.)
- eloisant 9y agoI do remember that being a huge pain in the back, as in: - You have to maintain a full list of your files, in order, to include them in your html page (in dev mode) and concat (for prod mode) - If you want to know on what other module a given module depends on, you have to hunt every call in the source code - You can never remove a dependency on an external lib as you can never be sure it's not used somewhere - Upgrading a lib was a pain Compared to every other language, it was a huge pain point. It's not by chance that so many people started to work on implementing modules for JS, there was a real need.