learn.jquery.com: Deprecated and Beaking Changes

オープン
#740 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
ドキュメント
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, jquery
領域
documentation

調査の方向性

リンク先のLearning CenterとCode Organization/object literalsページから始め、ドキュメント化された例を、ここで説明されているjQuery 1.8.3、3.0.0、3.1.1のケースと比較してください。影響を受けるパターンについて、バージョン固有のガイダンスと例をドキュメントに追加し、非推奨の動作と壊れた動作を明確に扱ってください。

索引モデルが issue の本文から書いたものです。

説明

I find myself struggling for answers, that just do not seem to be available anywhere. Trying to use
object literals as shown in the Learning Center leads to warnings, upgrading jQuery leads to the code not working.

//Using an object literal for a jQuery feature
var myFeature = {
  	init: function() {
	    console.log(Math.random());
    }
};
myFeature.init();
Version Console
jquery-1.8.3.js Use of getPreventDefault() is deprecated. Use defaultPrevented instead.
jquery-migrate-3.0.0.js jQuery.fn.load() is deprecated.
jquery-3.1.1 TypeError: url.indexOf is not a function.

I was able to find a different way to do it. But I ended up the same results. So the following code does not bring me any closer to building object literals in 3.1.1

// Create your own jQuery function
jQuery.fn.extend({
    init: function () {
        console.log(Math.random());
    }
});
$.fn.init();

So how is this an issue? Well, versions changes have affected the fundamental use. But the Learning Center only provides one (outdated) example.

$( document ).ready( myFeature.init );  // Deprecated
$( document ).on( 'ready' , myFeature.init );  // Deprecated?
$.fn.myFeature.init;  // Is this the correct way?

I suggest the Learning Center is updated with version specific documentation that shows relative examples for each version. I would like to help, but skill level is rather low.

Sincerely,
Brian LaVallee

主要言語
JavaScript
スター
914
フォーク
472
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

jquery/learn.jquery.com のほかの issue

jquery/learn.jquery.com の issue をすべて見る

似ている issue

JavaScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。