jquery: Breaking change to the data module in 3.5.0
The change to the data module made here:
https://github.com/jquery/jquery/pull/4603/files#diff-38fa4ad21a97c2bf8d5b91d033df3335
breaks projects that depend on hasOwnProperty()
function availability.
An example: https://github.com/snapappointments/bootstrap-select/issues/2430 Many other project can be affected as well.
Such change should not be introduced as a minor version upgrade.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 83
- Comments: 44 (17 by maintainers)
Links to this issue
Commits related to this issue
- Data: Make the data object a regular object again The change in gh-4603 made the object returned by `elem.data()` a prototype-less object. That's a desired change to support keys colliding with Objec... — committed to mgol/jquery by mgol 4 years ago
- Update gems and upgrade modules, except jQuery See https://github.com/jquery/jquery/issues/4665, breaks Bootstrap's collapse.js — committed to unosmium/unosmium.org by zqianem 4 years ago
- Revert jquery to version 3.4.1 This unitl 3.5.1 is released with fix for https://github.com/jquery/jquery/issues/4665 — committed to h3llrais3r/Auto-Subliminal by h3llrais3r 4 years ago
- Fija temporalmente jquery en 3.4.1 para evitar problema entre jquery 3.5.0 y bootstrap como describe https://github.com/jquery/jquery/issues/4665 — committed to pasosdeJesus/sivel2_sjrcol by vtamara 4 years ago
- Skip jQuery 3.5.0 https://github.com/jquery/jquery/issues/4665 — committed to fetus-hina/stat.ink by fetus-hina 4 years ago
- Bugfix: Lock jquery version to 3.4.1 to mitigate navbar collapse breakage (https://github.com/jquery/jquery/issues/4665) — committed to Pack144/packman by thirdjal 4 years ago
- Revert Admin to jQuery 3.4.1 (can't use 3.5.0) Bootstrap 3.4.1 has an incompatibility with changes in jQuery 3.5.0 — committed to zencart/zencart by drbyte 4 years ago
- Downgrade jQuery to fix mobile nav button Caused by https://github.com/jquery/jquery/issues/4665 — committed to EdiWang/Moonglade by EdiWang 4 years ago
- Data: Make the data object a regular object again The change in gh-4603 made the object returned by `elem.data()` a prototype-less object. That's a desired change to support keys colliding with `Ob... — committed to jquery/jquery by mgol 4 years ago
- Downgrade jQuery from v3.5.0 to v3.4.1 https://github.com/jquery/jquery/issues/4665, https://github.com/twbs/bootstrap/issues/30692 — committed to wdmg/yii2-admin by alex-wdmg 4 years ago
- Bump jQuery to 3.5.0 jQuery 3.5.0 と Bootstrap 3 の組み合わせでは、次の問題により アコーディオンが動作しない: https://github.com/jquery/jquery/issues/4665 この問題を修正する Pull Request は merge されたものの、 3.5.1 は現時点ではリリースされていない。 http... — committed to fetus-hina/stat.ink by fetus-hina 4 years ago
- Revert "Bump jquery from 3.4.1 to 3.5.0 in /ui" due to unintended breaking change causing bootstrap collapse to fail (https://github.com/jquery/jquery/issues/4665) This reverts commit c4d81229 — committed to ministryofjustice/ndelius-um by marcus-bcl 4 years ago
- Revert "Update jQuery" This reverts commit ab068ae07c2fbefb4e59521c13adb58fca7ab0f8. jQuery 3.5.0 is broken with Bootstrap: https://github.com/jquery/jquery/issues/4665 — committed to mDuo13/dactyl-starter-kit by mDuo13 4 years ago
- Bump jquery from 3.5.0 to 3.5.1 Version 3.5.0 of jquery introduced a [breaking change](https://github.com/jquery/jquery/issues/4665) that was fixed in version 3.5.1. — committed to zachsvanhandel/website-v1 by zachsvanhandel 4 years ago
- revert jquery back to 3.4.1 due to a breaking data change in 3.5.0 https://github.com/jquery/jquery/issues/4665 — committed to euctrl-pru/pru-theme by espinielli 4 years ago
- Downgrade jQuery to 3.4.1. See github.com/jquery/jquery/issues/4665 — committed to jefhar/inventory by jefhar 4 years ago
- Update jquery to 3.5.1 due to HeatMap tooltip break Tooltips in HeatMaps were breaking because of jquery 3.5.0 bug https://github.com/jquery/jquery/issues/4665. Upgrading to 3.5.1 resolves our toolt... — committed to oVirt/ovirt-engine-ui-extensions by sjd78 4 years ago
- Bugfix: Lock jquery version to 3.4.1 to mitigate navbar collapse breakage (https://github.com/jquery/jquery/issues/4665) — committed to Pack144/packman by thirdjal 4 years ago
- Bugfix: Lock jquery version to 3.4.1 to mitigate navbar collapse breakage (https://github.com/jquery/jquery/issues/4665) — committed to Pack144/packman by thirdjal 4 years ago
- update bootstrap and jquery to fix (probably) https://github.com/jquery/jquery/issues/4665 and add source maps to files included from node_modules — committed to Holusion/holusion.com by sdumetz 4 years ago
jQuery 3.5.1 has been released: https://blog.jquery.com/2020/05/04/jquery-3-5-1-released-fixing-a-regression/
21 days jquery maintainers can’t release hot fix for fixing problem with bootstrap. Leaving all bootstrap users with decision “security fix” vs “working bootstrap”.
Guys, please. Pretty please. Release the fix.
I was hoping for an ETA, but I suppose I’ll just assume “soon”-ish. (Btw, the “E” in “ETA” doesn’t stand for “Exact”, but “Estimated”.) Can’t wait to see the fix in the wild. Thanks!
@mgol This issue should not be closed with a simple “Downgrade to 3.4.1” - Many of us are being asked by our companies to perform a mandatory upgrade because of the XSS vulnerability in < 3.5. Further, downgrading doesn’t fix the problem in 3.5 - it just avoids it.
This change in 3.5.0 (and 3.5.0.1) affects numerous other libraries, including Bootstrap 4.x. Can we get some sort of ETA on an actual fix?
Bootstrap 3.4.1 which
Tooltip.prototype.getOptions
which has hasOwnProperty and it is failing with jquery 3.5.0PR: #4666
I guess this is why linters say to use
Object.prototype.hasOwnProperty.call(obj, 'foo')
It’s customary to close an issue on GitHub when a fix is merged, not when it’s released. The release should happen soon but I cannot provide you an exact date.
jQuery built from
3.x-data-object
branch seems to fix the issue with Bootstrap Select https://github.com/snapappointments/bootstrap-select/issues/2430@XhmikosR Not this issue, this issue we’ll fix, most likely by reverting the change to
src/data/Data.js
from 9d76c0b163675505d1a901e5fe5249a2c55609bc.The PR you linked to also applies updates for the changes to
jQuery.htmlPrefilter
and those will not be reverted so it’s likely Bootstrap v3 code will remain incompatible with jQuery 3.5.0+ by default. ThehtmlPrefilter
issue can be worked around by developers using Bootstrap 3 with jQuery 3.5.0+ via one of the steps outlined in https://jquery.com/upgrade-guide/3.5/ that restorejQuery.htmlPrefilter
to it’s pre-3.5.0 value.We’ll monitor the situation. If we get info about many more projects broken by this change, we’ll try to get the fix out quicker. No promises about specific timing, though: it’s Easter and we’re all volunteers.
Any chance on quick 3.5.1 release?
The jQuery team only maintains the
jquery
npm & Bower packages, the rest is done by the community. You need to ask the Nugget package maintainer to release the updated version.Dependabot is sending announcements out to every public repo that uses JQuery 3.4 with an automatic pull request to upgrade to 3.5. I expect lots of people will simply accept the PR.
[image: image.png]
On Thu, Apr 30, 2020 at 1:17 PM PaulKahl notifications@github.com wrote:
@boris-petrov yeah, no other code seems to be affected from the other changes AFAICT; our CI passes.
@Johann-s please have another look in case I missed something.
I was thinking about it a bit more, my conclusions:
jQuery._data
API which is private so if you use it, you’re on your own. I’ll note it’s fine for web browsers to use it as it’s just for use in DevTools; if it breaks, no website will be broken, the debugging experience will just be worse until the browser catches up.Because of the above, I’d only revert the data change, deferring it to jQuery 4.0.0. PR incoming.
So, basically the failures can be seen here where I updated jQuery to v3.5.0 and adapted our tests: CI errors
The code is quite old, since our v3.3.4.
Thanks for the report. I agree this is an unintended breaking change that we should fix in 3.5.1. Marking for team discussion.
Perhaps we can leave the current solution for jQuery 4.0.0 and in 3.5.1 apply original @gibson042’s suggestion of appending a space to event names before storing in the internal data storage. This solution can break code that relied on the private
jQuery._data
API to have real event names as event keys without any space at the end but since it’s a private API, this looks more acceptable to me.Some possible consumer are web browsers, I think Firefox is using this API for jQuery event support in DevTools. If that’s still the case, do you know, @bzbarsky, who at Mozilla we could contact to coordinate any changes to this API?