Wednesday, March 30, 2011

Re: Doc problem? Renaming Modules section on http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html#DevGuideModules

Doc seems fine to me.

As the doc says there are two use cases of renaming a module.

The first one is pretty obvious: If you have a module called App.gwt.xml that resides in com.companyname.app the GWT compiler will compile this module to /war/com.companyname.app.App/com.companyname.app.App.nocache.js. If you don't want to expose this package structure you just rename the module to a short name, e.g. rename-to="app". The compiler will then produce /war/app/app.nocache.js.

The second use case is when you have an app that needs many permutations (e.g. if this app supports 3 languages and all 5 browser engines you will have 3 * 5 permutations). In the doc this would be MyModule.gwt.xml in the package com.foo. The doc assumes that MyModule does not have a rename-to in its xml and thus it will be compiled to /war/com.foo.MyModule. If you want to speed up compilation during development you only want to compile one permutation (for a specific locale and a specific browser). To achieve this you could either modify MyModule.gwt.xml during development and revert these modifications if you want to compile it for production or you create a new module WorkingModule.gwt.xml that inherits MyModule and contains the modifications and rename it to the name of MyModule (that way you do not have to change MyModule.gwt.xml and you do not have to change GWT's html page which would contain the javascript url: /com.foo.MyModule/com.foo.MyModule.nocache.js)

So its pretty much what the doc describes.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
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