跳到主要内容

Devs欢迎jQuery 2.0发布

如在官方jQuery博客,JavaScript库jQuery2.0已经出现。主要的变化似乎是放弃了对旧版本的InternetExplorer的支持:jQuery 2只在IE9和更新版本上运行,遗留支持由(仍然保持着的)1.x分支完成。

+$The upshot of this change has been a reduction in file size. The jQuery team stated the final 2.0.0 file is 12 per cent smaller than the 1.9.1 file, mostly due to the “elimination of patches that were only needed for IE 6, 7 and 8”. Android 2.x support is reportedly now also in the firing line, with market-share being closely monitored, until Android 2.x can be crossed off the support list. “We don’t expect it to take very long,” remarked the blog post.

+$Developers .net spoke to seemed positive about the new release. “I was very pleased to see that jQuery 2.0 has made such significant improvements to the overall build size,” thoughtAddy Osmani,谷歌开发程序工程师。“12%的减少并不是一项小壮举,许多开发人员都专注于减少移动网络请求的字节,因此提供一个极简的10 KB(Gzip)构建是非常棒的。”

+$Osmani added that “dropping ‘oldIE’ support was also welcome,” and inline with the web community’s “march towards optimising for modern web browsers”. Developer and writer杰克富兰克林+$agreed that the latest release was “great news for those developers lucky enough to not have to support older browsers,” but he wanted to emphasise jQuery’s consideration for those who aren’t so fortunate: “For those of us—like me—who still have to support those browsers, we won't notice the difference, because the jQuery team will continue to support, maintain and develop 1.x in tandem with 2.x, with 1.x including the legacy browser support.”

在此基础上,Franklin指出,开发人员应该仔细检查他们的需求,而不是立即转向新的:“如果您仍然需要遗留的IE支持,坚持1.x。如果你不这么做,就搬到2倍。除了保存文件大小之外,还有大量的bug修复和改进,两个版本的API都是相同的。“他补充说,jQuery团队也应该得到那些做出飞跃的人的赞扬:“迁移也是非常简单的,因为迁移插件这将指出代码中使用不推荐方法的位置。“



翻译字数超限