Re: Writing a JS library in GWT?

2010-07-27 Thread André Moraes
Correction on my last post. The module load is required by the user.agent property. But the output from the compiler remove the GUI code from the library when compiled, you must remove the line which imports the Standard style so the images for borders and other things will no go in the output.

Re: Writing a JS library in GWT?

2010-07-27 Thread André Moraes
I had the same problema of getting bigger source code files. The solution: Check your Module file (Module.gwt.xml). As the default behavior is to create GUI the default module loads the User module and this module has a lot of code that you don't use when creating non GUI libraries/applications.

Re: Writing a JS library in GWT?

2010-07-27 Thread Sripathi Krishnan
> > That's why, when writing a function in GWT, I expect it to compile out > to something that doesn't exceed the size of handwritten JS for the > same purposes. Compiling Java to Javascript has some overheads which you cannot get rid off easily. These overheads are not much if you are building a

Re: Writing a JS library in GWT?

2010-07-27 Thread lineman78
Once the GWT compile completes, it is up to the linker to decide how to package it. The single script linker should behave how you would like, but you will have to make sure that deferred binding is never used in your code unless only one permutation is possible. The default linker is an iframe l

Re: Writing a JS library in GWT?

2010-07-27 Thread S Rabin
I see. So when the only thing in my loadModule function is an export call, and I export the method (via Ray Cromwell's gwt-exporter library, which I was already using): public void HelloTest(String id){ DOM.getElementById(id).setInnerHTML("Hello World"); } it should compile to 25kb plus a bo

Re: Writing a JS library in GWT?

2010-07-26 Thread lineman78
First, let me start by saying that people are already writing javascript libraries using GWT and have been for some time. Ray Cromwell created the GWT exporter library for this exact purpose for his own usage and open sourced it. While bootloaders seem expensive it is the only way to deliver the

Writing a JS library in GWT?

2010-07-26 Thread S Rabin
I've done quite a bit of searching to find any information about this, but it seems that people are more concerned with writing GWT libraries to keep in GWT before compilation. I would like to write the libraries I frequently use in my projects in GWT, then compile and expose them to hand-written