blackberry / WebWorks

BlackBerry WebWorks for Smartphones is a platform for building deeply integrated web applications for BlackBerry smartphones
http://developer.blackberry.com/html5
268 stars 51 forks source link

minify all core JS resources added to apps by bbwp #89

Closed astanley closed 12 years ago

astanley commented 12 years ago

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

kwallis commented 12 years ago

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.

astanley commented 12 years ago

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?

kwallis commented 12 years ago

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.

astanley commented 12 years ago

Understood. thanks.

ishneur commented 12 years ago

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.

kwallis commented 12 years ago

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: https://github.com/blackberry/WebWorks/issues/89#issuecomment-3661517


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.

ishneur commented 12 years ago

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: https://github.com/blackberry/WebWorks/issues/89#issuecomment-3661517


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: https://github.com/blackberry/WebWorks/issues/89#issuecomment-3662006


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.

ishneur commented 12 years ago

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

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

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).

kwallis commented 12 years ago

Included in 2.3.1 release