Community
Participate
Working Groups
The values COMPRESS and VERSION_AND_COMPRESS are used to enable JavaScript compression of custom code. Currently, the compression of RWT's JavaScript resources depends on the chosen client library variant, i.e. we do not compress JavaScript in development mode. However, this distinction does not affect custom resources. If resources are registered with COMPRESS, they will always be compressed independent of the chosen library variant. For me it seems that there is no point in delivering certain libraries in plain and others in compressed mode. I would therefore suggest to: 1) Compress all JavaScript including custom resources in production mode and deliver all JavaScript uncompressed in development mode. 2) Mark RegisterOptions.COMPRESS and RegisterOptions.VERSION_AND_COMPRESS as deprecated. 3) Handle COMPRESS like NONE and VERSION_AND_COMPRESS like VERSION internally. Change the JavaDoc of IResource.getOptions() and the RegisterOptions parameter in IResourceManager accordingly. In a second step, we could consider to make RegisterOptions obsolete entirely. Opinions?
I wholeheartedly agree with this suggestion!
I was about to do so, but then hesitated - isn't it a perfectly valid use case to register JavaScript resources that should not be compressed by RAP, e.g. resources that are compressed already? For a start, I changed the ResourceManagerImpl so that it only compresses resources if the COMPRESS option is set AND we're not in development mode.
RegisterOptions have been removed with commit d13ac59375cfaf5ea5d0f24b0ff07cea2e6b61f9.