Comments (8)
Additionally two things :)
-
I think autoptimizeCompatibility class should add exclusion to both:
jquery.min.js & jquery.js -
Also it would be best if this could recognize DOMContentLoaded jquery scripts (probably also window load event?):
<script type="text/javascript">document.addEventListener("DOMContentLoaded", function () {
jQuery(function($) {
// something
});
});
</script>
Those are executions that will happen after jQuery is loaded - so it could be minifed.
from autoptimize.
from autoptimize.
Yes, I think that makes sense.
from autoptimize.
OK, took me some time (I'm slow on Mondays) but I think I implemented this with 1a8ec3d and e538520. The domcontentloaded
one is a bit more tricky to get right though, so I'll probably "forget" about that (unless you would have a great PR for that ;-) ). Would be great if you could test these changes?
from autoptimize.
have you been able to have a look at those changes/ test them by any chance @fliespl
from autoptimize.
Yeah, I have tried that, but it really is more complicated :) Especially since items can be mixed (domcontentloaded function closed, while other jquery is appended after), I think it might end up with plenty of issues so probably worth dropping this idea.
from autoptimize.
It indeed is impossible to take all variations into account, but also auto-excluding jquery.js (which is pretty harmless) and allowing pre-3.0-installed instances to enable the compatibility logic does have some merit so I'll probably keep those in :-)
thanks!
from autoptimize.
Oh yes - those changes are cool and work :) Was simply talking about domcontentloaded.
Thanks!
from autoptimize.
Related Issues (20)
- Undefined offset autoptimizeStyles.php HOT 3
- autoptimizecriticalcsscron PHP array key warnings HOT 5
- Avif support broken HOT 6
- Minified JS broken with private class identifiers HOT 4
- Disable emoji dns-prefetch in ClassicPress HOT 1
- PHP8 Warning HOT 1
- Optimized JS and inline script order HOT 3
- Problem with media="print" HOT 3
- Inline "background" not replaced with shortpixel HOT 5
- Security risk reported by Kaspersky HOT 6
- Proposal: stronger default settings HOT 9
- Optimised Google Fonts still blocking for 1.3s according to PageSpeed HOT 2
- Add: option to enable WebP as default output format HOT 1
- PHP Warning in cronjob: Trying to access array offset on value of type int in autoptimizeCacheChecker.php HOT 3
- Creation of dynamic property in autoptimizeProTab.php HOT 4
- Proposal: add Plugin Check workflow HOT 6
- Autoptimize deletes all subfolders in /cache/ HOT 3
- Incorrect cache size triggering unnecessary email warnings HOT 4
- WP CLI command does not take multisite into acocunt HOT 1
- Deprecation warning in jsmin.php HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autoptimize.