Okay, When I put the code of the external JS file in a JSNI method. Do I 
have to put all the code I one method? To have a concrete example here is 
the code I use: 

https://github.com/Atmosphere/atmosphere-javascript/blob/master/modules/javascript/src/main/webapp/javascript/atmosphere.js

Could you please give an example of how you would do it in this case?


Am Donnerstag, 31. Dezember 2015 01:17:44 UTC+1 schrieb Colin Alworth:
>
> It depends on how you are including the JavaScript source. 
>
> If it is a <script> tag in the .gwt.xml or the html host page, the GWT 
> compiler barely knows it exists, and will do nothing with it. Likewise, if 
> you use the ScriptInjector to make it available to the app, either from a 
> url, or from a String or External/TextResource - as far as GWT can tell, 
> its just a String.
>
> If on the other hand you put it into a JSNI method, the compiler will 
> understand that it is source and should be optimized as much as possible. 
> Note however that JSNI is limited in how it can be optimized, though 
> enabling the Closure compiler can often do a more comprehensive job of 
> cleaning up that JS source, though this cleanup may in some cases break 
> code that isn't prepared to be optimized in that way.
>
> On Wed, Dec 30, 2015 at 4:11 PM confile <[email protected] 
> <javascript:>> wrote:
>
>> I have an external JavaScript file which I use using JSNI or JS Interop. 
>>
>> I only use parts of this js file/ library. 
>>
>> *Is it possible to reduce the code of this external js file using GWT?*
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "GWT Contributors" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] 
>> <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/google-web-toolkit-contributors/4b0d67b6-ba5c-42d9-a5ff-894f7eccd752%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/google-web-toolkit-contributors/4b0d67b6-ba5c-42d9-a5ff-894f7eccd752%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/fcb0b0e1-fd98-48d8-bef4-8d63ce47af4d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to