Highlights from the Original jQuery Source

In April, jQuery's creator John Resig released an early version of the jQuery source with annotations, giving some interesting insight into his thinking when developing what would become the world's most popular JavaScript library. Here are some highlights gleaned from the annotations:

  • The library was originally called JSelect, but jselect.com wasn't available so it became "JQuery", then finally "jQuery".
  • jQuery was Resig's 76th open-source project release. 76th time's a charm, right? :slight_smile:
  • This version supported IE5.x for a short time, before moving on to IE6+.
  • Resig explains how the core hasn't changed too much: "There’s a strong chance that you could take circa-2006 jQuery-using code and drop in a modern version and have it still work."
  • The original show/hide methods assumed all elements were "display: block", which was a major blunder.
  • From the beginning, jQuery had proper method chaining, which has allowed devs to write code that's more compact. Chaining has gone on to influence many other libraries even in other languages.
  • The first jQuery plugin was created by Michael Geary on January 25th, just 11 days after the first release of the library.
  • In this version, Resig attempted to map XPath selectors to CSS but this was removed before 1.0.
  • Resig didn't use a linter for jQuery in those days but started using one shortly before 1.0.
  • Resig used single-letter variable names quite a bit, but this changed later.
  • Resig won an "addEvent() recoding contest" on QuirksBlog, which is quite funny actually.

There are lots more such tidbits, so take a look if that's your thing. If you have any thoughts on the source or John's annotations, or even the JavaScript library scene back then in general, I’d love to hear your thoughts.

This editorial appears in this week’s issue of the SitePoint Newsletter.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.