Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 364415 - Investigate being smarter about what Dojo files need to get deployed
Summary: Investigate being smarter about what Dojo files need to get deployed
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: EDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: lu lu CLA
QA Contact:
URL:
Whiteboard: RUI_Optimization
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-21 15:47 EST by Will Smythe CLA
Modified: 2017-02-23 14:19 EST (History)
7 users (show)

See Also:
svihovec: iplog+
svihovec: review+


Attachments
New Dojo widget folder structure (11.59 KB, image/jpeg)
2012-02-24 05:05 EST, lu lu CLA
no flags Details
Simplified Dojo1.7.1 build for EDT usage (801.47 KB, patch)
2012-02-28 01:46 EST, lu lu CLA
no flags Details | Diff
Simplified Dojo1.7.1 for EDT usage (1.64 MB, patch)
2012-02-28 03:43 EST, lu lu CLA
lulu: review?
Details | Diff
Compiled dojo build (1.87 MB, patch)
2012-03-02 03:51 EST, lu lu CLA
lulu: review?
Details | Diff
Changes of version in local & remote runtime and resource ant file (6.66 KB, patch)
2012-03-02 03:58 EST, lu lu CLA
lulu: review?
Details | Diff
patch of about.html's version and license changes (19.69 KB, patch)
2012-03-02 22:43 EST, lu lu CLA
lulu: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Will Smythe CLA 2011-11-21 15:47:24 EST
We are currently copying the entire Dojo library into the target Web project during deployment. I would estimate, based on the set of Dojo widgets shipped in EDT 0.7, that 75% of the files are unnecessary.

We need to investigate how we can reduce the number of files we deploy and also minify/compress as well. 

For reference: http://dojotoolkit.org/reference-guide/build/
Comment 1 Tony Chen CLA 2012-01-31 01:34:37 EST
Dojo 1.7 has major changes in kernel, there might be good stuff we can leverage. 

======
New in 1.7
New lightweight kernel
Dojo 1.7 is the largest update to the Dojo toolkit since Dojo 1.0. We’ve completely refactored Dojo around a lightweight modular kernel with minimal base dependencies, while retaining compatibility with older Dojo versions.
Comment 2 Huang Ji Yong CLA 2012-02-20 02:30:23 EST
This item is part of the Dojo 1.7 update.
Reassign to lulu.
Comment 3 Yun Feng Ma CLA 2012-02-20 20:56:45 EST
This is not a deployment issue, change it to proper component. thanks.
Comment 4 lu lu CLA 2012-02-24 05:05:30 EST
Created attachment 211564 [details]
New Dojo widget folder structure

What I have done:
	1. Summarize the required dojo widgets in EDT, and release a new Dojo build for 1.6.1
	2. dijit/dojo/dojox only contain required CSS/nls/icons/EGLDojoWidgets(widgets folder)
      	3. Has been verified using 'org.eclipse.edt.rui.dojo.samples_0.7.0'  project.(Looks all widgets work well)

	ps. Same structure can be used in Dojo 1.7.1.

Hi Brian and JiYong, I am not very sure if I have lost anything, please help to review.

Any comment is welcome. Thanks. :-)
Comment 5 Brian Svihovec CLA 2012-02-27 09:41:42 EST
Can you provide a screen capture of the differences between the .8 M2 version of the Dojo Remote project and the .8 M3 version you are creating?  Also, how big is the M2 version of the project (in KB), and how big is the M3 version of the project?  

Are we running the new version of the project through ShrinkSafe to minify and compress the content, and if not, why?
Comment 6 lu lu CLA 2012-02-28 01:41:53 EST
Hi Brian, 

Please ignore my comment #4.

According to 'Bug 368555 - Investigate modular loading in HTML generator', new implementation has been done. 

The modular loading mechanism follow AMD now, required js files will be loaded individually when required, not need to load dojo.js(compile required js files together), so we don't need to compile a new dojo build for EDT. 

I simplify the dojo 1.7.1 standard build(not src build) for EDT usage. 

Compare (dijit, dojo, dojox) size between M2 & M3:
   M3 version: 3.85 MB (4,039,362 bytes), contains 1,272 Files, 223 Folders;
   M2 version: 11.1 MB (11,706,455 bytes), contains 5,183 Files, 1,156 Folders

btw. This simplified version will be fully tested. :)

