I've been bothered for awhile by the mess we have in resources/jquery/ – 3rd party libraries, custom libraries we have to maintain, and directly MW related code using mediaWiki.* APIs all mixed together in the same directory. So I went and audited the .js we have inside resources/jquery/ and have wrote up an RFC on it:
https://www.mediawiki.org/wiki/Requests_for_comment/Isolate_custom_jQuery_li...
wikitech-l@lists.wikimedia.org