DOJO build that does not include DOJO base

641 views Asked by At

Is this possible using v1.6.1? Due to the Xdomain configuration of my client's dojo deployment, it is necessary to execute a new build each time dev code changes. As you can imagine, this is a huge time waster.

From everything I can see there is no way to exempt the core from the build playing by DOJOs rules. So I am wondering if there is a way to break the rules (modifying the Rhino calls?) to get to where I need to be.

3

There are 3 answers

1
Vijay Agrawal On

Dojo supports mix-and-match - so you can use xdomain and/or custom build for the stuff that does not change - and use regular dojo.require for the JS/widget that is changing often - and then just push that JS to see the change without a new xdomain/custom build/deployment

You can explore using local modules with xdomain build. Also, Dojo allows using multiple custom builds - so you can do a stable custom build for the widgets that don't change so much and another smaller build for code that is changing frequently.

3
mtyson On

A couple thoughts.

  1. You can avoid building most of dojo (dijit, dojox) but I imagine you already know that
  2. This restriction you are facing seems odd. Isn't there some way you can just upload the specific JS files you are editing during development?

Maybe if you give more details on the client setup, I can help you brainstorm a way around this problem.

Update Here's what I think you need: Customize Dojo Base in Build. This allows you to specify particular bits of the dojo base to include.

This works in pre-1.7, so you should be good.

Appears to be exactly what you want:

layers: [
  {
       name: "dojo.js",
       customBase: true,
       dependencies: [
       ]
  },

 // ... remainder of profile

 ]

This will give you the absolute bare minimum of dojo (which you still don't need for your dev scenario, but which will drastically reduce the amount of files processed).

For other use cases, you can use the dependencies attribute to add in other stuff from dojo core.

Update 2: Here's a couple build-time optimization suggestions:

1) Don't intern strings, and don't compress, when in dev. There are arg values you can pass to avoid these time-consuming steps (example is for ant build):

<arg value="internStrings=false"/>
<arg value="layerOptimize=false"/>

2) Build to a ram disk to speed copying of files

0
Ted On

Why not use dojo 1.7, load asynchronously, and rely on it's legacy support? http://livedocs.dojotoolkit.org/loader/amd