blackberry/WebWorks

minify all core JS resources added to apps by bbwp

Closed this issue · 9 comments

Please make sure that any *.js files auto injected into a WebWorks application by bbwp are minified - no need for unecessary file size bloat.

If you open a *.cod file, generated by bbwp using a text editor (e.g. notepad), you can see that the following resources are not being minified:

everything from /ext/common/sharedglobal (30Kb)

1_constants.js
2_blackberry.js
3_xhr.js
4_events.js
5_blob.js
json2.js

All of the *_uncompressed.js files found within device_templates/js are still being included. These assets represent 102 KB total of wasted file size space - the minified versions of these files, which are also being packaged, are only 38KB total size..:

html5_init_uncompressed.js
html5_worker_uncompressed.js
navmode_uncompressed.js

For the Juliet Release, We are going to limit the scope of this to removing the minified version of files from Github. We will open a feature against the following release to tie minification of files to the -d flag of the packager.

I disagree with this.

Devs would want the production version of their apps, not the debug version, to be optimized by minifying its resources. That would be the *.cod or *.bar that is deployed to App World.

I think it would work the other way around: minify resources by default, however if you use -d then do not minify (could be helpful as part of debugging). What do you think?

Sorry, that was my intention: if -d is specified, full source will be included in the app. If -d is NOT specified, all source will be minified. This will be a feature targeted at Tumbler 2.4. We are currently working on a 2.3.1 release with some bug fixes, and for this version, we will ALWAYS include full source; we will just be ensuring that no duplicated/minified files are included in the cod.

Understood. thanks.

I verified the fix for this issue using today's feature build located at http://ci0000001875214:9080/hudson/job/Tumbler-WebWorks-master-next-js-resources/1/.

I tried a navigation mode and an HTML5-to-Gears application. An app compiled with today's feature build is 41 KB smaller than the same app compiled with Tumbler 2.3.0.9. Also, apps compiled using today's build work correctly.

One thing I'd like to mention is that currently the -d flag is used to enable Web Inspector, so I think a different flag will need to be used to enable/disable minified files.

Thanks Igor. Have you been able to open the cod and ensure it contains the correct files?

----- Original Message -----
From: ishneur [mailto:reply@reply.github.com]
Sent: Wednesday, January 25, 2012 06:32 PM
To: Ken Wallis
Subject: Re: [WebWorks] minify all core JS resources added to apps by bbwp (#89)

I verified the fix for this issue using today's feature build located at http://ci0000001875214:9080/hudson/job/Tumbler-WebWorks-master-next-js-resources/1/.

I tried a navigation mode and an HTML5-to-Gears application. An app compiled with today's feature build is 41 KB smaller than the same app compiled with Tumbler 2.3.0.9. Also, apps compiled using today's build work correctly.

One thing I'd like to mention is that currently the -d flag is used to enable Web Inspector, so I think a different flag will need to be used to enable/disable minified files.


Reply to this email directly or view it on GitHub:
#89 (comment)


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

I haven't tried that, but I'll try it tomorrow and let you know.

----- Original Message -----
From: Ken Wallis [mailto:reply@reply.github.com]
Sent: Wednesday, January 25, 2012 07:11 PM
To: Igor Shneur
Subject: Re: [WebWorks] minify all core JS resources added to apps by bbwp (#89)

Thanks Igor. Have you been able to open the cod and ensure it contains the correct files?

----- Original Message -----
From: ishneur [mailto:reply@reply.github.com]
Sent: Wednesday, January 25, 2012 06:32 PM
To: Ken Wallis
Subject: Re: [WebWorks] minify all core JS resources added to apps by bbwp (#89)

I verified the fix for this issue using today's feature build located at http://ci0000001875214:9080/hudson/job/Tumbler-WebWorks-master-next-js-resources/1/.

I tried a navigation mode and an HTML5-to-Gears application. An app compiled with today's feature build is 41 KB smaller than the same app compiled with Tumbler 2.3.0.9. Also, apps compiled using today's build work correctly.

One thing I'd like to mention is that currently the -d flag is used to enable Web Inspector, so I think a different flag will need to be used to enable/disable minified files.


Reply to this email directly or view it on GitHub:
#89 (comment)


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.


Reply to this email directly or view it on GitHub:
#89 (comment)


This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

For the navigation mode .cod, its content is as follows:

  • Scrambled code
  • Unscrambled content of navmode.js starting from line 1151 until the end
  • Scrambled code
  • Unscrambled content of json2.js
  • Unscrambled content of 2_blackberry_ns.js
  • Unscrambled content of 4_events_ns.js
  • Unscrambled content of 3_xhr.js
  • Unscrambled content of 1_constants.js
  • Unscrambled content of 5_blob.js
  • Unscrambled content of navmode.js from line 1 until 215
  • Unscrambled content of html5_worker.js
  • Unscrambled content of html5_init.js
  • HTML content of my app
  • Unscrambled content of navmode.js from line 215 until 743

For the HTML5-to-Gears .cod, its content is:

  • Scrambled code
  • Unscrambled content of json2.js
  • Unscrambled content of 2_blackberry_ns.js
  • Unscrambled content of 4_events_ns.js
  • Unscrambled content of 3_xhr.js
  • Unscrambled content of 1_constants.js
  • Unscrambled content of 5_blob.js
  • Unscrambled content of navmode.js from line 1 until 215
  • Unscrambled content of html5_worker.js
  • Unscrambled content of html5_init.js
  • Scrambled code
  • Unscrambled content of navmode.js from line 216 until the end

Both cods contain the 6 files from "\ext\common\sharedglobal", and the 3 files from "\device_templates\js".

Also, in this feature build, the compressed files from "\device_templates\js" are not there anymore. Only the uncompressed versions are there now (the larger size versions of html5_init.js, html5_worker.js and navmode.js).

Included in 2.3.1 release