2009年8月3日星期一

Re: [fw-mvc] ZF & Dojo Custom Build

Thank you for the details. I copied all the directories from the
/release/ directory into the /scripts/dojo-custom/ public directory
and changed the configuration from:

$this->dojo()->setLocalPath($this->baseUrl .
'/scripts/dojo/dojo/dojo.js')
->addStyleSheetModule('dijit.themes.tundra');

to

$this->dojo()->setLocalPath($this->baseUrl .
'/scripts/dojo-custom/dojo/dojo.js')
->addStyleSheetModule('dijit.themes.tundra')
->addLayer($this->baseUrl . '/scripts/dojo-custom/dojo/my-dojo.js')
->registerModulePath('../scripts/dojo-custom', 'dojo-custom');

Unfortunately I don't see the # of requests decreasing. I tested it on
dojo form. Initially there were about 65 requests and the page loaded
about 3.5 sec (with a cleared browser cache). After I switched to the
layer the # of requests & the page load are the same still.

One more question, how the custom build should be adjusted for
production? Are there specific build options should be used?

On Mon, Aug 3, 2009 at 10:13 PM, Peter E Higgins<dante@dojotoolkit.org> wrote:
> Kostyantyn Shakhov wrote:
>> I created a Dojo Custom Build (Layer). It consists of the following directories:
>>
>> dijit
>> dojo
>> util
>>
>> The main JS file of the build is in dojo/my-dojo.js
>>
>> Although the following point of its usage with ZF are unclear still:
>>
>> 1.    Is the build platform independent, meaning is the same build can be
>> used for both development and production platforms?
>> 2.    Are all of the above subdirectories required to be able to use the Layer?
>> 3.    How to use the Layer in ZF if its files were copied into
>> scripts/dojo-custom public directory? Will the following work and
>> enough:
>> $view->dojo()->addStylesheetModule('dijit.themes.tundra')
>>              ->setLocalPath('/scripts/dojo/dojo.js')
>>              ->addLayer('/scripts/dojo-custom/dojo/my-dojo.js')
>>              ->registerModulePath('../scripts/dojo-custom', 'dojo-custom');
>> 4. Should the Dojo full release code be kept in the scripts/dojo?
>>
>>
>>
> 1. yes, but it is recommended to work from an unbuilt-src in
> development, and adjust to use built in production.
> 2. not necessarily, it is just infinitely easier to copy over the whole
> /release/ tree into production than to guess at which files you may or
> may not need in the future (variable dojo.require,
> dojo/resources/blank.html for iframes, etc)
> 3. simply point at the "new" dojo.js in
> /scripts/dojo-custom/dojo/dojo.js as the root, all modules/layers work
> relative from that position.
> 4. it is not necessary. As with #3, the tree used is the one relative to
> the included dojo.js. none of the unbuilt tree will be used if you
> asjust to the new location.
>
> Hope this helps
>
> Regards,
> Peter
>
> --
> Peter E Higgins
> Dojo Project Lead : http://dojotoolkit.org
>
>

没有评论: