Hacker News new | ask | show | jobs
by Zaheer 1989 days ago
I generally agree but I think the site is specifically calling out use of jQuery in libraries to avoid a big dependency.

"If you're developing a library on the other hand, please take a moment to consider if you actually need jQuery as a dependency"

1 comments

Agreed! Especially for a smaller library or one that wouldn't adequately take advantage of jQuery shortcuts (or if you're using another library for DOM/shadow DOM, like react/angular/vue/etc)

Counterpoint, if you're developing a library, then (based on this page itself), each line that would depend on jQuery would otherwise balloon to 15 times as large, so maybe the highly optimized jQ dependency would be worthwhile if the extra functionality would actually be useful (or perhaps "slim" jQuery). The savings would increase for each additional library that had a shared dependency on jQuery.

But, anyway, developer time is valuable, and the 80kb or so for jQuery will probably be blown away as soon as you stick a single image on the page.