Would it be possible to have a build option that would build sizzle.js and jquery.js as separate, independent files?
I would like to have a version of jQuery that depends on, but does not embed, the stock sizzle.js. This is currently not possible because jQuery modifies the embedded sizzle.js in order to tack some utility methods onto the jQuery namespace.
Currently I have to update both jQuery and Sizzle in order to have a jquery.js that the depends on Sizzle:
I update Sizzle's EXPOSE from:
// EXPOSE
window.Sizzle = Sizzle;
to:
// EXPOSE
Sizzle.util = {};
Sizzle.util.getText = getText;
Sizzle.util.isXMLDoc = isXML;
Sizzle.util.contains = contains;
window.Sizzle = Sizzle;
and replace the embedded sizzle with:
jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.filters;
jQuery.unique = Sizzle.uniqueSort;
jQuery.getText = Sizzle.util.getText;
jQuery.isXMLDoc = Sizzle.util.isXML;
jQuery.contains = Sizzle.util.contains;
This allows me to use the same sizzle.js file as source for the selector engine in jQuery and Prototype (which has support for using the Sizzle engine in the development branch (
http://github.com/sstephenson/prototype).