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

Deprecate jQuery.parseJSON #2800

Closed
mgol opened this Issue Jan 4, 2016 · 10 comments

Comments

Projects
None yet
6 participants
@mgol
Member

mgol commented Jan 4, 2016

jQuery.parseJSON was needed for IE<8 & Android 2.3, apart from that it was kept on both branches mostly so that we're API-compatible between them. Those reasons are no longer valid on master so IMO we should deprecate this method and switch all internal uses to JSON.parse. We could then remove it in 4.0.

@gibson042

This comment has been minimized.

Show comment
Hide comment
@gibson042

gibson042 Jan 4, 2016

Member

I'm in favor.

Member

gibson042 commented Jan 4, 2016

I'm in favor.

@timmywil

This comment has been minimized.

Show comment
Hide comment
@timmywil

timmywil Jan 4, 2016

Member

+1

Member

timmywil commented Jan 4, 2016

+1

@jaubourg

This comment has been minimized.

Show comment
Hide comment
@jaubourg

jaubourg Jan 4, 2016

Member

Makes sense: +1.

Member

jaubourg commented Jan 4, 2016

Makes sense: +1.

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Jan 4, 2016

Member

Yepsies

Member

markelog commented Jan 4, 2016

Yepsies

@markelog markelog added this to the 4.0.0 milestone Jan 4, 2016

@markelog

This comment has been minimized.

Show comment
Hide comment
@markelog

markelog Jan 4, 2016

Member

Only one concern, if JSON.parse would have a bad implementation in some environment (like in Android 2.3 but not really), we will not be able to fix it.

But it seems pretty improbable

Member

markelog commented Jan 4, 2016

Only one concern, if JSON.parse would have a bad implementation in some environment (like in Android 2.3 but not really), we will not be able to fix it.

But it seems pretty improbable

@dmethvin

This comment has been minimized.

Show comment
Hide comment
@dmethvin

dmethvin Jan 4, 2016

Member

👍
I think it makes sense to nudge people towards native methods when we have nothing to add. We can add a warning/shim in Migrate for this. If there is a bad or missing JSON.parse implementation in some environment people can always shim it or use an older version of jQuery.

Member

dmethvin commented Jan 4, 2016

👍
I think it makes sense to nudge people towards native methods when we have nothing to add. We can add a warning/shim in Migrate for this. If there is a bad or missing JSON.parse implementation in some environment people can always shim it or use an older version of jQuery.

@timmywil timmywil removed the Needs review label Jan 5, 2016

@mgol mgol self-assigned this Jan 14, 2016

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Jan 14, 2016

Member

Assigning to myself.

Member

mgol commented Jan 14, 2016

Assigning to myself.

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Jan 14, 2016

Member

BTW, I don't think we have to wait for 4.0.0, I'd like to do it for 3.1.0 (semver requires bumping only a minor to deprecate and IMO we should follow that).

Member

mgol commented Jan 14, 2016

BTW, I don't think we have to wait for 4.0.0, I'd like to do it for 3.1.0 (semver requires bumping only a minor to deprecate and IMO we should follow that).

@mgol mgol modified the milestones: 3.1.0, 4.0.0 Jan 14, 2016

silverwind added a commit to StylishThemes/GitHub-Dark-Script that referenced this issue Jan 15, 2016

Replace $.parseJSON with JSON.parse
jQuery.parseJSON will be deprecated:

jquery/jquery#2800

@mgol mgol modified the milestones: 3.0.0, 3.1.0 Feb 24, 2016

mgol added a commit to mgol/jquery that referenced this issue Feb 24, 2016

@mgol

This comment has been minimized.

Show comment
Hide comment
@mgol

mgol Feb 24, 2016

Member

PR: #2948. Let's do it for 3.0.0 (later on we can't move stuff to src/deprecated.js as they'd be excluded from the slim build).

Member

mgol commented Feb 24, 2016

PR: #2948. Let's do it for 3.0.0 (later on we can't move stuff to src/deprecated.js as they'd be excluded from the slim build).

@gibson042

This comment has been minimized.

Show comment
Hide comment
@gibson042

gibson042 Feb 25, 2016

Member

later on we can't move stuff to src/deprecated.js as they'd be excluded from the slim build

I don't believe this is true. Semver dictates that deprecation is a minor version bump, so in our case it might mean that the slim build is more volatile than the full build (which arguably makes sense, since it is explicitly excluding functionality). I think it would be perfectly acceptable to e.g. deprecate jQuery.isNumeric in jQuery 3.1.0, resulting in its immediate removal from a slim build. Alternatively, we could include deprecated functionality in them (which probably makes more sense now that we're adhering to semver).

All that said, of course, I'm fine with deprecating jQuery.parseJSON in 3.0.0.

Member

gibson042 commented Feb 25, 2016

later on we can't move stuff to src/deprecated.js as they'd be excluded from the slim build

I don't believe this is true. Semver dictates that deprecation is a minor version bump, so in our case it might mean that the slim build is more volatile than the full build (which arguably makes sense, since it is explicitly excluding functionality). I think it would be perfectly acceptable to e.g. deprecate jQuery.isNumeric in jQuery 3.1.0, resulting in its immediate removal from a slim build. Alternatively, we could include deprecated functionality in them (which probably makes more sense now that we're adhering to semver).

All that said, of course, I'm fine with deprecating jQuery.parseJSON in 3.0.0.

mgol added a commit to mgol/jquery-migrate that referenced this issue Feb 25, 2016

mgol added a commit to mgol/jquery-migrate that referenced this issue Feb 25, 2016

mgol added a commit to mgol/jquery-migrate that referenced this issue Feb 25, 2016

@mgol mgol closed this in 93a8fa6 Mar 2, 2016

mgol added a commit to mgol/jquery-migrate that referenced this issue Mar 2, 2016

mgol added a commit to mgol/jquery-migrate that referenced this issue Mar 2, 2016

@mgol mgol removed the Has Pull Request label Mar 6, 2016

@mpf82 mpf82 referenced this issue Jan 25, 2017

Closed

jQuery 3 #1487

@lock lock bot locked as resolved and limited conversation to collaborators Jun 18, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.