Code Monkey home page Code Monkey logo

Comments (8)

fliespl avatar fliespl commented on June 20, 2024

Additionally two things :)

  1. I think autoptimizeCompatibility class should add exclusion to both:
    jquery.min.js & jquery.js

  2. 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.

futtta avatar futtta commented on June 20, 2024

from autoptimize.

fliespl avatar fliespl commented on June 20, 2024

Yes, I think that makes sense.

from autoptimize.

futtta avatar futtta commented on June 20, 2024

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.

futtta avatar futtta commented on June 20, 2024

have you been able to have a look at those changes/ test them by any chance @fliespl

from autoptimize.

fliespl avatar fliespl commented on June 20, 2024

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.

futtta avatar futtta commented on June 20, 2024

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.

fliespl avatar fliespl commented on June 20, 2024

Oh yes - those changes are cool and work :) Was simply talking about domcontentloaded.

Thanks!

from autoptimize.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.