Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [orion-dev] Changes to Orion build-time JS minification

Thanks a lot Mark!

Sent from my iPad

On Mar 5, 2014, at 6:24 PM, "Mark Macdonald" <mamacdon@xxxxxxxxx> wrote:

I've released some changes to Orion's build-time JS minification. The rationale is twofold:

  1. Reduce build times [1].
  2. Reduce duplicated logic across various builds of Orion (Maven, PDE, Node, etc), to make it easier for developers to get new pages minified without breaking things. [2]

After some initial problems, builds seem to be working OK again. (If you notice any problems with build output or minification, please open a bug and assign it to me.)

Here's a summary of the results:
  1. Build times
  1. Proper use of r.js has reduced the minification time for Orion's client code from 68 minutes to 12 minutes  [3][4]. As the build scripts are now shared, the PDE build has seen similar improvements. This gives us total build times of ~21 minutes (PDE) and ~28 minutes (Hudson
  2. , orion-client + orion-server
  3. ).
  1. Build
  2. maintenance
  1. From now on, the only file developers should normally have to
  2. maintain is this one in the client repo:
  1. releng\org.eclipse.orion.client.releng\builder\scripts\orion.build.js.
  1. This is the RequireJS build file used to minify the Orion client
  2. UI. It contains a few additional parameters that are not standard RequireJS.


See below for Orion-developer-oriented details about the client build.


Adding a new module to the client build

There's just one step:
  1. Add an entry to the modules section of orion.build.js.

Every entry needs a name property and a bundle, which tells the builder which bundle the minified module should be copied back into. For example, here is the Git Commit page's entry:

{ name: "git/git-commit",
  bundle: "${buildDirectory}/bundles/org.eclipse.orion.client.git"
},

^ Ant-style property replacement is supported, but ${buildDirectory} is all you should use there. The PDE, Hudson, and Node builds all share orion.build.js, so your new module will be correctly built everywhere.

Adding a new client bundle to the JS build
  1. Add an entry to the bundles section of orion.build.js.
  2. If your bundle contains any JSDocs, add an entry to the jsdocs section of orion.build.js.
  3. Add
  4. module entries for any of the bundle's modules you want minified (see previous section).
  5. Add an entry to the <modules> section of the client repo's top-level pom.xml to ensure that the Maven builder finds your bundle.

Building stand-alone features (like the standalone Orion editor)

Right now these are still handled separately by the build script. You must add logic to orion.mini.xml that invokes r.js, passing the build file for your feature. Use the standalone editor build as a reference.

Thanks
Mark

[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=429077
[2] https://bugs.eclipse.org/bugs/show_bug.cgi?id=422699
[3] https://hudson.eclipse.org/orion/job/orion-client/162/
[4] https://hudson.eclipse.org/orion/job/orion-client/167/


_______________________________________________
orion-dev mailing listorion-dev@xxxxxxxxxxxhttps://dev.eclipse.org/mailman/listinfo/orion-dev

Back to the top