- code is inconsistent,
- code is not robust enough to be used with bad 3rd party code (extending prototypes),
- there are flaws in the design of a number of components,
- jQuery selectors are abused,
- Core JS should pass JSHint without errors using: #1664940: [Policy, patch] Decide on JSHint configuration
- #1574470: [Meta] selectors clean-up,
- #1993322: [Meta] Drop IE8 support,
- name all constructors with initial uppercase character (might be the case, haven't checked everything) and more importantly remove the uppercase if it's not a constructor
- #1460022: Prefix all jQuery variables with $
- #1420706: Access DOM directly instead of attr('xx')
- #1649780: Remove first/last/odd/even classes in favor of CSS3 pseudo selectors
Clean-up related bugs/tasks
- #1974580: Introduce domReady to remove jQuery dependency from drupal.js and clean it up.
- #1719640: Use 'button' element instead of empty links
- #1745964: JSHint: Remove unused variable declarations
- #1751008: filter inside .prev() or .next() and not right after
- #1737148: Explicitly declare all JS dependencies, don't use drupal_add_js
- #1420022: Remove dead code: progress.upload_callback, progress.error_callback
- #1428534: Use === and !==,
- #1428524: Replace all $.each() with filtered for loop (I'm not talking about
$(selector).each()which makes total sense to use),
- #1089300: Clean up drupal.js,
- #1518012: Every additional function from Array.prototype called on ajax requests.
- #1459164: use test() to match string for BOOL comparison
- #1651270: Remove IE8-specific workaround for lack of CSS3 box-shadow support
- #1419968: Replace $('selector', domelement) with $(domelement).find('selector')
- #1428538: Use jQuery toggle
- #642734: Simpletest behaviors should process the elements only once
- #1749782: Use event.preventDefault(); and event.stopPropagation(); instead of return false;
I'm not sure it all applies, it's the kind of things I saw in contrib. and I suppose most of them can be found in core.
Safer and faster execution of core JS (selectors simplification can go a long way here). It'll make refactoring go smoother too (one day, when file-level closures go away).
And having a strict code style literately fixes bugs #784670: autocomplete.js can iterate over functions in Array objects.
The first patch going this way just got commited to D8 \o/ #1400310: Use of .parents() is really .closest().
How does this fit with other initiatives?
We are in touch and share some issues with the mobile and html5 initiative.
How can I help?
If you are subscribing to this issue and want to help, note that there is a very long list of issues linked from the opening post that are dying out for reviews, re-rolls or initial patches so it should be easy enough to find somewhere to start.
If after looking at that list you don't know where to start, grab nod_, catch on IRC (#drupal-contribute) or just ask around, and we'll try to help you find something.