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

Stop using jQuery/ajax and use Fetch API instead #76

Closed
tadayosi opened this issue Feb 3, 2023 · 11 comments
Closed

Stop using jQuery/ajax and use Fetch API instead #76

tadayosi opened this issue Feb 3, 2023 · 11 comments
Assignees
Labels
kind/refactoring Code improvements that don't add or change features

Comments

@tadayosi
Copy link
Member

tadayosi commented Feb 3, 2023

Relates #8

@tadayosi tadayosi added the kind/refactoring Code improvements that don't add or change features label Feb 3, 2023
@phantomjinx
Copy link
Member

Does this imply complete removal of JQuery as it is being used for parsing the XML of the camel routes? We could use something else but need to know whether to look for a replacement?

@tadayosi
Copy link
Member Author

tadayosi commented Feb 4, 2023

Good point. I only thought about the ajax query part of jQuery usages for the issue such as:
https://github.com/hawtio/hawtio-next/blob/main/packages/hawtio/src/plugins/connect/jolokia-service.ts#L111-L140
Yes, jQuery is also used to parse XML and it shouldn't be so easy to replace it with something else.

The motivation for this issue is to reduce as large a dependency as possible from Hawtio.next. In particular, large frameworks such as jQuery are often subject to CVEs, which means that they have to be upgraded every time. If Hawtio.next could do without jQuery, it would reduce the burden of security updates as much as possible.

This Issue has no specific milestones attached to it and does not need to be addressed now. However, it is recorded as it is something that would be beneficial to be addressed in the long term. If you have a good solution to replace something in the XML parsing part of jQuery, let's discuss it as well.

@phantomjinx
Copy link
Member

I'm in the area of xml parsing atm so I can start to look around for an alternative and see if any do the job.

@tadayosi tadayosi added this to the 2023Q3 milestone Aug 1, 2023
@tadayosi tadayosi modified the milestones: 2023Q3, Future Aug 21, 2023
@lhein lhein removed this from the Future milestone Apr 25, 2024
@grgrzybek grgrzybek self-assigned this Sep 9, 2024
@grgrzybek
Copy link
Contributor

I wasn't aware that jQuery is used for XML parsing ;)

I want to get rid of $.ajax call in favor of fetch() - Jolokia 2.1.0 already supports fetch() and doesn't rely on jQuery.

@grgrzybek grgrzybek changed the title Stop using jQuery and use Fetch API instead Stop using jQuery/ajax and use Fetch API instead Sep 9, 2024
@phantomjinx
Copy link
Member

I wasn't aware that jQuery is used for XML parsing ;)

I want to get rid of $.ajax call in favor of fetch() - Jolokia 2.1.0 already supports fetch() and doesn't rely on jQuery.

XML parsing did use jQuery but was replaced in this commit.

@grgrzybek
Copy link
Contributor

I wasn't aware that jQuery is used for XML parsing ;)
I want to get rid of $.ajax call in favor of fetch() - Jolokia 2.1.0 already supports fetch() and doesn't rely on jQuery.

XML parsing did use jQuery but was replaced in this commit.

cool! so I may eventually remove it entirely ;)

@phantomjinx
Copy link
Member

Still gets used by Hawtio-Online which may or may not have an impact on this issue.

@grgrzybek
Copy link
Contributor

Does hawtio-online have own dependency (in package.json) on JQuery? Also it should have own import ... from 'jquery', right?

@phantomjinx
Copy link
Member

phantomjinx commented Sep 9, 2024

Does hawtio-online have own dependency (in package.json) on JQuery? Also it should have own import ... from 'jquery', right?

Yes it does. It doesn't rely on hawtio-next for export of JQuery.

That's said Hawtio-Online does call on jolokia using ajax, eg. these

@grgrzybek
Copy link
Contributor

I'll remove import $ from 'jquery' from hawtio-next, but I won't remove (for now?) jquery from @hawtio/react's package.json.

@tadayosi
Copy link
Member Author

Yeah, we can finally try removing jQuery from hawtio-next. I think hawtio-online can declare a dependency to jQuery itself if it still needs it after hawtio-next's removal of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/refactoring Code improvements that don't add or change features
Projects
Archived in project
Development

No branches or pull requests

4 participants