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

Bug 340033

Summary: Content fetched multiple times due to minification
Product: [ECD] Orion Reporter: John Arthorne <john.arthorne>
Component: ClientAssignee: Simon Kaegi <simon_kaegi>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P2 CC: bokowski, simon_kaegi, susan
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description John Arthorne CLA 2011-03-15 10:37:46 EDT
Our build-time JS minification story doesn't play well with plugins. To give a specific example from M6:

globalCommands.js is minified into navigate-table.js and coding-editor.js. However, when I visit the navigator I see both the minified navigate-table.js and the unminified globalCommands.js are fetched from the server. Therefore we are fetching these bits twice. The same occurs when loading the editor. This is because there are plugins on the page that load globalCommands.js. This is just an example - there are various other scripts that we are effectively loading multiple times.

Some possible solutions to this duplication:

- Allow plugins to request certain services from the host framework, so they don't need to be loaded independently by the plugin's iFrame
- Don't bother minifying JS files that are used by any plugin on that page.
- Maybe these plugins shouldn't be accessing scripts like globalCommands.js in the first place.
Comment 1 Boris Bokowski CLA 2011-03-15 10:47:12 EDT
(In reply to comment #0)
> - Maybe these plugins shouldn't be accessing scripts like globalCommands.js in
> the first place.

+1 - why would plugins be dependent on source files from us, other than plugin.js and the OpenAjax hub?
Comment 2 Susan McCourt CLA 2011-03-16 17:38:43 EDT
(In reply to comment #1)
> (In reply to comment #0)
> > - Maybe these plugins shouldn't be accessing scripts like globalCommands.js in
> > the first place.
> 
> +1 - why would plugins be dependent on source files from us, other than
> plugin.js and the OpenAjax hub?

This relates to the "not everything is a plug-in" discussion.  Today we have pieces of client functionality, like git, which are implemented as a plug-in, but they are contributing Orion pages and need access to the common commmands, headers, etc.
Comment 3 John Arthorne CLA 2011-06-06 08:59:20 EDT
So the work here is to remove many of our plugins because they actually contribute to the main host application. Revisit post 0.2.
Comment 4 Simon Kaegi CLA 2011-06-06 09:32:14 EDT
The "... maybe these plugins shouldn't be accessing scripts like globalCommands.js in the first place." applies here.

I cleaned several of these cases up during the requireJS-ing so am not sure if this is still an issue.

I do see some time spent fetching the various resources in a plugin so think we could benefit from proper optimization there too.
Comment 5 Simon Kaegi CLA 2011-06-09 11:14:17 EDT
In M8 all of the plugins are now standalone and do not access any of the orion components other than plugin.js. I'm going to close this for now but we might want to consider doing further optization on the plugins similar to what we do for the rest of orion.