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

jQuery.fn.bind is deprecated #2729

Closed
evenh opened this issue Oct 17, 2016 · 13 comments
Closed

jQuery.fn.bind is deprecated #2729

evenh opened this issue Oct 17, 2016 · 13 comments

Comments

@evenh
Copy link

evenh commented Oct 17, 2016

While moving a codebase from an old jQuery 1.x installation to the latest and greatest (3.1.1), I enabled the jQuery Migration plugin and upgraded Chosen to version 1.6.2. From the console I could see deprecation warnings (see screenshot). I can confirm that the issue is still present on the master branch as of commit dacfa20.

image

Steps to reproduce

See this example or just any plain example with jQuery 3.1.1 and jQuery migration plugin 3.0.0.

Expected behavior

I expect no deprecation warnings when I run the migration tool.

Actual behavior

A deprecation warning appears in the browser console log.

Environment

  • Chosen Version: 1.6.2 and master (dacfa20)
  • jQuery or Prototype Version: jQuery
  • Browser and Version: Chrome 53.0.2785.143 m
  • OS and Version: Windows 7 Enterprise
@koenpunt
Copy link
Collaborator

We do not officially supporting jQuery 3 yet. And we do support older jQuery versions (1.4...1.7) that do not have the jQuery.fn.on method. If you have any suggestions on how to make this work for all versions, please let us know 😃

@stof
Copy link
Collaborator

stof commented Oct 19, 2016

@koenpunt I suggets bumping the min requirement to jQuery 1.7 to be able to use .on(). People updating to new versions of Chosen will hopefully be able to update jQuery to a version newer than 4 years.

@koenpunt
Copy link
Collaborator

koenpunt commented Oct 19, 2016

@stof I don't think that @pfiller will agree on dropping support for older versions of jQuery, if the jQuery.fn.bind function being deprecated is the only issue.

Also, a deprecation doesn't break anything yet, so bind probably will be around until the next major version change.

@rkgladson
Copy link

@koenpunt Unfortunately that means that those who have a dependency on Jquery 3.x, and wish to use slim, cannot, since it strips out all deprecated functions. This is the case for Angular 1.6+.

@stof
Copy link
Collaborator

stof commented Jan 12, 2017

@koenpunt this is a question between dropping support for a version of jquery released in 2011 or between dropping support for the current jQuery versions. I vote for dropping support of old versions.

@Systho
Copy link

Systho commented Feb 1, 2017

Since there is already a chosen.jquery and chosen.proto, why not make a chosen.jquery3 file ?

@koenpunt
Copy link
Collaborator

koenpunt commented Feb 1, 2017

It's still not me to decide, so please @pfiller can you weigh in on this discussion?

Nb. I dislike the idea of chosen.jquery3

@stof
Copy link
Collaborator

stof commented Feb 1, 2017

there is no need for a jQuery 3 build IMO. We can support jquery 1.7 and 3.x with the same binding code.
And people who are using a jquery version from 2011 are unlikely to use an uptodate version of chosen anyway (and they should really upgrade jQuery)

The4thLaw added a commit to The4thLaw/demyo that referenced this issue Feb 5, 2017
Include Migrate plugin to be sure we don't break anything.
Chosen is currently impacted by harvesthq/chosen#2729 (nothing too serious atm)
@basilv
Copy link

basilv commented Mar 6, 2017

I ran into this issue moving my app to jquery 3. Chosen was the only plugin whose latest version still had migration warnings. I vote for fixing this issue.

@stof
Copy link
Collaborator

stof commented Apr 28, 2017

@pfiller Would you accept dropping support for the jQuery 1.6 version (released in 2011) in favor of supporting jQuery 3 (which is the current stable jQuery version since 1 year now) ?

If no, it may be possible to support both the new and old API in the codebase, but this would increase maintenance.
And as said before, I doubt that people using the latest version will use such an old jQuery version (and then, we can tell them to use an old version of Chosen too if they insist on using outdated jQuery, and forbid them to complain about bugs as they are missing 6 years of jQuery bug fixes anyway)

@tjschuck
Copy link
Member

tjschuck commented May 1, 2017

👍 on bumping support to jQuery 1.7+ if that will also include 3 support.

@JeffSchwandt
Copy link

I support adding support for jQuery 3, especially since that is the only version of jQuery without known vulnerabilities. See http://research.insecurelabs.org/jquery/test/ and hit "Run"

@stof
Copy link
Collaborator

stof commented Jun 7, 2018

@JeffSchwandt jQuery 3 is supported since the 1.8.0 version of Chosen released in august 2017 (which is why this issue was closed in August 2017 too)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants