开发者

Can you get selective cut-down versions of jQuery and Sizzle?

JQuery is progressively becoming bigger and bigger. But, for me 50% of functionalit开发者_如何转开发y is never used. For example, I never use wrap() and I dont need live(). In addition to this, I never use most of selectors.

Are there projects, that create smaller cut-down packs of the jquery library?


Not that I am aware, and probably for good reason.

You may never use some of these things explicitly, but you may find that some of the functionality you don't use is used implicitly by the jQuery functions you do call.

I suspect that isolating and untying aspects of jQuery in the way that you want is not actually that easy due to inherent interdependency.

There is also supportablility aspect. If we could get cut-down versions of jQuery in this way then it may open the library up to unpredicted bugs. Imagine the difficulty the jQuery team would have in supporting a library that could have hundreds, possibly thousands of physical versions around the world, all of which might be full size, minified and gzipped.

And then, how would you manage upgrades, bug fixes. Future versions of jQuery would have to interdepend in the same way to ensure you can selectively chose the items you want with each new version.

The fact of the matter is that jQuery isn't that big:

  • Production (23KB, Minified and Gzipped)
  • Development (156KB, Uncompressed Code)

So, you're as well including the whole thing.

I realise that the jQuery UI allows you to do something like this, but that is a series of independent and isolated modules built upon the core framework that can be issued, changed and supported independently.


while not exactly cut down versions of jquery there are sintactically similar options built for mobile use like zepto https://github.com/madrobby/zepto (8.8kb or 2.4kb min and gzipped) and xui https://github.com/xui/xui (9.4kb or 4.1kb min and gzipped)

(comment for anyone stumbling on this from search)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