Skip to content

Commit dc1d703

Browse files
committed
Docs: Clarify wording around deprecated/removed methods
Fixes #204 Closes #208
1 parent 5d161b3 commit dc1d703

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/core.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ for ( findProp in oldFind ) {
6262

6363
// The number of elements contained in the matched element set
6464
jQuery.fn.size = function() {
65-
migrateWarn( "jQuery.fn.size() is deprecated; use the .length property" );
65+
migrateWarn( "jQuery.fn.size() is deprecated and removed, use the .length property" );
6666
return this.length;
6767
};
6868

@@ -94,6 +94,6 @@ migrateWarnProp( jQuery, "unique", jQuery.uniqueSort,
9494

9595
// Now jQuery.expr.pseudos is the standard incantation
9696
migrateWarnProp( jQuery.expr, "filters", jQuery.expr.pseudos,
97-
"jQuery.expr.filters is now jQuery.expr.pseudos" );
97+
"jQuery.expr.filters is deprecated, use jQuery.expr.pseudos" );
9898
migrateWarnProp( jQuery.expr, ":", jQuery.expr.pseudos,
99-
"jQuery.expr[\":\"] is now jQuery.expr.pseudos" );
99+
"jQuery.expr[':'] is deprecated, use jQuery.expr.pseudos" );

src/traversing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
var oldSelf = jQuery.fn.andSelf || jQuery.fn.addBack;
22

33
jQuery.fn.andSelf = function() {
4-
migrateWarn( "jQuery.fn.andSelf() replaced by jQuery.fn.addBack()" );
4+
migrateWarn( "jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()" );
55
return oldSelf.apply( this, arguments );
66
};

warnings.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ To allow developers to identify and fix compatibility issues when migrating olde
88

99
The production (compressed) version of the plugin does not generate warnings. To continue using jQuery code that has compatibility issues without making any changes and without console messages, simply include the production version in the file rather than the development version. See the [README](README.md) for download instructions.
1010

11-
All messages generated by this plugin start with the text "JQMIGRATE" for easy identification. The warning messages, causes, and remediation instructions are listed below.
11+
All messages generated by this plugin start with the text "JQMIGRATE" for easy identification. The warning messages, causes, and remediation instructions are listed below. Items listed as **deprecated and removed** must be changed before the code will work properly without the Migrate plugin. Items listed as only **deprecated** are still supported by the current version but no longer considered a good practice, and may be removed in the future.
1212

1313
### JQMIGRATE: Migrate is installed, version X
1414
### JQMIGRATE: Migrate is installed with logging active, version X
@@ -67,13 +67,13 @@ This is _not_ a warning, but a console log message the plugin shows when it firs
6767

6868
**Solution**: In most cases it is sufficient to change all occurrences of `.pipe()` to `.then()`. Ensure that you aren't relying on context/state propagation (e.g., using `this`) or synchronous callback invocation, which were dropped from `.then()` for Promises/A+ interoperability as of jQuery 3.0.
6969

70-
### JQMIGRATE: jQuery.fn.andSelf() replaced by jQuery.fn.addBack()
70+
### JQMIGRATE: jQuery.fn.andSelf() is deprecated and removed, use jQuery.fn.addBack()
7171

7272
**Cause**: The `.andSelf()` method has been renamed to `.addBack()` as of jQuery 1.9 to better reflect its purpose of adding back the previous set of results. The old alias was removed in jQuery 3.0.
7373

7474
**Solution**: Replace any use of `.andSelf()` with `.addBack()`.
7575

76-
### JQMIGRATE: jQuery.fn.size() is deprecated; use the .length property
76+
### JQMIGRATE: jQuery.fn.size() is deprecated and removed, use the .length property
7777

7878
**Cause**: The `.size()` method returns the number of elements in the current jQuery object, but duplicates the more-efficient `.length` property which provides the same functionality. As of jQuery 1.9 the `.length` property is the preferred way to retrieve this value. jQuery 3.0 no longer contains the `.size()` method.
7979

@@ -167,8 +167,8 @@ See jQuery-ui [commit](https://github.com/jquery/jquery-ui/commit/c0093b599fcd58
167167

168168
**Solution**: Replace all uses of `jQuery.unique` with `jQuery.uniqueSort` which is the same function with a better name.
169169

170-
### JQMIGRATE: jQuery.expr[':'] is jQuery.expr.pseudos
171-
### JQMIGRATE: jQuery.expr.filters is now jQuery.expr.pseudos
170+
### JQMIGRATE: jQuery.expr[':'] is deprecated, use jQuery.expr.pseudos
171+
### JQMIGRATE: jQuery.expr.filters is deprecated, use jQuery.expr.pseudos
172172

173173
**Cause:** The standard way to add new custom selectors through jQuery is `jQuery.expr.pseudos`. These two other aliases are deprecated, although they still work as of jQuery 3.0.
174174

0 commit comments

Comments
 (0)