Deprecate jQuery.parseJSON #2800

Closed
mgol opened this Issue Jan 4, 2016 · 10 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
Member

I'm in favor.

@timmywil
Member
timmywil commented Jan 4, 2016

+1

@jaubourg
Member
jaubourg commented Jan 4, 2016

Makes sense: +1.

@markelog
Member
markelog commented Jan 4, 2016

Yepsies

@markelog markelog added this to the 4.0.0 milestone Jan 4, 2016
@markelog
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
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
Member
mgol commented Jan 14, 2016

Assigning to myself.

@mgol
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 milestone: 3.1.0, 4.0.0 Jan 14, 2016
@silverwind silverwind added a commit to StylishThemes/GitHub-Dark-Script that referenced this issue Jan 15, 2016
@silverwind silverwind Replace $.parseJSON with JSON.parse
jQuery.parseJSON will be deprecated:

jquery/jquery#2800
b8025bf
@mgol mgol modified the milestone: 3.0.0, 3.1.0 Feb 24, 2016
@mgol mgol added a commit to mgol/jquery that referenced this issue Feb 24, 2016
@mgol mgol Core: Deprecate jQuery.parseJSON
Fixes gh-2800
869a618
@mgol
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
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.

@mgol mgol added a commit to mgol/jquery-migrate that referenced this issue Feb 25, 2016
@mgol mgol Core: Warn against using jQuery.parseJSON, remove old hacks around th…
…is method

Fixes #150
Refs jquery/jquery#2800
b7130cd
@mgol mgol added a commit to mgol/jquery-migrate that referenced this issue Feb 25, 2016
@mgol mgol Core: Warn against using jQuery.parseJSON, remove old hacks around th…
…is method

Fixes #150
Refs jquery/jquery#2800
Refs #152
2c5fb7c
@mgol mgol added a commit to mgol/jquery-migrate that referenced this issue Feb 25, 2016
@mgol mgol Core: Warn against using jQuery.parseJSON, remove old hacks around th…
…is method

Fixes #150
Refs jquery/jquery#2800
Refs #152
befbed9
@mgol mgol added a commit that closed this issue Mar 2, 2016
@mgol mgol Core: Deprecate jQuery.parseJSON
Fixes gh-2800
Closes gh-2948
93a8fa6
@mgol mgol closed this in 93a8fa6 Mar 2, 2016
@mgol mgol added a commit to mgol/jquery-migrate that referenced this issue Mar 2, 2016
@mgol mgol Core: Warn against using jQuery.parseJSON, remove old hacks around it
Fixes #150
Refs jquery/jquery#2800
Refs #152
Closes #153
5de065f
@mgol mgol added a commit to mgol/jquery-migrate that referenced this issue Mar 2, 2016
@mgol mgol Core: Warn against using jQuery.parseJSON, remove old hacks around it
Fixes #150
Refs jquery/jquery#2800
Refs #152
Closes #153
39fa123
@mgol mgol removed the Has Pull Request label Mar 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment