Deprecate jQuery.isArray #2961

Closed
markelog opened this Issue Feb 29, 2016 · 23 comments

Comments

Projects
None yet
7 participants
Member

markelog commented Feb 29, 2016

Seems fulfilled with Array.isArray

markelog added this to the 3.1.0 milestone Feb 29, 2016

Member

mgol commented Feb 29, 2016

👍

markelog added the Core label Mar 3, 2016

agreed

Contributor

FarSeeing commented Apr 18, 2016

I guess it's worth moving Array.isArray into /var and re-use:

   raw     gz Compared to master @ 44cb97e0cfc8d3e62bef7c621bfeba6fe4f65d7c    
  +601   +147 dist/jquery.js                                                   
   -60    -12 dist/jquery.min.js
Member

markelog commented Apr 18, 2016

Nice find, but with this ticket we would need to move it to deprecated.js module

Contributor

FarSeeing commented Apr 18, 2016

That's a calculation with the following code in deprecated.js:

jQuery.extend( {
    isArray: isArray
} );
Member

markelog commented Apr 18, 2016 edited

You mean gzip size will also change in identical manner if we move it to deprecated.js as if we moved it to /var?

Contributor

FarSeeing commented Apr 18, 2016

That's the result of having both /var file creation for storing variable and moving declaration to deprecated.js.

Member

mgol commented Apr 18, 2016 edited

Deprecation would mean that we:

  1. Move jQuery.isArray to deprecated.js
  2. Change all internal uses from jQuery.isArray to Array.isArray

so we can't have the var-module containing the old code here.

Contributor

FarSeeing commented Apr 18, 2016

Right, but as other built-in methods (slice, concat, toString etc) isArray could be stored in /var.

Member

mgol commented Apr 18, 2016

So you propose to put Array.isArray in a var-module, not jQuery.isArray? I understood it differently before.

Contributor

FarSeeing commented Apr 18, 2016

That's right. Sorry for not explaining that before.

Member

markelog commented Apr 18, 2016 edited

I wouldn't want size to influence our file hierarchy, it would be pretty confusing, also all deprecated modules should be stored in deprecated module, since it would also be confusing but now for users too who want to exclude or use deprecated stuff

Member

mgol commented Apr 18, 2016 edited

@markelog I agree to an extent but @FarSeeing only proposes to put Array.isArray in a var-module, not the soon-to-be-deprecated jQuery.isArray; see our last 2 comments.

Member

markelog commented Apr 18, 2016

Oh, i see, but i wouldn't do that too :), don't really see the point

Guys, is there a possibility of me submitting a PR for this?

Member

mgol commented Apr 24, 2016

@ShashankaNataraj Sure! Do you know what needs to be done?

Member

markelog commented Apr 24, 2016

I would wait until we would have discussion about this, it seems some team members feel "deprecation" process of core methods might be inappropriate.

ShashankaNataraj commented Jul 11, 2016 edited

@mgol @markelog Correct me if Im wrong, tasks for this issue are:

  • Move jquery.isArray to deprecated.js
  • Change all usages of jQuery.isArray to Array.isArray
Member

mgol commented Jul 11, 2016

Also, the third item - its unit tests have to be moved to jQuery.isArray as
well.

Also, if this hasn't been mentioned before - each deprecation, apart from a
jQuery PR and an API site issue needs a jQuery Migrate issue to polyfill
the API and warn against using it.

Michał Gołębiowski

ShashankaNataraj referenced this issue in jquery/api.jquery.com Jul 11, 2016

Open

Deprecate jQuery.isArray docs changes #950

ShashankaNataraj commented Jul 11, 2016 edited

@mgol Didnt get what you meant by

its unit tests have to be moved to jQuery.isArray as well.

I understand unit tests need to be modified but jQuery.isArray tests need to be removed right?

Actually I have been raising issues like this for every deprecation issue Im working on..

Raised one for this issue too.

Member

mgol commented Jul 14, 2016

I understand unit tests need to be modified but jQuery.isArray tests need to be removed right?

Not removed but moved to test/unit/deprecated.js.

Actually I have been raising issues like this for every deprecation issue Im working on..

I've seen them, thanks for that! I meant that apart from the API issue we also need an issue at https://github.com/jquery/jquery-migrate/issues about a need to restore the API (because people may exclude the deprecated module) with a warning against using it.

Contributor

kumarmj commented Aug 14, 2016

@ShashankaNataraj seems not to be working on this. Can I please take this ?

Contributor

kumarmj commented Aug 14, 2016 edited

Correct me, for any changes

  • Move jquery.isArray to deprecated.js
  • Change all usages of jQuery.isArray to Array.isArray
  • Modify unit tests
  • Create a jquery-migrate issue for jQuery.isArray

mgol closed this in 1b9575b Nov 30, 2016

Bruce17 referenced this issue in guillaumepotier/Parsley.js May 9, 2017

Closed

Replace $.isArray with Array.isArray #1199

2 of 2 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment