Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343070 - Consider to deprecate RegisterOptions.COMPRESS and VERSION_AND_COMPRESS
Summary: Consider to deprecate RegisterOptions.COMPRESS and VERSION_AND_COMPRESS
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.4   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: 2.0 M3   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-17 12:28 EDT by Ralf Sternberg CLA
Modified: 2012-11-03 13:34 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.