Hello Stephen, using jQuery was reasonable, when browsers have not offered document.querySelectorAll(), AJAX, fetch() functions in a consistent way [0] and the same program logic had to pe implemented differently per browser vendor. In current browsers. what jQuery offers can be implemented with DOM and direct JavaScript, (and possibly polyfills) without huge extra efforts.
> 1. Would jQuery-based code be significantly easier to maintain, eg,by new > developers who don't necessarily know Mailman but do know both js and jQuery? I guess yes. If one knows JavaScript, the DOM and the Webbrowser interfaces I cannot think of an example which nowadays will be significantly easier to implement with jQuery compared to no jQuery. However it is quite some time since I have not done web development and even more time, since I have not worked with jQuery. > 2. Is there jQuery functionality that we might want to use that would be > more complex than the code in the merge_requests you have already? I do not know. Somebody said in the past that Hyperkitty uses jQuery plugins, so there things get more complicated. > How much code do you expect to delete and add to completely remove the jQuery > dependency from Postorius? From HyperKitty? git grep '\$[\(\.]' $(find -name '*.html' -o -name '*.js') suggests that in django-mailman3 jQuery is used in approximately three places and in postorius it is used approximately on 45 places, not counting in bootstrap and jQuery itself. But irrespective of the amount of changed lines, I think the replacement procedure will be finding a pattern how to replace one thing with another, and then doing very similar substitutions on all places, which match. So the question is probably how much patterns will be there — I do not know. [0] https://blog.logrocket.com/why-jquery-4-good-reminder-stop-using-jquery/ Greetings // Дилян -----Original Message----- From: Stephen J. Turnbull <[email protected]> To: Дилян Палаузов <[email protected]> Cc: [email protected] Subject: [Mailman-Developers] Review “Less jQuery” changes Date: 24/02/26 15:10:10 Дилян Палаузов writes: > removing the dependency of jQuery in django-mailman3, Postorius and > maybe in Hyperkitty will allow Postorius to load faster in browsers This is true, and generally a good idea. However, it is commonly true that browsers cache this code, and users keep these pages open for a long time. To the extent you have open pages and/or cached code, the benefit is less. I don't recall hearing that page loading delay is a common issue. The changes in your 5 MRs are quite small. I suppose the use of jQuery is quite extensive though. How much code to you expect to delete and add to completely remove the jQuery dependency from Postorius? From HyperKitty? jQuery is a well-known idiom, and provides a lot of features. Which brings up two questions: 1. Would jQuery-based code be significantly easier to maintain, eg, by new developers who don't necessarily know Mailman but do know both js and jQuery? 2. Is there jQuery functionality that we might want to use that would be more complex than the code in the merge_requests you have already? > I think as next somebody should review the above changes, e.g. try > to deploy them locally and state, that the modified code is > executed, while the behaviour (program logic) does not change. I'm really not qualified to do this review (especially the issue of whether there might be behavior changes). I'm not sure if Mark or Abhilash is much better able to do so, although I know Abhilash has worked on the Django apps quite a bit and probably on the js parts. -- GNU Mailman consultant (installation, migration, customization) Sirius Open Source https://www.siriusopensource.com/ Software systems consulting in Europe, North America, and Japan _______________________________________________ Mailman-Developers mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/mailman-developers.python.org/ Mailman FAQ: https://wiki.list.org/x/AgA3 Security Policy: https://wiki.list.org/x/QIA9
