Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DOJO build that does not include DOJO base

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.

like image 293
Derald Price Avatar asked Oct 09 '22 20:10

Derald Price


2 Answers

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

like image 53
mtyson Avatar answered Oct 12 '22 11:10

mtyson


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.

like image 44
Vijay Agrawal Avatar answered Oct 12 '22 11:10

Vijay Agrawal