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

Update to jQuery 3 #5585

Open
himdel opened this issue May 16, 2019 · 6 comments
Open

Update to jQuery 3 #5585

himdel opened this issue May 16, 2019 · 6 comments

Comments

@himdel
Copy link
Contributor

himdel commented May 16, 2019

We're still using jQuery 2, because of some breaking changes in 3.0.
But, we should upgrade as soon as realistic :).

ui-classic changes needed:

  • go through jquery request success/failure handlers
    • verify that we can live with the callback always happening later (probably only problematic in tests)
    • don't rely on this inside the handlers
    • check for throwing inside the handlers, maybe add .catch everywhere
    • success/error/complete should be then + catch, might as well rename done/fail/always too
  • $.param is treating spaces differently, check form serialization
  • offset computations will fail on hidden elements, may affect bottom toolbar size computation
  • .foo event handlers removed in favor of .on('foo' - we have 42 $().click(...), and various other events
  • miqInitAccordions and miqInitMainContent computations may now fail when horizontal scrollbar is present (outerHeight now includes the scrollbar size)
  • one .size() in app/assets/javascripts/services/topology_service.js
  • .selector removed - breaks tests
  • multiselect .val() returns empty array, not null
  • ajax calls using current url will now include the hash
  • go through removeAttr uses, most should be using .prop

just deprecations but still:

  • .bind is deprecated, use .on
  • .parseJSON
  • any document ready other than $(fn)
@himdel

This comment has been minimized.

@miq-bot miq-bot added the stale label Nov 25, 2019
@himdel himdel added pinned and removed stale labels Nov 25, 2019
@himdel himdel removed their assignment Apr 24, 2020
@himdel
Copy link
Contributor Author

himdel commented Sep 3, 2020

Problematic packages (any one of these may not be compatible without fixing, and is not maintained by anyone else):

  • @pf3/select - my fork of bootstrap-select (2018); we're overriding any dependencies on bootstrap-select with this package, needed until all select pickers use react (so, all forms really, old or angular)

    • angular: miq-select (or pf-select) directive
    • jquery: miqInitSelectPicker() call, (+ miqSelectPickerEvent does the equivalent of miq_observe for selects)
  • @pf3/timeline - my fork of patternfly-timeline (2017); using to fix original dependencies to prevent it from bringing in ancient patternfly and d3, timelines

    • timelines
  • bootstrap-switch - 2017, newer versions break with patternfly; used wherever there's a yes/no switch (except in react)

    • angular: bs-switch directive
    • jquery: miqInitBootstrapSwitch() call
  • bootstrap-filestyle - last 2016; upload file in old forms

    • $(selector).filestyle(...)
  • eonasdan-bootstrap-datetimepicker - last 2017; all datetimepickers, including angular

    • angular: datetimepicker directive (ours)
    • jquery: datetimepicker_input_tag helper
  • jquery-rjs - 2016 fork by matthewd; gem in core Gemfile, not npm; used in explorer ajax, old forms (also see Move UI dependencies from manageiq repo here #1 (comment))

    • :remote => true
  • jquery-ui - 2016

    • hard to find without list of components
    • dashboard widgets reordering, dialog editor
  • jquery-ujs - 2016; used in explorer ajax code, old forms

    • jquery "directives", work together with rjs, defined in our miq_ujs_bindings.js
    • the lib provides these out of the box: data-* attributes, ajax:* events
  • jquery.hotkeys - 2016, only used in development mode

    • .bind('keyup
  • jquery.observe_field - my fork of jquery.observe_field (2016) to release a npm package; used in all old forms

    • miq_observe in views, with ujs
  • patternfly-bootstrap-treeview - 2018

    • used by explorer trees
  • spice-html5-bower - my fork of spice-html5-rails (2014) updated with spice code from their freedesktop git repo in 2018

    • used for consoles
  • xml_display - my release of code we had copied from a now defunct website

    • used for the xml view in simulation

@Fryguy
Copy link
Member

Fryguy commented Nov 8, 2022

@MelsHyrule @GilbertCherrie I know we've made some progress with the react conversions. From the list in #5585 (comment), has anything been completed there?

@mend-bolt-for-github mend-bolt-for-github bot changed the title Update to jQuery 3 Update to jQuery 3 - autoclosed Nov 14, 2022
@mend-bolt-for-github
Copy link
Contributor

✔️ This issue was automatically closed by Mend because the vulnerable library in the specific branch(es) was either marked as ignored or it is no longer part of the Mend inventory.

@Fryguy
Copy link
Member

Fryguy commented Nov 14, 2022

Bad bot

@Fryguy Fryguy reopened this Nov 14, 2022
@Fryguy Fryguy removed the Mend: dependency security vulnerability Security vulnerability detected by WhiteSource label Nov 14, 2022
@MelsHyrule
Copy link
Member

@Fryguy Looking through the list i think jquery.hotkeys has been fully removed and we're be close to fully removing some like the bootstrap-filestyle (i think we've only got one haml file that uses it). As for the rest of them there are some that are being required but i'm not entirely sure if they're being used. @jeffibm if you have any additional info you can share about this let us know

@Fryguy Fryguy changed the title Update to jQuery 3 - autoclosed Update to jQuery 3 Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
General revamp
  
Awaiting triage
Roadmap
  
To do
Development

No branches or pull requests

5 participants