-
-
Notifications
You must be signed in to change notification settings - Fork 217
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
[webpack] Multiselect pages #35413
[webpack] Multiselect pages #35413
Conversation
…5 page The config change is necessary because this library expects a "jQuery" property to be set on the window. See https://github.com/lou/multi-select/blob/57fb8d3f5d27a0e1058f63921cdb26b4d30da361/js/jquery.multi-select.js#L544
This library was throwing errors relating to functions not being found as expected on the window. Rather than troubleshoot, I'm just killing it. Usages of the multiselect widget don't have that many items, a basic search is fine. quicksearch appears abandoned, no updates in 8 years: https://www.npmjs.com/package/quicksearch
webpack/webpack.b3.common.js
Outdated
@@ -14,6 +14,7 @@ module.exports = Object.assign({}, commonDefault, { | |||
new webpack.ProvidePlugin({ | |||
'$': 'jquery', | |||
'jQuery': 'jquery', // needed for bootstrap 3 to work | |||
'window.jQuery': 'jquery', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean webpack is making jQuery globally available? Why is it needed? Would it make sense to add a comment here about that?
Is it possibly related to quicksearch
, which is removed in a later commit in this PR?
The same applies to webpack/webpack.common.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it does. The two previous lines do something pretty similar by automatically importing jQuery everywhere. It's needed because the multiselect library expects window.jQuery
: https://github.com/lou/multi-select/blob/57fb8d3f5d27a0e1058f63921cdb26b4d30da361/js/jquery.multi-select.js#L544
Technical Summary
This adds support for multiselect, migrates some pages that depend on it, and removes the
quicksearch
dependency from HQ, which wasn't adding enough value to justify maintaining it. See commit messages for detail.https://dimagi.atlassian.net/browse/SAAS-16271
Safety Assurance
Safety story
I've tested the multiselect changes and the migrations locally. The multiselect changes are pretty small, and the migrations are pretty standard (i.e., the pages being migrated aren't dependent on any libraries that aren't used on webpack pages, other than multiselect).
Automated test coverage
Little if any
QA Plan
Not requesting QA
Rollback instructions
Labels & Review