News for hackers. Stuff that matters.
Re:The state of JavaScript modules by bshimmin on Monday May 29, 2017 @04:28AM (#14438059)
You 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.)

Re:The state of JavaScript modules by eloisant on Monday May 29, 2017 @07:17AM (#14438540)
I 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.