Coder Social home page Coder Social logo

Comments (3)

beezee avatar beezee commented on August 22, 2024

Is this necessary in addition to the ClosureCompiler blocks you've added to the plugin file itself?

from djax.

GaryJones avatar GaryJones commented on August 22, 2024

Yes.

In my WordPress plugin, I'm enqueueing two scripts - jquery.djax.js and foobar-djax.js.

The first can be minified correctly with the advanced closure compiler with the block that is currently included. All good.

My foobar-djax.js contains a call to djax() - trying to minify this with the advanced closure compiler results in the djax() call being dropped, as Google doesn't recognise it as a function name that must change (like the jQuery externs does with all of the standard jQuery functions), as it's defined outside of the file. The closure compiler block in my post above is what I would add to my foobar-djax.js so that, not only are the standard jQuery functions recognised, but the djax() function is too.

If I had other jQuery plugins that added new functions, then I could add an @externs_url for each of them.

from djax.

beezee avatar beezee commented on August 22, 2024

Makes sense to me. Just added the file to the repo.

from djax.

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.