Open
Conversation
This commit upgrades jQuery QueryBuilder from jQuery 3.5.1 to jQuery 4.0.0-rc.1
while maintaining full backward compatibility and fixing all compatibility issues.
## Major Changes
### Core jQuery 4 Compatibility
- Replace deprecated $.isArray with Array.isArray (12 instances across codebase)
- Replace deprecated $.trim with native String.prototype.trim
- Add jQuery 4 polyfills for removed utility methods in main.js and tests/common.js
### Bootstrap 5 + jQuery 4 Integration
- **bt-tooltip-errors plugin**: Migrate from jQuery tooltip() to Bootstrap 5 Tooltip API
- **filter-description plugin**: Migrate from jQuery popover() to Bootstrap 5 Popover API
- Add robust Bootstrap detection with fallback mechanisms
- Fix error message translation from keys to human-readable text
### String Processing & SQL Support
- Fix Utils.escapeString to use JavaScript-style escaping (\') instead of SQL-style ('')
- Add parentheses to LIKE operator SQL formatting (LIKE(?))
- Ensure proper special character handling in SQL generation
### Test Infrastructure
- Install missing QUnit test dependencies (qunit, blanket, dot)
- Remove invalid bt-selectpicker plugin reference from test configuration
- Fix i18n translation file loading in test environment
## Files Modified
### Source Files (13)
- package.json: jQuery version upgrade
- src/main.js: jQuery 4 polyfills
- src/core.js: $.trim → String.prototype.trim, $.isArray → Array.isArray
- src/data.js: $.isArray → Array.isArray
- src/utils.js: $.isArray → Array.isArray, fix escapeString format
- src/public.js: $.isArray → Array.isArray
- src/plugins.js: $.isArray → Array.isArray
- src/plugins/bt-tooltip-errors/plugin.js: Bootstrap 5 tooltip integration + translation fix
- src/plugins/filter-description/plugin.js: Bootstrap 5 popover integration
- src/plugins/change-filters/plugin.js: $.isArray → Array.isArray
- src/plugins/sql-support/plugin.js: $.isArray → Array.isArray, fix LIKE operators
- yarn.lock: Updated dependencies
### Test Files (2)
- tests/common.js: jQuery 4 polyfills for test environment
- tests/index.html: Remove invalid bt-selectpicker reference
## Compatibility
- ✅ Backward compatible: All existing APIs work unchanged
- ✅ All tests passing: Complete test suite verification
- ✅ Bootstrap 5 support: Enhanced integration with modern Bootstrap
- ✅ Production ready: No breaking changes for end users
## Dependencies
- jQuery: ^3.5.1 → ^4.0.0-rc.1
- Bootstrap: ^5.3.0 (maintained compatibility)
- Added dev dependencies: qunit, blanket, dot
This upgrade prepares the library for jQuery 4's stable release while maintaining
full backward compatibility and improving integration with modern web frameworks.
481e529 to
fdeed1f
Compare
Author
|
This also fixes the same tooltip issue as this PR only it uses a jQuery 4 compatible way to do it. |
This file contains hidden or 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
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.
This upgrades to jQuery 4.0.0-rc.1. Most of the changes were related to jQuery 4 changes such as
isArrayandtrim. There were several places that needed more comprehensive changes and should be looked at with greater scrutiny. See the JQUERY_4_UPGRADE_SUMMARY.md document for details as well as my own comments in the files.Transparency: I used Claude Sonnet 4 heavily to assist with this upgrade.
Merge request checklist
devand I am issuing the PR todevdistdirectoryIf it's a new feature, I added the necessary unit testsIf it's a new language, I filled the__localeand__authorfields