Skip to content
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

Merged
merged 11 commits into from
Nov 22, 2024
Merged

[webpack] Multiselect pages #35413

merged 11 commits into from
Nov 22, 2024

Conversation

orangejenny
Copy link
Contributor

@orangejenny orangejenny commented Nov 21, 2024

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

  • This PR can be reverted after deploy with no further considerations

Labels & Review

  • Risk label is set correctly
  • The set of people pinged as reviewers is appropriate for the level of risk of the change

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
@orangejenny orangejenny added the product/invisible Change has no end-user visible impact label Nov 21, 2024
@orangejenny orangejenny requested review from a team, esoergel and biyeun as code owners November 21, 2024 18:56
@dimagimon dimagimon added dependencies Pull requests that update a dependency file Risk: Medium Change affects files that have been flagged as medium risk. labels Nov 21, 2024
@@ -14,6 +14,7 @@ module.exports = Object.assign({}, commonDefault, {
new webpack.ProvidePlugin({
'$': 'jquery',
'jQuery': 'jquery', // needed for bootstrap 3 to work
'window.jQuery': 'jquery',
Copy link
Contributor

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

Copy link
Contributor Author

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

@orangejenny orangejenny merged commit d792431 into master Nov 22, 2024
12 checks passed
@orangejenny orangejenny deleted the jls/webpack-multiselect branch November 22, 2024 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file product/invisible Change has no end-user visible impact Risk: Medium Change affects files that have been flagged as medium risk.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants