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

Bug 335238

Summary: Do some rudimentary JS compression/concatenation in the build
Product: [ECD] Orion Reporter: Andrew Niefer <aniefer>
Component: ClientAssignee: Project Inbox <e4.orion-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: nathan, simon_kaegi
Version: 0.2   
Target Milestone: 0.2   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
example markup
none
markup on client none

Description Andrew Niefer CLA 2011-01-24 14:41:23 EST
We should do some JS compression and concatenation in the build, something basic for M5.

We can use Google Closure http://code.google.com/closure/ for this.

To start with, I will look at our 3 main html pages:
1) coding.html
2) navigate-table.html
3) navigate-tree.html

I will mark-up the html with comments around <script> elements to indicate which js files are being combined.
Comment 1 Andrew Niefer CLA 2011-01-24 14:46:05 EST
Created attachment 187460 [details]
example markup

Attached patch is an example of what the markup might look like.

The build would automatically comment out the sections between
<-- START: --> and <!-- END: --> tags and insert a new script tag at <!-- INSERT -->

The actual generation of the compressed & concatenated js would be done in the short term by a manually maintained ant script.
Comment 2 Andrew Niefer CLA 2011-01-25 15:04:46 EST
Created attachment 187565 [details]
markup on client

Here are my markup changes on the client.

There will be a js/compiled/eas.js containing:
org.eclipse.orion.client.core/static/js/registry.js
org.eclipse.orion.client.core/static/js/auth.js
org.eclipse.orion.client.core/static/js/util.js
org.eclipse.orion.client.core/static/js/commands.js
org.eclipse.orion.client.core/static/js/dialogs.js
org.eclipse.orion.client.core/static/js/input.js
org.eclipse.orion.client.core/static/js/log.js
org.eclipse.orion.client.core/static/js/preferences.js
org.eclipse.orion.client.core/static/js/saveable.js
org.eclipse.orion.client.core/static/js/selection.js
org.eclipse.orion.client.core/static/js/status.js
org.eclipse.orion.client.core/static/js/users.js		
org.eclipse.orion.client.core/static/js/fileClient.js
org.eclipse.orion.client.core/static/js/favorites.js
org.eclipse.orion.client.core/static/js/searchClient.js

There is a js/compiled/coding-editor.js containing
org.eclipse.orion.client.editor/web/samples/styler.js
org.eclipse.orion.client.editor/web/samples/rulers.js
org.eclipse.orion.client.editor/web/samples/undoStack.js
org.eclipse.orion.client.editor/web/js/model.js
org.eclipse.orion.client.editor/web/js/editor.js
org.eclipse.orion.client.core/static/js/outliner.js
org.eclipse.orion.client.core/static/js/problems.js
org.eclipse.orion.client.core/static/js/editorContainer.js
org.eclipse.orion.client.core/static/js/syntaxchecker.js

There is a js/compiled/nagivate-table.js with
org.eclipse.orion.client.core/static/js/treetable.js
org.eclipse.orion.client.core/static/js/breadcrumbs.js
org.eclipse.orion.client.core/static/js/explorer-table.js
org.eclipse.orion.client.core/static/js/navigate-table/navigate-table.js

and navigate-tree.js with 
org.eclipse.orion.client.core/static/js/breadcrumbs.js
org.eclipse.orion.client.core/static/js/explorer-tree.js
org.eclipse.orion.client.core/static/js/navigate-tree/navigate-tree.js
Comment 3 Andrew Niefer CLA 2011-01-26 13:56:51 EST
To make this work, registry.js and auth.js had to be removed from the compiled/eas.js and treetable.js is removed from compiled/nagivate-table.js
Comment 4 Nathan Gervais CLA 2011-02-04 11:16:55 EST
I've made some changes to my local explorer-table.js,

does this mean i need to recompress 'js/compiled/navigate-table.js' myself?
Comment 5 Andrew Niefer CLA 2011-02-04 11:43:21 EST
(In reply to comment #4)
> I've made some changes to my local explorer-table.js,
> 
> does this mean i need to recompress 'js/compiled/navigate-table.js' myself?

You shouldn't need to recompress those.  When you are self hosting from your workspace, then the html files you get from GIT are not using the compiled scripts.

At build time those html files are modified to use the compiled scripts instead of the individual pieces.

You can confirm by looking at, for example, org.eclipse.orion.client.core/static/navigate-table.html and see the comments like <!--START:navigate-table.j --> which haven't been replace yet.
Comment 6 Andrew Niefer CLA 2011-03-03 15:41:53 EST
This has been turned off for being too brittle.
Comment 7 Simon Kaegi CLA 2011-06-20 21:54:14 EDT
I think our work with requireJS supersedes this.