Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 335238 - Do some rudimentary JS compression/concatenation in the build
Summary: Do some rudimentary JS compression/concatenation in the build
Status: RESOLVED FIXED
Alias: None
Product: Orion
Classification: ECD
Component: Client (show other bugs)
Version: 0.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-24 14:41 EST by Andrew Niefer CLA
Modified: 2011-09-01 11:42 EDT (History)
2 users (show)

See Also:


Attachments
example markup (1.91 KB, patch)
2011-01-24 14:46 EST, Andrew Niefer CLA
no flags Details | Diff
markup on client (7.39 KB, patch)
2011-01-25 15:04 EST, Andrew Niefer CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.