Skip to content

Instantly share code, notes, and snippets.

@rlemon
Forked from Raynos/jQuery.md
Created January 19, 2012 18:37
Show Gist options
  • Save rlemon/1641752 to your computer and use it in GitHub Desktop.
Save rlemon/1641752 to your computer and use it in GitHub Desktop.
Why you don't need jQuery

Why the jQuery Abstraction isn't needed.

(One needs some form of browser normalization so that modern features works, no-one is doubting that).

Abstractions that aren't needed

Selectors

QSA works (shim=sizzle). Besides selectors are generally bad practice. Favour node traversal, gEBI, gEBTN and gEBCN. (shim=domShim)

Attributes

The DOM attribute API works. Besides one rarely touches attributes and one rarely touches innerHTML. Generally one manipulates properties

Data

properties work, weakmaps work (shim=weakmap-shim)

Deferred Object

Promises, deferreds, futures, etc aren't that useful. Favour managing callbacks and using flow control techniques.

Events

DOM2 events work (shim=domshim). You don't need anything else.

Forms

The HTML form element is more useful. Doesn't give any useful abstraction

Manipulation, Traversing

The DOM works (shim=domShim). If you want set like behaviour you can use NodeComposite

Utilities

ES5 works (shim=ES5shim)

Abstractions that are still needed

Ajax

XHR doesn't have a good shim yet, we still need an abstraction.

Todo: Write an XHR2 shim

CSS, Dimensions, Offset

I havn't seen any good CSS normalization shims. One propably needs some form of abstraction to handle CSS nicely.

Todo: Write an CSSOMView shim

Effects

Animations, Don't know of a good CSS3 shim, so we still need a browser abstraction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment