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

Deprecate jQuery.parseJSON #2800

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

Deprecate jQuery.parseJSON #2800

mgol opened this issue Jan 4, 2016 · 10 comments
Assignees
Labels
Milestone

Comments

@mgol
Copy link
Member

@mgol 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
Copy link
Member

@gibson042 gibson042 commented Jan 4, 2016

I'm in favor.

@timmywil
Copy link
Member

@timmywil timmywil commented Jan 4, 2016

+1

@jaubourg
Copy link
Member

@jaubourg jaubourg commented Jan 4, 2016

Makes sense: +1.

@markelog
Copy link
Member

@markelog markelog commented Jan 4, 2016

Yepsies

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

@markelog 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
Copy link
Member

@dmethvin 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
Copy link
Member Author

@mgol mgol commented Jan 14, 2016

Assigning to myself.

@mgol
Copy link
Member Author

@mgol 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
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
Copy link
Member Author

@mgol 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
Copy link
Member

@gibson042 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 mgol removed the Has Pull Request label Mar 6, 2016
@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.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
6 participants
You can’t perform that action at this time.