TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Jquery.com uses only 34% of jQuery

19 点作者 bolinfest大约 14 年前

4 条评论

weego大约 14 年前
I really feel the headline should be "Non-issue used for article to drive advert for my FireFox addon". There was really nothing of interest there; the whole point of the kind of toolkit (jQuery) is to have good coverage across as many common tasks as possible, but if you need very specific functionality you end up with something of a scatter-gun. Not being able to compile you own intensely specific version is a trade off between ease of setup over results, personally I would say it is the correct choice (for standard web use, I wholeheartedly disagree with they way that jquery mobile is heading).
Jd大约 14 年前
The benefit of using the whole jQuery library on a single page is that it will likely already be cached, particularly if you are using the Google version.<p>The largest time expenditure is on the loading from an external server, not the processing once it is local. Don't think the author understands this.
评论 #2466686 未加载
edanm大约 14 年前
From the Article:<p>"From these preliminary results, I believe that most sites that use jQuery could considerably reduce the amount of JavaScript that they serve by using Closure. As always, compiling custom JavaScript for every page must be weighed against caching benefits, though I suspect that the Compiler could find a healthy subset of jQuery that is universal to all pages on a particular site."<p>This is the interesting point - is there a subset of jQuery that includes enough for most sites? That subset could potentially be served alongside the main jQuery release, and if enough sites use it, it might be worth it.<p>Otherwise, right now, caching means jQuery bloat isn't too big a problem, I believe.
评论 #2466942 未加载
tosh大约 14 年前
I think picking jQuery as an example wasn't the best choice since it probably is already cached for sites that use google's or other popular CDNs. This is true for StackOverflow (one of the examples in the article).<p>The main point of the article still stands though. Closure and similar tools make a lot of sense because they can reduce the size of js quite a bit. Especially for huge apps that require several libraries but only use parts of them it can make a huge difference.