(In reply to comment #5)
> Can you provide a screen capture of the differences between the .8 M2 version
> of the Dojo Remote project and the .8 M3 version you are creating?  Also, how
> big is the M2 version of the project (in KB), and how big is the M3 version of
> the project?  
> 
> Are we running the new version of the project through ShrinkSafe to minify and
> compress the content, and if not, why?
Comment 7 lu lu CLA 2012-02-28 01:46:53 EST
Created attachment 211705 [details]
Simplified Dojo1.7.1 build for EDT usage

Simplified Dojo1.7.1 build for EDT usage. Will be verified using samples.
Comment 8 lu lu CLA 2012-02-28 03:43:08 EST
Created attachment 211709 [details]
Simplified Dojo1.7.1 for EDT usage

Verify this simplified Dojo build using sample project.

ps. use nightly build (0.8.0.v201202272101)
Comment 9 Brian Svihovec CLA 2012-03-02 01:10:26 EST
In our discussion on AMD loading today, Ji Yong mentioned that it was better for the Dojo Local runtime project to build dojo.js so that it includes all of the AMD modules that can be used by our widgets, since it reduces the load times by 2 seconds and eliminates 200+ requests to the VE server.   Ji Yong also mentioned that this is how the project is currently being built.  

In comment 6 it states that the local runtime project will use AMD, which I believe means that the dojo.js file will be very small and all of the required modules will be loaded at runtime.  Can you clarify which version we are going to be using in .8?  If the projects mentioned in comment 6 are using the small dojo.js implementation, please discuss this with Ji Yong and determine if we should make a change to build a large dojo.js file.

In comment 6, it indicates that we will have a very large reduction in the size of our Dojo Local runtime project, which is great.  Assuming these numbers are based on a small dojo.js file and the use of AMD, how do these numbers change if we go with a large dojo.js file?  I assume the size remains the same, or similar, but does the overall number of files go down, and if so, by how much?
Comment 10 lu lu CLA 2012-03-02 03:49:28 EST
Hi Brian,

yes, we will choose the large dojo.js which compiled with all required .js files. Currently, the compiled dojo build is 5.25MB, 975 Files, 196 Folders.

File number is less than the one which was created in comment 7, but it size a bit larger than that one, that because size of the compiled dojo.js(1,060KB) and dojo.js.uncompressed.js(2,613KB) is almost 3.58MB...(If we don't need to see the uncompressed js code, then we can also delete it, but it's should be better to keep it in build), and the other files are CSS/NLS/Template.

I will attach the compiled dojo build, please take a look. Thanks.


(In reply to comment #9)

> In comment 6, it indicates that we will have a very large reduction in the size
> of our Dojo Local runtime project, which is great.  Assuming these numbers are
> based on a small dojo.js file and the use of AMD, how do these numbers change
> if we go with a large dojo.js file?  I assume the size remains the same, or
> similar, but does the overall number of files go down, and if so, by how much?
Comment 11 lu lu CLA 2012-03-02 03:51:47 EST
Created attachment 211940 [details]
Compiled dojo build

Attached the compiled dojo build, which has been verified by sample project.
Comment 12 lu lu CLA 2012-03-02 03:58:09 EST
Created attachment 211942 [details]
Changes of version in local & remote runtime and resource ant file

This patch contains changes in following files:
   - org.eclipse.edt.ide.ui.resources/customBuildCallbacks.xml
   - local runtime:
         - includeDojo.html
         - version.txt
   - remote runtime:
         - README_GOOGLE_RUNTIME.html
         - includeDojo.html
         - version.txt
Comment 13 Brian Svihovec CLA 2012-03-02 15:31:39 EST
Committed.
Comment 14 Brian Svihovec CLA 2012-03-02 16:41:07 EST
Lu Lu, it looks like we need to update the about.html file in org.eclipse.edt.rui.dojo.widgets\WebContent\about.html
Comment 15 lu lu CLA 2012-03-02 22:42:31 EST
Hi Brian, yes, I patched the about.html with AMD changes... add a new patch in this bug, which has been updated with Dojo 1.7.1 license and version, please help to submit it. Thanks.

(In reply to comment #14)
> Lu Lu, it looks like we need to update the about.html file in
> org.eclipse.edt.rui.dojo.widgets\WebContent\about.html
Comment 16 lu lu CLA 2012-03-02 22:43:57 EST
Created attachment 212012 [details]
patch of about.html's version and license changes
Comment 17 Brian Svihovec CLA 2012-03-03 14:59:30 EST
Committed the updates for about.html.

I have updated our build scripts to remove dojo.js.uncompressed.js from the built version of the 1.7.1 local runtime.  This file is still in CVS if you checkout the dojo.local runtime project.

For the record, our runtime projects are now:

org.eclipse.edt.rui.dojo.runtime.local
org.eclipse.edt.rui.dojo.runtime.remote

The version number is added as part of the nightly build.  Each time we move to a new version of Dojo, we will tag the current version and change the files.  If an older version of the runtime is needed, we can check it out using the tag.
Comment 18 lu lu CLA 2012-03-04 22:01:49 EST
Thanks, Brian.

Resolve this bug.
Comment 19 Lisa Lasher CLA 2012-03-30 18:35:41 EDT
close