Here's a wacky experiment! I'd like to further break down dojo core into a skeleton dojo and a base module. For example I've created a custom profile:
layers: [
{
name: "dojo.js",
customBase: true,
dependencies: [
]
},
{
name: "core.js",
dependencies: [
"dojo.core"
]
}
],
prefixes:[
["dijit","../dijit"],
["dojox","../dojox"]
]
}
And added dojo/core.js:
dojo.require("dojo._base.lang") ;
dojo.require("dojo._base.Deferred") ;
dojo.require("dojo._base.json") ;
dojo.require("dojo._base.query") ;
dojo.require("dojo._base.NodeList") ;
dojo.require("dojo._base.array") ;
dojo.require("dojo._base.connect") ;
dojo.require("dojo._base.xhr") ;
dojo.require("dojo._base.html") ;
dojo.require("dojo._base.window") ;
By customizing the build in this manner, my dojo core is reduced from 74K to around 13K. This also allows me to pick only the base module I'm interested in. For example If I'm interested in only dojo.connect, I simply do a require on dojo._base.connect with a cost of additional 6K. And If I choose to include the entire core, then I would simply do a require on dojo.core. Why the madness? Because for certain types of web pages, 74K download may still be "too" much. I'm trying to further optimize dojo so that it can be used for pages load requirement of less than 2 seconds. By following this approach, it allows me to minimize proprietary development of common APIs.
The implication with this model is that I have to maintain two versions of dojo builds: My custom build and a standard build. Is it possible to combine the builds so that developers have the option of including either standard dojo.js or including for example dojo-skeleton.js + modules of interest or dojo.core? I've been struggling with this one and am almost ready to give up.

You can simplify the above
You can simplify the above by removing the core.js layer, and just adding the required modules listed in core.js as dependencies for dojo.js:
layers: [
{
name: "dojo.js",
customBase: true,
dependencies: [
"dojo._base.lang",
"dojo._base.Deferred",
"dojo._base.json",
"dojo._base.query",
"dojo._base.NodeList",
"dojo._base.array",
"dojo._base.connect",
"dojo._base.xhr",
"dojo._base.html",
"dojo._base.window"
]
}
],
prefixes:[
["dijit","../dijit"],
["dojox","../dojox"]
]
}
Be careful when using the customBase property on the dojo.js layer though: all modules outside of Base assume all of Dojo Base is always available. You will have to test carefully if you dojo.require("") other modules in your code.
Different problem...issue with build system
I understand the implications but my issues are with the build system. Also including _base modules in the dependencies increases the size of dojo.js to around 58K. The approach I used keeps down dojo.js to absolute minimum (around 13K). Thereafter I can either pick modules in dojo_base a la carte or simply include dojo.core if I want all the _base modules. Basically the skeleton I build plus dojo.core is the same as the "normal" build of of the 75K dojo.js. I hope this is not confusing.
In regards to builds is it possible to have the standard dojo.js plus the skeleton version (call it dojo-skeleton.js) of dojo in the same, single package with the understanding that if I use dojo-skeleton.js, I'd have to do a require on the individual _base modules or require my dojo.core? And if I reference dojo.js in my script tag, it's business as usual.
OK, so you would like a JS
OK, so you would like a JS file, call it dojo-skeleton.js that just has the absolute minimum (no dojo._base modules) and you want that delivered as part of the Dojo standard distributions?
We probably will not do that, since we want to keep a simple story for end users. Once people see that file in there, they will try to use it not understanding the impact. We already battle with the perception that dojo is complex, so we try to simplify where possible.
Once you understand the true nature of things, as you do, we have the machinery to support these alternate use cases via custom builds, but we want to keep the default, majority use case simple.
Yes and No, :-)
Thanks James. I appreciate your help.
Yes, you are correct. I do not want dojo._base modules in dojo-skeleton.js. Also my intention is to deliver this in my own custom build, not the standard distribution.
A bit more context. The dojo core from AOLCDN takes around 375 milliseconds for download and activation, a percentage of 18 - 25% of our performance requirements. And the only way to bring this number down is by minimizing the core and individually selecting the _base module of interest. I've done this in my custom builds as described above and it makes a difference in performance.
The question is how can I have both the standard dojo.js and dojo-skeleton.js in a single custom build? If this doesn't work, then I have to have two builds. Single build simplifies support and maintenance.
Oh, OK, so having both
Oh, OK, so having both generated via one build pass: unfortunately the build system is not set up for that. If you want to be absolutely safe, two builds are required. If you do not need multiversion support, then you could probably do the build for dojo-skeleton, then after the build is done, concat dojo-skeleton with core.js to generate something close to the original, assuming core.js included all _base modules. But if core.js does not have all base modules, then two builds are needed.