Standalone selector

John Resig is a machine. Not content with dividing his time between working on jQuery and working on Firebug, he’s also got another few irons in the fire.

Just for kicks, John has created a standalone selector engine called Sizzle. It’s not quite ready for prime time yet but it looks very promising. It uses the CSS syntax that has helped make jQuery such a popular library. Right now, the code is coming in at less than 4K!

I really, really like this modular approach to writing JavaScript. Instead of bloating a library with more features, the components of the library are instead being split into separate standalone pieces. I wonder if the same thing will happen with event handling and effects. Those three actions (selector, event, effect) probably make up 80% of jQuery use cases:

jQuery(selector).event(function() {
 effect();
});

For an event of a different kind, there’s a jQuery Camp scheduled for September 28th, the day before The Ajax Experience in Boston. The exact location has yet to be determined but given the number of jQuery fanboys out there, I’m guessing it won’t be ‘round at John’s house. There’s a nominal registration fee of $50 to cover lunch. If you use jQuery and you find yourself anywhere on the eastern seaboard of the United States at the end of September, you should probably register now.

In his spare time, John likes to relax by porting the Processing visualisation language to JavaScript. Freak.

Posted by Jeremy on Monday, August 25th, 2008 at 12:44pm

Comments

Hi Jeremy,

If you download the SVN copy of jQuery, you’ll see in the src directory that the library is already modularized to some extent, with separate files for core, selectors, events, fx, ajax, offset, and dimensions.

It’s not offered that way through the more public channels partly because of the support overhead of having to figure out which components are loaded when someone is having problems getting something to work.

Also, an update: the jQuery conference registration is now closed. We maxed out the number of attendees that the venue can hold.

# Posted by Karl Swedberg on Monday, August 25th, 2008 at 10:01pm

Thanks for the update, Karl. That’s really good to hear about the inherent modularisation of jQuery.

# Posted by Jeremy Keith on Tuesday, August 26th, 2008 at 1:32am

I wish I would be able to do only half the work…

BTW: Firebug is one my favorite tools for web developement and making some quick changes to websites on the fly… Thanks to John for that.

# Posted by Patrick on Tuesday, August 26th, 2008 at 9:34pm

Ah - nice idea, I always have the problem to load more code than I really need. But reducing the code is a bit too difficult for my JQ-skills at the moment. I will have a look at the selector engine!

# Posted by Robert on Thursday, August 28th, 2008 at 9:09pm

I’m torn between hero worship of Resig and wanting to murder him and his library spamming ilk for taking all the paying opportunities to actually write your own Javascript off of the market. Sigh… Guess I’ll just have to suck it up or refine and publish my own damn library if I want to continue doing that.

But yeah, he’s a badass and one of the few framework writers whose functions I can’t reverse engineer on sight. Thanks for the book that gave my own JS skill development such a shot in the arm Jeremy. Too bad it all appears to have been for nothing now. Might as well learn variables, loops, and flow control and then just skip all that unnecessary object stuff and learn the libraries.

I think I lost a recommendation from my last employer because I made the mistake of writing my own much more flexible form validation scripts rather than simply dumping the crappy code in that they had on hand and stripping some unnecessary table code one of their other freelancers put in. My mistake for putting standards and UI considerations ahead of just getting it done, but for FFS, who likes getting a JS alert when the field they just put a questionable e-mail address into loses focus? JS alerts for anything other than onclick is like throwing up a brick wall in front of a cyclist.

There are two sayings that irritate the Hell out of me:

"Don’t talk about politics or religion in the bar/pub." - What else do we talk about? Shag carpeting? Celebrities? Sports? Other bars? Bar decor?

and from the developers…

"Don’t reinvent the wheel."

If nobody ever reinvented the wheel we’d be chipping the silly things out of stone. How would we all feel about gas prices if we were still doing that?

# Posted by Erik on Monday, September 1st, 2008 at 10:57pm

I take it John’s best friend is his computer. He really needs to get out just a bit more around something like people maybe, but when he’s at his best is when he’s at his computer apparently. Great stuff.

KeeKee

# Posted by KeeKee on Tuesday, September 2nd, 2008 at 6:15pm

I am admiring to John Resig :)

# Posted by Manir on Thursday, September 11th, 2008 at 1:18pm

Ohhh… Yes John is great :)

# Posted by Caro on Tuesday, September 16th, 2008 at 3:37pm

Thanks for the info and the link to Firebug.

Wish I could get to Boston but it’s not happening for me this year.

# Posted by Adam Bryson on Monday, September 22nd, 2008 at 6:07am

Sorry. Comments are closed.

August 2008
SunMonTueWedThuFriSat
     12
3456789
10111213141516
17181920212223
24252627282930
31      

Recommended Reading

XML Subscribe

Grab the RSS feed for this blog.

JavaScript API

Grab the RSS feed of comments for this entry.