[Dojo-interest] dojo.require(), Shrinksafe and compression
jbondc at gmail.com
Mon Dec 17 17:56:41 UTC 2007
- It's safe to remove the dojo.require() lines
- Keeping dojo.require() lines will not cause any harm, but adds unnecessary
calls. You must keep dojo.provide(), this is how dojo knows what's available
The build system does this for you and some more magic
- Yep, if you forget a file, the "dojo loader" will see it's not available
and request the file remotely
From: dojo-interest-bounces at dojotoolkit.org
[mailto:dojo-interest-bounces at dojotoolkit.org] On Behalf Of Daniel
Sent: December 17, 2007 11:43 AM
To: dojo-interest at dojotoolkit.org
Subject: Re: [Dojo-interest] dojo.require(), Shrinksafe and compression
I just made a big compressed file with ShrinkSafe. It packs 21 files
from dijit, dojo.data and dojox.
- Do I still need the dojo.require() lines?
- Will including hose lines cause Dojo to download the original files?
Or will it realize that the widgets are already downloaded?
- Most of the 21 files are dependencies. What if I forgot one? Will the
dojo.require() lines download the one file I might have forgotten?
Thanks for the help.
> ShrinkSafe looks very cool:
> I would like to use it to compress not only my files, but more
> importantly those of Dojo. The problem is that I don't know what files I
> need. My understanding is that dojo.require() does dependency
> resolution, so if you have dojo.require("dijit.Foo") that might actually
> download 2 or 3 other files in addition to dijit/Foo.js
> Is there a way for me to know, based on my require() lines, which files
> I need?
> For my app I need to use a lot of different widgets, and I'm very
> interested in compressing them as much as possible.
> If possible, I'd also like to compress the CSS and HTML templates that
> Dojo uses.
> For further compression, I plan to send gzip-compressed files to
> browsers that can handle it like Firefox. Does anyone know which
> browsers can handle gzip compressed files? I know that I don't need that
> information, I'm just curious.
> Thanks for the help.
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> Dojo-interest at dojotoolkit.org
Dojo-interest at dojotoolkit.org
More information about the Dojo-interest