-
Notifications
You must be signed in to change notification settings - Fork 1k
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
jQuery Plugin Elimination #11939
Comments
ooh yay @ removing select2. that one causes me some complexities in the auto admin recording. Looking forward to what replaces it! |
What about visualization plugins? Is the plan to remove jQuery also from them or is that out of scope? |
Hi @hexylena, where is that select exactly? If you could create a paper-cuts issue, it would be awesome. I'd try to replace it with Vue-multiselect during next event |
Done, thanks @OlegZharkov! |
@nsoranzo External plugins can continue to do whatever they want -- they've just got to ship their own libs like we've been doing more recently. |
@dannon That's what I thought, thanks for confirming! |
There's another easy but less obvious way to avoid unnecessary jQuery and Galaxy imports altogether. As new code is written, if you simply modernize your utility imports, it's easy to remove a lot of implicit dependencies. As an example, I recently ran into this, which I see a lot: // instead of...
import Utils from "utils/utils";
Utils.bytesToString(raw_size);
// try this
import { bytesToString } from "utils/utils"
bytesToString(rawSize); Seems harmless, but that utils file is a big bucket of imports that includes specifically jQuery which should not reasonably be a dependency of string formatter function like bytesToString. In theory, webpack's tree shaking should remove unused dependency imports but I think that plan gets ruined if you blithely import the whole utils module. Regardless, all you need to do is separate bytesToString into its own file (or put all the string formatting functions with no dependencies into a stringFormattingUtils.js file) and import it independently. You remove an implicit dependency not only to jQuery but often to global Galaxy as well. Long story short: Avoid overuse of "common" files unless you are closely paying attention to the dependencies. I'm not saying to put every function in its own file, but I AM saying try to put functions that share common global dependencies into files together to avoid this problem. Anyway, it's easy to avoid, the fix is quick and this is an example of how spaghetti code is born. Good luck! |
I labelled it with paper-cuts. @Nerdinacan examples seems easy to for new people to clean some code up. Mason if you see for of those things please docment them here, that is super useful I think. |
I don't find any file or component that used
|
|
|
|
|
|
I forgot to update this but I actually killed mousewheel and cookie in #11710. Updated now. |
'complexify' was removed in #13228. |
Before we can remove jQuery itself, we've got a list of these plugins that we need to walk through and replace with modern methods. Some of these are straightforward -- walking through mouse wheel event binding and replacing it with modern events, etc., but some are going to be more involved.
The text was updated successfully, but these errors were encountered: