Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 343070

Summary: Consider to deprecate RegisterOptions.COMPRESS and VERSION_AND_COMPRESS
Product: [RT] RAP Reporter: Ralf Sternberg <rsternberg>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3    
Version: 1.4   
Target Milestone: 2.0 M3   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Ralf Sternberg CLA 2011-04-17 12:28:29 EDT
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?
Comment 1 RĂ¼diger Herrmann CLA 2011-04-18 04:45:49 EDT
I wholeheartedly agree with this suggestion!
Comment 2 Ralf Sternberg CLA 2011-11-13 15:01:30 EST
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.
Comment 3 Ralf Sternberg CLA 2012-11-03 13:34:20 EDT
RegisterOptions have been removed with commit d13ac59375cfaf5ea5d0f24b0ff07cea2e6b61f9.