Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move jQuery 1.9 deprecated code and tests to compat plugin #24

Closed
dmethvin opened this issue Oct 10, 2012 · 4 comments

Comments

Projects
None yet
3 participants
@dmethvin
Copy link
Member

commented Oct 10, 2012

Features like jQuery.browser are being removed from jQuery 1.9 to clean up the API, reduce the size of the library, and reflect the best practices that we preach. To ensure that we don't break too much code, they will be available in a jquery-compat.js plugin that can be included alongside jQuery 1.9 or 2.0.

I don't think there's a whole lot of actual coding to be done here, but it does cross a bunch of areas so I've marked it as something that could involve all four core tables. You could even say, 😏 ➡️ 😎, this problem requires quad-core processing. Here are the tasks I can see at the moment:

  • Identify the existing Trac tickets related to removing these features, or create new ones if they don't already exist.
  • Ensure that the API docs are clear that these were deprecated as of some previous version (many as of 1.8) and are removed in 1.9 but can still be found in the compat plugin. Some banner or background should make it clear so people won't accidentally use these. The current docs aren't in-your-face enough IMO.
  • Move the API or functionality from the core code and tests to the plugin. Each API call should go in its own file so that it is possible to include them separately. Unit tests can be done only on the combined file if that's easier.
  • Create a build file to create and lint the combined file but perhaps also minify the individual files so they can be used without the entire plugin.

I was thinking it would be useful if the uncompressed "development" version of the plugin would generate console messages to warn that deprecated/removed functions were being used. Uglify has a feature to allow these to be removed as dead code in the minified builds. It might be possible to even use the compat plugin as a migration tool with <1.9 code to let you know that something was using features that should be avoided or rewritten.

NOTE: Not all deprecated APIs are being removed; for example .live() is staying although it is deprecated. Also note that not all removed functionality has to be supported by the compat plugin if it turns out to be too difficult to do--let's discuss as we come to those situations.

@ghost ghost assigned dmethvin Oct 10, 2012

@dmethvin

This comment has been minimized.

Copy link
Member Author

commented Oct 15, 2012

Specific code affected that needs to be moved to the compat plugin:

  • $.browser
  • $.sub
  • $.fn.toggle (the one in event.js)
  • events triggered inside $.fn.data
  • "hover" pseudo-event
  • attrFn object
@elgreg

This comment has been minimized.

Copy link

commented Oct 15, 2012

Submitted a pull request for "hover" pseudo-event: jquery/jquery#969

@rascalking

This comment has been minimized.

Copy link

commented Oct 15, 2012

Submitted a pull request for fn.toggle: jquery/jquery#970

This also makes the deprecated unit tests respect the grunt deprecated flag.

@dmethvin

This comment has been minimized.

Copy link
Member Author

commented Oct 17, 2012

@dmethvin dmethvin closed this Oct 17, 2012

alok108 pushed a commit to alok108/GP that referenced this issue Nov 14, 2013

mescoda pushed a commit to mescoda/jquery that referenced this issue Nov 4, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.