Problem/Motivation

Some deprecated functions are still missing. I suggest to list them here and add them in a MR.
Feel free to complete the list.

  • jQuery.unique()

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#11 3567201-test.png38.97 KBdanrod
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

guillaumepacilly created an issue. See original summary.

guillaumepacilly’s picture

Status: Active » Needs work
danrod’s picture

Thanks @guillaumepacilly , there is an ESLINT warning to fix: https://git.drupalcode.org/issue/jquery_deprecated_functions-3567201/-/j...

Which other deprecated functions are missing? I'll have to check the jQuery docs and look for missing deprecated functions/objects/constants.

guillaumepacilly’s picture

Hi @danrod

I fixed the ESLINT warning, thanks!

For now I only ran into the unique function missing. But I asked AI to check, and as always with AI should be double checked but it seems correct:

Deprecated in jQuery 3.0+ and Removed in jQuery 4.0:

Ajax Methods:

  • $.ajax() - success, error, and complete callbacks (use .done(), .fail(), .always() instead)
  • $.get(), $.post() - callback parameters (use promises)
  • jqXHR.success(), jqXHR.error(), jqXHR.complete() (use .done(), .fail(), .always())

Selector Extensions (removed, use .filter() instead):

  • :eq() - Use .eq() method
  • :lt() - Use .slice() method
  • :gt() - Use .slice() method
  • :even - Use .filter(":nth-child(even)")
  • :odd - Use .filter(":nth-child(odd)")
  • :first - Use .first() method
  • :last - Use .last() method

Event Methods:

  • .bind() - Use .on() instead
  • .unbind() - Use .off() instead
  • .delegate() - Use .on() instead
  • .undelegate() - Use .off() instead
  • .hover() (two-function signature deprecated)
  • .load() (event shorthand)
  • .unload()
  • .error() (event shorthand)
  • .size() - Use .length property
  • $.proxy() - Use native Function.prototype.bind()

Event Shorthands (all removed in jQuery 4):

  • .blur()
  • .focus()
  • .focusin()
  • .focusout()
  • .resize()
  • .scroll()
  • .click()
  • .dblclick()
  • .mousedown()
  • .mouseup()
  • .mousemove()
  • .mouseover()
  • .mouseout()
  • .mouseenter()
  • .mouseleave()
  • .change()
  • .select()
  • .submit()
  • .keydown()
  • .keypress()
  • .keyup()
  • .contextmenu()

DOM Manipulation:

  • .andSelf() - Use .addBack() instead
  • $.unique() - Use $.uniqueSort() instead
  • $.parseJSON() - Use native JSON.parse() instead

Effects:

  • .toggle(handler, handler) - Event handler version removed
  • jQuery.fx.interval - No replacement (browser-dependent)

Utilities:

  • $.isArray() - Use Array.isArray() instead
  • $.isNumeric() - Use native checks
  • $.isFunction() - Use typeof x === "function"
  • $.isWindow() - No direct replacement
  • $.now() - Use Date.now() instead
  • $.trim() - Use native String.prototype.trim() instead
  • $.type() - Use native typeof or instanceof
  • $.camelCase() - No replacement

Deferred/Promise:

  • deferred.pipe() - Use .then() instead
  • Mutable promise methods on returned values

Data:

  • $.hasData() - Limited use case

CSS:

  • .context property
  • .selector property
  • jQuery.cssNumber object access

Internal/Undocumented:

  • jQuery.support - Most properties removed
  • $.nodeName() - Internal method
  • $.isArray(), $.isWindow(), $.isFunction() - Use native equivalents

The module already cover much of it

danrod’s picture

Thanks @guillaumepacilly , I'll look into the list in detail and see what's missing.

danrod’s picture

Assigned: Unassigned » danrod
danrod’s picture

I would like to merge this and deal with with the other missing jQuery functions in other issue(s), I'd like to create a new release.

danrod’s picture

Status: Needs work » Needs review
danrod’s picture

Status: Needs review » Reviewed & tested by the community
danrod’s picture

StatusFileSize
new38.97 KB

I tested this and works as expected (added tests):

Testing unique jquery deprecated function

Thanks for this, I'll merge this to the 1.0.x branch.

danrod’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

danrod’s picture

Assigned: danrod » Unassigned

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.