-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Remove jQuery dependency
Marc-André Lafortune edited this page Mar 7, 2017
·
8 revisions
The idea is to offer the user the choice of either accessing the DOM using jQuery
or native
.
In jQuery
mode, all $something
continue referring to jQuery sets, and selectors (e.g. inputs
, excluded
, ...) refer for jQuery selectors. In native
they refer to a DOM element (or array of DOM elements) and HTML5 selectors respectively. While these are often compatible, jQuery supports more pseudo selectors as well as custom selectors.
Similarly, in jQuery
mode, Ajax options refer to jQuery options, while in native
mode, they refer to fetch options.
- Go through all current uses of
jQuery
and convert to vanilla when reasonable: - use native DOM (e.g.
$.fn.attr
=>getAttribute
). Must be 100% compatible, e.g. there is no equivalent tofind(options.inputs)
as jQuery selectors are more powerful than native ones. - replace with ES6 calls (e.g.
$.fn.each
=> loop). Must be IE8+ compatible (with es5shim) - replace with CSS? (e.g.
fadeIn
=> CSS animations, see #777) - Create a
DOMInterface
class to be used to access the DOM & Ajax. - Go through remaining uses of
jQuery
and move them toDOMInterface
. This includes the way that promises are used to convert validator results and how they are combined - Implement
DOMInterface
fornative
mode. - Make the full test suite run twice, once with
jQuery
, once withnative
- Update documentation