vaadin / framework

Vaadin 6, 7, 8 is a Java framework for modern Java web applications.
http://vaadin.com/
Other
1.79k stars 729 forks source link

Support vaadinPush js with externalJQuery #4178

Closed vaadin-bot closed 7 years ago

vaadin-bot commented 11 years ago

Originally by CodingFabian


Our application uses jquery 1.9.1, which we pull from google cdn in minified version. Now with push a second version of jquery is loaded. It would be great if vaadin would offer a way so that I only load it once. Because vaadin push is loaded as very first script, I don't see a good way of preventing that. I could add it to the bootstrap page, but still the pushJs would load its own.


Imported from https://dev.vaadin.com/ issue #12198

vaadin-bot commented 11 years ago

Originally by @Artur-


Atmosphere 2.0.0 will ship with a non-jquery javascript version as well as the jquery javascript. I'm not sure we want to make the jquery dependency "public" in this way to be able to switch to the non-jquery version at some point if it is smaller or turns out to be the one which is better maintained.

vaadin-bot commented 11 years ago

Originally by CodingFabian


Hi Artuhr, i strongly favor the JQuery Version. But currently the vaadinPush.js is 80% JQuery 1.7.2 Our plugins use JQuery 1.9.x.

So in fact jquery gets loaded twice and the one in vaadinPush.js is not cached.

So what I did, i ripped itour from vaadinPush.js, and load it via a bootsrap listener into the header:

    // make sure jquery is already loaded, as we removed it from push js
    head.append("<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\" type=\"text/javascript\"></script>");

by doing so i have a super cached jquery both my plugins and vaadinPush.js uses

Artur- commented 7 years ago

7381 changes to use the non-JQuery version in 7.7+. This is also nowadays the only supported version in Atmosphere.