Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ensure typeahead jQuery extensions are loaded We have at least the following jQuery versions in use: 1. `2.2.4` supplied from NPM, esbuild includes it in the chunks we later load. 2. `2.2.4` supplied from a script-tag in (dashboard)-base (with fallback to now defunct self-hosted static file). - This is the "global" jQuery most of the time. 3. `3.1.1` in use in templates/dashboard/events/details.html 4. `3.2.1` for django-wiki in templates/wiki/base.html On most of dashboard the global 2.2.4 is in use, not the one from NPM. It appears that the typeahead library has its own way of finding out _which_ global jQuery version it should apply to. Since esbuild is set to output in [ESM-format](https://esbuild.github.io/api/#format-esm), it does some transformation of CommonJs-code (module.exports), which means that `require/module` is defined in the _browser_ (where we are running). Is there a better way to fix this? Yes, remove the code and be in sync around one version, or isolate them better. Is it worth using any more time on this? No. The two 2.2.4 are _different objects_ so you can end in a situation where `jQuery === $` is `false`. That is what happens when these imports are uncommented, since only the name imported is the one changed to the NPM-supplied version. See: 6735dda, 812c7bb, 53b57b9 * Remove scrollspy-ing There is a scrollspy function in initFrontpage.js, it appears to not be related? User-search is likely to get removed anyways.
- Loading branch information