jQuery 1.10.0 / 2.0.1 が同時リリース

jQuery 1.10.0、および 2.0.1 が同時にリリースされました。2バージョン同時リリースとしては最初のバージョンになります。

jQuery先週ですが、 jQuery 1.10.0、および 2.0.1 が同時にリリースされました。jQuery 1.x 系と、2.x 系は、お互いに機能的には完全に互換性を保ちつつも、2.x 系は IE8 以前のサポートは捨てて、より高速に、安定して動作させることを目指したバージョンとして、一方の 1.x 系は IE8 以前をサポートするレガシーブラウザ向けのバージョンとなります。

この 2バージョンを並行して開発していく形は、jQuery 2.0 が正式リリースされた際に、今後はこういう形でいくよと予告されていたものですが、今回がその最初のリリースとなります。

jQuery 1.10.0 and 2.0.1 Released : Official jQuery Blog

A simultaneous release isn't always easy, but it can be very satisfying. The team is certainly satisfied with this duo of deliveries; those of you who have already upgraded to the 1.9/2.0 level should have an easy time with these versions. If you're upgrading older code, the advice in the jQuery 1.9 upgrade guide still applies to these two releases as well. Also don't forget that jQuery. 2.0 doesn't support IE 6, 7, or 8 since we're leaving that work to the 1.x branch. If you need some help updating or keeping older pre-1.9 jQuery code going, don't forget about the jQuery Migrate plugin.

jQuery 1.10.0 and 2.0.1 Released : Official jQuery Blog から引用

同時リリースは簡単なことじゃないけど、結果には満足してるよ。すでに、jQuery 1.9 / 2.0 にアップデート済みの人は今回のバージョンにアップデートするのは簡単だからどうぞ。古いコードを使っている場合は、「jQuery 1.9 アップグレードガイド」 を確認してね。 jQuery. 2.0 は IE 6、7、8 をサポートしてないから気を付けて。サポートしているのは 1.x 系だよ。1.9 より前の古いバージョンで稼働しているコードを維持したければ、jQuery Migrate plugin があるからそれ使え。

ということで、jQuery 1.9 アップグレードガイドについては、過去に翻訳したものをこの Blog でも公開していますので、下記をご参考まで。

jQuery 1.10.0 / 2.0.1 での変更点

今回のアップデートにより加えられた変更点としては下記が jQuery Blog では挙げられています。

Relaxed HTML parsing: You can once again have leading spaces or newlines before tags in $(htmlString). We still strongly advise that you use $.parseHTML() when parsing HTML obtained from external sources, and may be making further changes to HTML parsing in the future.

Increased modularity: In either version, you now can do a custom build that excludes the .wrap(), .wrapAll(), .wrapInner() and .unwrap() methods. If all your code is using the newer .on() event methods introduced in jQuery 1.7, you can also exclude .bind() and .delegate() as well. The builds available on the jQuery, Google, and Microsoft CDNs continue to include all methods to provide maximum compatibility.

No more IE9 focus of death: If a page inside an iframe attempts to focus an element or even tries to read document.activeElement before the page is ready, it causes an error. We now work around this issue.

Cordova bug fix in 2.0.1: The Cordova deviceready event doesn't properly set an event target, so we work around the problem by setting the target to document.

jQuery 1.10.0 and 2.0.1 Released : Official jQuery Blog から引用

  • 柔軟な HTML パース: $(htmlString) で、タグの前に改行やスペースを入れられる。けど、$.parseHTML() 使え。
  • モジュール性の強化: 2バージョンとも、カスタムビルドで .wrap().wrapAll().wrapInner().unwrap() メソッドを除外できるよ。.on() メソッド (jQuery 1.7 で導入) を使用している場合は、.bind().delegate() の除外も可能。jQuery、Google、Microsoft の CDN で提供される jQuery は可能な限りの互換性を保つため、すべてのメソッドが含まれます。
  • IE9 のフォーカスが死ぬ件: iframe を含むページで、ページ読み込み前にフォーカスをしようとしたり、document.activeElement を読み込むと、エラーが発生する問題は解決した。
  • Cordova のバグは 2.0.1 で解決: Cordova の deviceready がイベント処理の対象となる要素を適切に処理しない問題は、document をターゲットにすることで対策したよ。

その他、詳しい Changelog はリンク先記事の下部に書かれています。

CDN からの読み込み

jQuery の CDN からは下記のように読み込めます。

// jQuery v1.10.0
<script src="http://code.jquery.com/jquery-1.10.0.min.js"></script>
// jQuery v2.0.1
<script src="http://http://code.jquery.com/jquery-2.0.1.min.js"></script>

※ jQuery の CDN は https では提供されていませんので、ネットワークパス参照 (要するに src="//code.jquery.com/" みたいな書き方) はしない方がいいです。

Google、Microsoft CDN に関しては、この記事を書いている時点では、まだ配信が開始されていないようですね。 下記 CDN でも配信開始されました。

参考エントリー

記事をここまで御覧頂きありがとうございます。
この記事が気に入ったらサポートしてみませんか?