Is jQuery Too Bloated? Try jquip.

Share this article

It’s been a busy few weeks for jQuery developers. We’ve received jQuery 1.7 and jQuery Mobile, but a third project is now vying for our attention…

At a little over 32KB for the minified and gzipped download, few people could accuse jQuery of obesity. But it’s rare you need all its abilities. Enter jquip — or jQuery-In-Parts; a smaller, leaner and faster fork of library. It contains 90% of the best parts at a fraction of the size — just 4.28KB (even the uncompressed source is a mere 21.5KB).

You get a lot of functionality in that tiny package:

  • the main $(selector)
  • DOM traversal methods such as eq, first, last, slice, prev, next, siblings, children, etc.
  • DOM modification methods such as append, prepend and remove
  • CSS class modification methods such as hasClass, addClass and removeClass
  • Event methods such as bind and unbind with all the standard types (click, mouseenter mouseleave, submit etc.)
  • Utility functions such as each, trim, extend, merge, isArray, etc.

The library has a modular architecture so other jQuery facilities are available as plugins which can be included when you require them:

  • documentReady: $(function()) and $.ready
  • css: css, Width and Height methods
  • ajax: ajax, get and getJSON methods
  • custom: various methods such as queryString and event object isTab, isShift, and cancelEvent

The distribution package provides the plugins as separate scripts and within a single 20KB jquip file — which is just 7.84KB when gzipped. Ultimately, jquip’s developers Demis Bellot and Jey Balachandran hope to implement all the missing jQuery methods as plugins.

I’m impressed. In an age of monolithic multi-megabyte pages, it proves some developers still care about nimble lightweight code. And there are good reasons to trim the fat given the increased popularity of modestly-powered smartphones, eReaders and tablets. jquip could be a magical diet pill for your site’s slimming regime.

Craig BucklerCraig Buckler
View Author

Craig is a freelance UK web consultant who built his first page for IE2.0 in 1995. Since that time he's been advocating standards, accessibility, and best-practice HTML5 techniques. He's created enterprise specifications, websites and online applications for companies and organisations including the UK Parliament, the European Parliament, the Department of Energy & Climate Change, Microsoft, and more. He's written more than 1,000 articles for SitePoint and you can find him @craigbuckler.

HTML5 Dev CenterjavascriptjQuery
Share this article
Read Next
Get the freshest news and resources for developers, designers and digital creators in your inbox each week