Permalink
Browse files

jQuery Compat is now jQuery Migrate!

1 parent 77c552d commit 8bd5e946305cd914db7be366eb5dbab957ebee94 @dmethvin dmethvin committed Dec 17, 2012
View
@@ -76,7 +76,7 @@ To test the plugin you will need:
### Build a Local Copy of the plugin
-Create a fork of the plugin repo on github at http://github.com/jquery/jquery-compat
+Create a fork of the plugin repo on github at http://github.com/jquery/jquery-migrate
Change directory to your web root directory, whatever that might be:
@@ -87,19 +87,19 @@ $ cd /path/to/your/www/root/
Clone your plugin fork to work locally
```bash
-$ git clone git@github.com:username/jquery-compat.git
+$ git clone git@github.com:username/jquery-migrate.git
```
-Change directory to the newly created dir jquery-compat/
+Change directory to the newly created dir jquery-migrate/
```bash
-$ cd jquery-compat
+$ cd jquery-migrate
```
-Add the jquery-compat master as a remote. I label mine "upstream"
+Add the jquery-migrate master as a remote. I label mine "upstream"
```bash
-$ git remote add upstream git://github.com/jquery/jquery-compat.git
+$ git remote add upstream git://github.com/jquery/jquery-migrate.git
```
Get in the habit of pulling in the "upstream" master to stay up to date as jQuery receives new commits
@@ -192,7 +192,7 @@ By default the plugin runs against the current (jquery-git WIP) version of jQuer
Example:
-http://localhost/jquery-compat/test/?jquery=1.7.2
+http://localhost/jquery-migrate/test/?jquery=1.7.2
This will run the plugin with version 1.7.2 of jQuery, taken from http://code.jquery.com/jquery-1.7.2.js.
View
@@ -1,4 +1,4 @@
-# jquery-compat: Restore deprecated features for jQuery 1.9+
+# jquery-migrate: Migrate older jQuery code to jQuery 1.9+
This project can be used to detect and restore APIs, features or functionality that have been deprecated in jQuery and removed as of version 1.9. They include:
@@ -15,64 +15,64 @@ This project can be used to detect and restore APIs, features or functionality t
* `jQuery.fn.data()` data events (undocumented)
* `jQuery.fn.data("events")` to retrieve event-related data (undocumented)
-See the [warnings](https://github.com/jquery/jquery-compat/blob/master/warnings.md) page for more information regarding messages the plugin generates.
+See the [warnings](https://github.com/jquery/jquery-migrate/blob/master/warnings.md) page for more information regarding messages the plugin generates.
In your web page, make sure to load this plugin *after* the script for jQuery:
```html
<script src="http://code.jquery.com/jquery-1.8.3.js"></script>
-<script src="http://code.jquery.com/jquery-compat-0.1.1b1.js"></script>
+<script src="http://code.jquery.com/jquery-migrate-0.1.1b1.js"></script>
```
The plugin can be included with versions of jQuery as old as 1.6.4 as a migration tool to identify potential upgrade issues. However, the plugin is only required for version 1.9 or higher to restore deprecated and removed functionality.
## Development vs. Production versions
-To make it easier for jQuery developers to find and remove deprecated functionality, the development version of the plugin displays warnings on the browser's console. In browsers that don't support the console interface such as IE7, no messages are generated unless you include a debugging library such as [Firebug Lite](https://getfirebug.com/firebuglite) before including the jQuery Compat plugin. Developers can also inspect the `jQuery.compatWarnings` array to see what error messages have been generated.
+To make it easier for jQuery developers to find and remove deprecated functionality, the development version of the plugin displays warnings on the browser's console. In browsers that don't support the console interface such as IE7, no messages are generated unless you include a debugging library such as [Firebug Lite](https://getfirebug.com/firebuglite) before including the jQuery Migrate plugin. Developers can also inspect the `jQuery.migrateWarnings` array to see what error messages have been generated.
-All warnings generated by this plugin start with the string "JQCOMPAT". A list of the warnings you may see are in [warnings.md](https://github.com/jquery/jquery-compat/blob/master/warnings.md).
+All warnings generated by this plugin start with the string "JQMIGRATE". A list of the warnings you may see are in [warnings.md](https://github.com/jquery/jquery-migrate/blob/master/warnings.md).
### Development version
This version provides console warning messages when deprecated and/or removed APIs are used. Use this version during development and debugging, and whenever you are reporting bugs to the jQuery team.
**Latest released development version:** This file is hosted on jQuery's CDN, and can be hotlinked if desired.
-[http://code.jquery.com/jquery-compat-0.1.1b1.js](http://code.jquery.com/jquery-compat-0.1.1b1.js)
+[http://code.jquery.com/jquery-migrate-0.1.1.js](http://code.jquery.com/jquery-migrate-0.1.1.js)
**Current work-in-progress build:** Although this file represents the most recent updates to the plugin, it may not have been thorougly tested.
-[http://code.jquery.com/jquery-compat-git.js](http://code.jquery.com/jquery-compat-git.js)
+[http://code.jquery.com/jquery-migrate-git.js](http://code.jquery.com/jquery-migrate-git.js)
### Production version
The minified production file is compressed and does not generate console warnings. Do not use this file for development or debugging, it will make your life miserable.
**Latest released production version:**
-[http://code.jquery.com/jquery-compat-0.1.1b1.min.js](http://code.jquery.com/jquery-compat-0.1.1b1.min.js)
+[http://code.jquery.com/jquery-migrate-0.1.1.min.js](http://code.jquery.com/jquery-migrate-0.1.1.min.js)
This file is hosted on jQuery's CDN, and can be hotlinked if desired.
**Current work-in-progress build:** Although this file represents the most recent updates to the plugin, it may not have been thorougly tested. We do not recommend using this file on production sites since it may be unstable; use the released production version above.
-[http://code.jquery.com/jquery-compat-git.min.js](http://code.jquery.com/jquery-compat-git.min.js)
+[http://code.jquery.com/jquery-migrate-git.min.js](http://code.jquery.com/jquery-migrate-git.min.js)
-## Compat Plugin API
+## Migrate Plugin API
This plugin adds two properties to the `jQuery` object that can be used programmatically control and examine its behavior:
-`jQuery.compatWarnings`: This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless `jQuery.compatReset()` is called.
+`jQuery.migrateWarnings`: This property is an array of string warning messages that have been generated by the code on the page, in the order they were generated. Messages appear in the array only once, even if the condition has occurred multiple times, unless `jQuery.migrateReset()` is called.
-`jQuery.compatReset()`: This method clears the `jQuery.compatWarnings` array and "forgets" the list of messages that have been seen already.
+`jQuery.migrateReset()`: This method clears the `jQuery.migrateWarnings` array and "forgets" the list of messages that have been seen already.
## Reporting problems
-Any bugs should be reported on the [jQuery Core bug tracker](http://bugs.jquery.com/) and *must* be accompanied by an executable test case that demonstrates the bug. The easiest way to do this is via an online test tool such as [jsFiddle.net](http://jsFiddle.net/) or [jsbin.com](http://jsbin.com). You can this [this jsFiddle template](http://jsfiddle.net/DUwny/) or [this jsbin template](http://jsbin.com/emuwuy/1/) as a starting point; they already contain links to the work-in-progress versions of both jQuery and the jQuery Compat plugin. Add your code there and post a link to it with your bug report.
+Any bugs should be reported on the [jQuery Core bug tracker](http://bugs.jquery.com/) and *must* be accompanied by an executable test case that demonstrates the bug. The easiest way to do this is via an online test tool such as [jsFiddle.net](http://jsFiddle.net/) or [jsbin.com](http://jsbin.com). You can this [this jsFiddle template](http://jsfiddle.net/DUwny/) or [this jsbin template](http://jsbin.com/emuwuy/1/) as a starting point; they already contain links to the work-in-progress versions of both jQuery and the jQuery Migrate plugin. Add your code there and post a link to it with your bug report.
How to run the tests:
====================================================
Clone this repo, install `grunt`:
```sh
-git clone git://github.com/jquery/jquery-browser.git
-cd jquery-browser
+git clone git://github.com/jquery/jquery-migrate.git
+cd jquery-migrate
npm install -g grunt
```
View
@@ -1,7 +1,7 @@
-scp ../dist/jquery-compat.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-compat-git.js
-curl http://code.origin.jquery.com/jquery-compat-git.js?reload
+scp ../dist/jquery-migrate.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-migrate-git.js
+curl http://code.origin.jquery.com/jquery-migrate-git.js?reload
-scp ../dist/jquery-compat.min.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-compat-git.min.js
-curl http://code.origin.jquery.com/jquery-compat-git.min.js?reload
+scp ../dist/jquery-migrate.min.js jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/jquery-migrate-git.min.js
+curl http://code.origin.jquery.com/jquery-migrate-git.min.js?reload
View
@@ -1,6 +1,6 @@
#!/usr/bin/env node
/*
- * jQuery Compat Plugin Release Management
+ * jQuery Migrate Plugin Release Management
*/
// Debugging variables
@@ -19,20 +19,20 @@ var releaseVersion,
scpURL = "jqadmin@code.origin.jquery.com:/var/www/html/code.jquery.com/",
cdnURL = "http://code.origin.jquery.com/",
- repoURL = "git://github.com/jquery/jquery-compat.git",
+ repoURL = "git://github.com/jquery/jquery-migrate.git",
branch = "master",
// Windows needs the .cmd version but will find the non-.cmd
// On Windows, ensure the HOME environment variable is set
gruntCmd = process.platform === "win32" ? "grunt.cmd" : "grunt",
readmeFile = "README.md",
- devFile = "dist/jquery-compat.js",
- minFile = "dist/jquery-compat.min.js",
+ devFile = "dist/jquery-migrate.js",
+ minFile = "dist/jquery-migrate.min.js",
releaseFiles = {
- "jquery-compat-VER.js": devFile,
- "jquery-compat-VER.min.js": minFile
+ "jquery-migrate-VER.js": devFile,
+ "jquery-migrate-VER.min.js": minFile
};
steps(
@@ -117,9 +117,9 @@ function updateReadme( next ) {
log("Updating " + readmeFile );
if ( !debug ) {
// Change version references from the old version to the new one
- // TODO: make this smarter?
+ // Be sure to allow 1.0.0b2 and such
readme = readme
- .replace( /jquery-compat-\d+\.\d+\.\d+/g, "jquery-compat-" + releaseVersion );
+ .replace( /jquery-migrate-\d+\.\d+\.\w+/g, "jquery-migrate-" + releaseVersion );
fs.writeFileSync( readmeFile, readme );
}
next();
View
@@ -15,7 +15,7 @@ module.exports = function(grunt) {
pkg: '<json:package.json>',
files: [
"src/intro.js",
- "src/compat.js",
+ "src/migrate.js",
"src/attributes.js",
"src/core.js",
"src/data.js",
@@ -71,7 +71,7 @@ module.exports = function(grunt) {
},
mangle: {
defines: {
- JQCOMPAT_WARN: [ "name", 0 ]
+ JQMIGRATE_WARN: [ "name", 0 ]
}
}
}
View
@@ -1,24 +1,24 @@
{
- "name": "jquery-compat",
- "title": "jQuery Compat",
- "description": "APIs and features removed from jQuery core",
+ "name": "jquery-migrate",
+ "title": "jQuery Migrate",
+ "description": "Migrate older jQuery code to jQuery 1.9+",
"version": "0.1.1pre",
- "homepage": "https://github.com/jquery/jquery-compat",
+ "homepage": "https://github.com/jquery/jquery-migrate",
"author": {
"name": "jQuery Foundation and other contributors",
- "url": "https://github.com/jquery/jquery-compat/blob/master/AUTHORS.txt"
+ "url": "https://github.com/jquery/jquery-migrate/blob/master/AUTHORS.txt"
},
"repository": {
"type": "git",
- "url": "git://github.com/jquery/jquery-compat.git"
+ "url": "git://github.com/jquery/jquery-migrate.git"
},
"bugs": {
"url": "http://bugs.jquery.com/"
},
"licenses": [
{
"type": "MIT",
- "url": "https://github.com/jquery/jquery-compat/blob/master/LICENSE-MIT"
+ "url": "https://github.com/jquery/jquery-migrate/blob/master/LICENSE-MIT"
}
],
"dependencies": {
View
@@ -9,23 +9,23 @@ var attrFn = {},
rnoAttrNodeType = /^[238]$/;
// jQuery.attrFn
-if ( JQCOMPAT_WARN ) {
- compatWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );
+if ( JQMIGRATE_WARN ) {
+ migrateWarnProp( jQuery, "attrFn", attrFn, "jQuery.attrFn is deprecated" );
}
jQuery.attr = function( elem, name, value, pass ) {
if ( pass ) {
- if ( JQCOMPAT_WARN ) {
- compatWarn("jQuery.fn.attr( props, pass ) is deprecated");
+ if ( JQMIGRATE_WARN ) {
+ migrateWarn("jQuery.fn.attr( props, pass ) is deprecated");
}
if ( elem && !rnoAttrNodeType.test( elem.nodeType ) && jQuery.isFunction( jQuery.fn[ name ] ) ) {
return jQuery( elem )[ name ]( value );
}
}
// Warn if user tries to set `type` since it breaks on IE 6/7/8
- if ( JQCOMPAT_WARN && name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) {
- compatWarn("Can't change the 'type' of an input or button in IE 6/7/8");
+ if ( JQMIGRATE_WARN && name === "type" && value !== undefined && rnoType.test( elem.nodeName ) ) {
+ migrateWarn("Can't change the 'type' of an input or button in IE 6/7/8");
}
return attr.call( jQuery, elem, name, value );
@@ -37,8 +37,8 @@ jQuery.attrHooks.value = {
if ( jQuery.nodeName( elem, "button" ) ) {
return valueAttrGet.apply( this, arguments );
}
- if ( JQCOMPAT_WARN ) {
- compatWarn("property-based jQuery.fn.attr('value') is deprecated");
+ if ( JQMIGRATE_WARN ) {
+ migrateWarn("property-based jQuery.fn.attr('value') is deprecated");
}
return name in elem ?
elem.value :
@@ -48,8 +48,8 @@ jQuery.attrHooks.value = {
if ( jQuery.nodeName( elem, "button" ) ) {
return valueAttrSet.apply( this, arguments );
}
- if ( JQCOMPAT_WARN ) {
- compatWarn("property-based jQuery.fn.attr('value', val) is deprecated");
+ if ( JQMIGRATE_WARN ) {
+ migrateWarn("property-based jQuery.fn.attr('value', val) is deprecated");
}
// Does not return so that setAttribute is also used
elem.value = value;
View
@@ -13,7 +13,7 @@ jQuery.fn.init = function( selector, context, rootjQuery ) {
(match = rquickExpr.exec( selector )) && match[1] ) {
// This is an HTML string according to the "old" rules; is it still?
if ( selector.charAt( 0 ) !== "<" ) {
- compatWarn("$(html) HTML strings must start with '<' character");
+ migrateWarn("$(html) HTML strings must start with '<' character");
}
// Now process using loose rules; let pre-1.8 play too
if ( context && context.context ) {
@@ -83,9 +83,9 @@ if ( browser.chrome ) {
jQuery.browser = browser;
-if ( JQCOMPAT_WARN ) {
+if ( JQMIGRATE_WARN ) {
// Warn if the code tries to get jQuery.browser
- compatWarnProp( jQuery, "browser", browser, "jQuery.browser is deprecated" );
+ migrateWarnProp( jQuery, "browser", browser, "jQuery.browser is deprecated" );
}
jQuery.sub = function() {
@@ -106,8 +106,8 @@ jQuery.sub = function() {
};
jQuerySub.fn.init.prototype = jQuerySub.fn;
var rootjQuerySub = jQuerySub(document);
- if ( JQCOMPAT_WARN ) {
- compatWarn( "jQuery.sub() is deprecated" );
+ if ( JQMIGRATE_WARN ) {
+ migrateWarn( "jQuery.sub() is deprecated" );
}
return jQuerySub;
};
View
@@ -10,7 +10,9 @@ jQuery.fn.data = function( name ) {
ret = jQuery.data( elem, name );
evt = jQuery._data( elem, name );
if ( ( ret === undefined || ret === evt ) && evt !== undefined ) {
- compatWarn("Use of jQuery.fn.data('events') is deprecated");
+ if ( JQMIGRATE_WARN ) {
+ migrateWarn("Use of jQuery.fn.data('events') is deprecated");
+ }
return evt;
}
}
Oops, something went wrong.

0 comments on commit 8bd5e94

Please sign in to comment.