2008年12月29日星期一

Re: [fw-mvc] Creating custom dojo builds...

Is this live anywhere? What is the list of files being requested? The
profile / command line / etc looks entirely sane, and should work. My
only guess is you are still loading the layer.js from the pre-build tree
(or a dojo.js) and despite running the build, Dojo is using the relative
location from the source tree.

Feel free to ping me off-list with a live url -- that would provide the
debugging info needed to give you a definitive answer.

Regards,
Peter Higgins


Drew Bertola wrote:
> Peter E Higgins wrote:
>> Drew Bertola wrote:
>>
>>> Thanks Peter and Matthew.
>>>
>>> I followed Peter's approach and still ended up with 32 file
>>> requests. Is there supposed to be that many?
>>>
>>> It's better than the 60+ requests I get without the layer, but still...
>>>
>>> Thanks again.
>>>
>>>
>> No. With the layer approach you will have two js resources loaded:
>> dojo.js and layer.js -- depending on what is in the layer, you may see
>> one request for i18n bundle for the locale. What are the url's for the
>> additional requests being made?
>>
>> One step I didn't mention in the last note is cssOptimize ... if you are
>> using Dijit, you'll need a theme obviously, but for maintainability the
>> themes are broken into many small files based on widget. tundra.css is
>> simply a list of @imports in a -src release. In the "release", we use a
>> command line option cssOptimize=comments.keepLines
>> cssImportExclude=../dijit.css
>>
>> This makes a tundra.css "layer" of all the @imports (you can do this too
>> in your my/ namespace, provided the css files all use relative locations
>> to images and such), and excludes the @import "../dijit.css"; You can
>> skip the exclusion of dijit.css, we do this step for backwards
>> compatibility.
>>
>> I suspect the majority of your requests are CSS, as cssOptimize is not
>> on by default, so running it against a clean checkout or -src release
>> will not build the theme rollups.
>>
>> So, dojo.js, layer.js, nls/layer-en.js, tundra.css, and however many
>> images are referenced in css and being used in the dom would be your
>> initial expected request count. I suppose it _could_ be 32 including
>> images, depending on how many widgets you are using. Some use sprites,
>> others cannot ...
>>
>
> They're all js files.
>
> Here's my profile:
> ------------------------- nt.profile.js -------------------
> /* ./build.sh profile="nt" action="release" loader="default"
> cssOptimize=comments.keepLines optimize="shrinksafe"
> layerOptimize="shrinksafe" copyTests="false" version="0.0.1-nt"
> releaseName="nt" */
>
> dependencies = {
>
> stripConsole: "normal",
>
> layers: [
> {
> name: "nt.js",
> resourceName: "nt.layer",
> dependencies: [
> "nt.layer"
> ]
> }
> ],
>
> prefixes: [
> [ "nt", "../nt" ],
> [ "dijit", "../dijit" ],
> [ "dojox", "../dojox" ]
> ]
>
> };
>
> ------------------------- nt.profile.js -------------------
>
> and my layer:
> ----------------------- layer.js ---------------------------
> dojo.provide("nt.layer");
>
> dojo.require("dojo.parser");
> dojo.require("dojo.fx");
> dojo.require("dijit.form.FilteringSelect");
> dojo.require("dijit.form.Button");
> dojo.require("dijit.form.Form");
> dojo.require("dijit.form.ValidationTextBox");
>
> dojo.require("nt.main");
> dojo.require("nt.forms");
> dojo.require("nt.postingAccordions");
>
> ----------------------- layer.js ---------------------------
>

没有评论: