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.trim? #4363

Closed
mgol opened this issue Apr 17, 2019 · 10 comments · Fixed by #4461
Closed

Deprecate jQuery.trim? #4363

mgol opened this issue Apr 17, 2019 · 10 comments · Fixed by #4461
Assignees
Labels
Milestone

Comments

@mgol
Copy link
Member

mgol commented Apr 17, 2019

Description

jQuery.trim was useful for IE <9 and later to workaround an old Android Browser issue but we don't support that browsers anymore on master. It also adds one niceity that it accepts a null value that it turns to an empty string but that's it. Should we deprecate it?

Link to test case

@timmywil
Copy link
Member

it accepts a null value

I think this might be a good enough reason to keep it. It'll be pretty small without the regex.

@mgol
Copy link
Member Author

mgol commented Apr 17, 2019

We've deprecated jQuery.proxy (#2958) even though it does a lot more than jQuery.trim. Plus, trimming is a pure JS thing & it doesn't have a lot in common with the DOM so it seems to fall a little outside of the scope of jQuery to me.

@timmywil
Copy link
Member

timmywil commented Apr 17, 2019

Well, I was against deprecating that too. I wouldn't say it did a lot more than native bind, though. I just don't think we need to be so eager with our deprecation hammer.

@timmywil
Copy link
Member

timmywil commented Apr 17, 2019

That brings up another point. proxy was deprecated with no intention of removal in 4.0, which I'm not really a fan of in general, but we should keep in mind that not all deprecations will get removed in 4.0. And whether it's semantic or not, I'm uncomfortable deprecating anything in a patch version, so even if we agree to deprecate jQuery.trim, I'd want to wait until 4.0.

@mgol
Copy link
Member Author

mgol commented Apr 17, 2019

Semver mandates deprecations can only happen in minor or major bumps so it can only happen in 4.0.0 or 3.5.0 if we ever decide to release that.

@dmethvin
Copy link
Member

I don't have a strong feeling either way on this. Removing it won't change the file size that much but I'd actually prefer that people used the built-in methods rather than our utilities. As @timmywil says we don't actually need to remove it but could signal there are alternatives by deprecating.

@gibson042
Copy link
Member

I'm very much in favor of deprecating for the same reasons as @mgol and @dmethvin. Removal would be best, but even without it we should be discouraging use of nonstandard patterns where standard ones exist (especially when the don't pertain to the primary purpose of this library).

@mgol mgol added this to the 4.0.0 milestone Apr 29, 2019
@mgol mgol removed the Needs review label Apr 29, 2019
@mgol mgol self-assigned this Apr 29, 2019
@ShashankaNataraj
Copy link
Contributor

@mgol @dmethvin May I submit a PR for deprecating jQuery.trim() ?

@mgol
Copy link
Member Author

mgol commented Aug 19, 2019

@ShashankaNataraj Sure, PRs welcome!

@ShashankaNataraj ShashankaNataraj mentioned this issue Aug 19, 2019
3 tasks
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 19, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 20, 2019
ShashankaNataraj pushed a commit to ShashankaNataraj/jquery that referenced this issue Aug 20, 2019
mgol pushed a commit that referenced this issue Aug 22, 2019
mgol pushed a commit that referenced this issue Sep 25, 2019
Fixes gh-4363
Closes gh-4461

(cherry picked from 5ea5946)
@mgol mgol modified the milestones: 4.0.0, 3.5.0 Sep 26, 2019
@mgol
Copy link
Member Author

mgol commented Sep 26, 2019

Moving the milestone to 3.5.0 (deprecations can only happen in minor or major releases and previously we didn't plan a minor bump on the 3.x line); I cherry-picked changes from PR #4461 (with some necessary modifications) in 56e73e0.

@lock lock bot locked as resolved and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

5 participants