-
Notifications
You must be signed in to change notification settings - Fork 473
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
Data: Patch camelCase behavior of $.fn.data, warn about Object.prototype #559
Draft
mgol
wants to merge
9
commits into
jquery:3.x-stable
Choose a base branch
from
mgol:3.x-data
base: 3.x-stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tests are passing on all tested browsers, BTW: https://github.com/mgol/jquery-migrate/actions/runs/12713854358/job/35442704508 |
This will save space and avoid potential divergence from Core. To minimize risk, this only handles APIs still present in jQuery 4.x.
This fixes tests with 3.0/3.1 slim builds.
jQuery <3.2.0 doesn't include the deprecated module in the slim build so it makes sense to test on one of these versions in slim mode even on PRs.
As of January 2025, iOS 10 is a tier 4 device on BrowserStack: https://www.browserstack.com/device-tiers That leads to devices with this iOS version often not being available and failing our tests. Remove it from the test matrix. Also, add comments explaining the status of tests on various iOS versions, including iOS 7 that we stopped testing on a long time ago. Ref jquery/jquery#5606
mgol
force-pushed
the
3.x-data
branch
2 times, most recently
from
January 14, 2025 11:50
dac02fa
to
fdfb5a6
Compare
Changes: 1. Patch not only `jQuery.data()`, but also `jQuery.fn.data()`. 2. Patch `jQuery.removeData()` & `jQuery.fn.removeData()` to work in most cases when different keys with the same camelCase representation were passed to the data setter and later to `removeData`. 3. Warn about using properties inherited from `Object.prototype` on data objects.
mgol
added a commit
to mgol/jquery-migrate
that referenced
this pull request
Jan 14, 2025
mgol
added a commit
to mgol/jquery-migrate
that referenced
this pull request
Jan 14, 2025
This was referenced Jan 14, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: Right now, this PR includes PR #554; only review the commit titled "Data: Patch camelCase behavior of $.fn.data, warn about Object.prototype". This PR should not be merged before #554; that's the only reason it's in a draft state.
Changes:
jQuery.data()
, but alsojQuery.fn.data()
.jQuery.removeData()
&jQuery.fn.removeData()
to work in most caseswhen different keys with the same camelCase representation were passed to
the data setter and later to
removeData
.Object.prototype
on dataobjects.