Tuesday, January 1, 2013

Updating GWT libraries for supporting xsiframe

I'm the author of some GWT libraries wrapping some JS libraries like YUI, raphaeljs, sizzlejs, etc. In this GWT libraries I need to include the JS files and until now I'm doing this using <script src="jsLibrary.js"></script> in my libraries gwt.xml. This way the end user of my libs do not have to worry about getting or loading the JS library at all, just <inherith> my library and it is ready to work.

But <script> in gwt.xml is not supported by the new xsiframe linker. As I understand from previous discussion and documentation, there are two possible solutions:

1) First solution: let the user be responsible of including the aLibrary.js file in its html host page. This adds extra work to the end user: he has to download the .js minified file and include it on the html host page.

2) Second solution: use a tool like ScriptInjector for loading aLibrary.js file dynamically. With this solution I release the user of the responsabilities of having to get the .js file and put it on the host page, but adds an extra step for our users. For example, in my libraries  "getting started" guides like http://code.google.com/p/gwtsizzle/wiki/GettingStarted the user is able to use the Java API directly withtout loading anything, but now he must first load the "library" async for using it, like this:

MyLib.load(new MyCallback(){
    public void loaded(){
        //now start using the API
    }
})

This two solutions adds extra work to the end user compared to my current solution of symply using <script src="aLib.js"></script> in my library's gwt.xml file. So my question is, am I missing something ? a third solution that I didn't contemplate ? Or simply updating my GWT wrapper libraries to support xsiframe linker will add extra work to my libraies end users ?

Regards and thanks in advance.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/Gah89dluRfkJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment