Skip to content

Commit

Permalink
Update jQuery version check and jQuery dependency version range (#20338)
Browse files Browse the repository at this point in the history
Closes #16834

[skip validator]
  • Loading branch information
cvrebert committed Jul 21, 2016
1 parent c2404d3 commit edefe0e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"test-infra"
],
"dependencies": {
"jquery": "1.9.1 - 2"
"jquery": "1.9.1 - 3"
}
}
4 changes: 2 additions & 2 deletions grunt/configBridge.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"+function ($) {",
" 'use strict';",
" var version = $.fn.jquery.split(' ')[0].split('.')",
" if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 2)) {",
" throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3')",
" if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 3)) {",
" throw new Error('Bootstrap\\'s JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4')",
" }",
"}(jQuery);\n\n"
]
Expand Down

3 comments on commit edefe0e

@andreassolberg
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! <3

@davik3000
Copy link

@davik3000 davik3000 commented on edefe0e Feb 28, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cvrebert I think that there's an issue with the jQuery version checks.
If Bootstrap 3.x is supposed to support jQuery 3.x, (also based on bower.json:32 indications) there's a wrong check in configBridge.json : 40, about (version[0] > 3)
It should be
if ((version[0] == 1 && version[1] == 9 && version[2] < 1) || (version[0] > 4)) {

@cvrebert
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davik3000 The condition is true when the version is incompatible, not when it's compatible. Your if (major > 4) { throw error } change would allow jQuery 4.x.x, which we cannot guarantee compatibility with.
I think your analysis is incorrect.

Also, commenting on old commits isn't an effective bug reporting strategy. Opening issues is.

Please sign in to comment.