Plans to remove jquery
-
Are there plans to remove jquery from the frontend of the plugin?
-
Hi @randomorca100,
As of now there are no plans to remove jQuery for the frontend. But announcer is not very tightly linked to jQuery, it uses 90% vanilla JS. I can work on the efforts needed to make it jquery independent.
I’ll revisit the code and check the efforts needed.
Thanks,
Aakash
Thank you! It would be great if the plugin didn’t have jquery on the frontend since it really isn’t used anyway
Do you have a timeline when you’d be able to revisit the code? Thanks!
Hi @randomorca100,
I had a chance to review the code. I made a wrong promise. The logic for critical things like animation, height adjustments, repositioning use jQuery APIs.
https://plugins.trac.ww.wp.xz.cn/browser/announcer/trunk/public/js/script.js
Removing jQuery would be challenging, causes regression and it offers lots of useful APIs.
Can you please let me know why you would like to remove jQuery?
If you think that your website is loading many scripts, you could use a plugin to combine multiple scripts into one file i.e minify them (or) I can help you along these lines by suggesting code changes to announcer.
Thanks,
Aakash
jQuery slows down my site so I’m trying to avoid using it and it reduces performance in PageSpeed
I think even if jquery could be removed when a banner is disabled or if it’s not being loaded on a specific page would be good too
Hi @randomorca100, jQuery does nothing by itself. It is very small <80KB. This is negligible compared to the workloads most browsers can handle.
All scripts are cached when they are loaded the first time and they are loaded async i.e it is non-blocking load.
Tools like pagespeed will just give hints. They all load the page from scratch without caching. Just removing jquery will not cause any noticable difference in search traffic or SEO. I would suggest see the difference with and without announcer.
Like I suggested previously, I can merge announcer and jquery into one script so only one script is loaded instead of two scripts.
These scripts are loaded on the header, so it is not possible to conditionally load jquery based on if announcer is shown or not.
Thanks,
Aakash
The topic ‘Plans to remove jquery’ is closed to new replies.