I was just thinking I need to put in a comment about what that means. :)
resourceName in the .profiles file config is a name you can give the
file for the dojo.provide string for that layer file. So, if you say
resourceName: "foo.bar", inside that layer file, the following
statement will be inserted:
dojo.provide("foo.bar");
This allows you to dynamically load the layer via dojo.require(). Note
that it is a little hazardous to do this in 0.4.3, depending on how
you have your dependencies set up (if you have the same module in two
layers, one may overwrite the other, and that may cause bad things).
In 0.9, there are protections to avoid the overwriting (but doesn't
help with the duplicate code download).
James
On 8/10/07, O'Shea, Sean <Sean.O'Shea@fmr.com> wrote:
> Sweet - played around with that a little and it works. My final profile
> file looks like this:
>
> dependencies.layers = [
> {
> name: "tcf.js",
> resourceName: "fmr.tcf",
> layerDependencies: [
> "dojo.js"
> ],
> dependencies: [
> "fmr.tcf",
> "fmr.tcf.core",
> "fmr.tcf.provider"
> ]
> }
> ];
>
> dependencies.prefixes = [
> ["fmr", "fmr"]
> ];
>
> I had placed all my custom code under a folder called 'fmr'. My
> directory structure looks like this:
>
> \dojo-0.4.3
> \api
> \bench
> \...
> \fmr
> \tcf
> \...
> \...
> \src
> \animation
> \cal
> \...
>
> Looks like I just needed that .prefixes configuration to tell the build
> tool where to look for the tcf files.
>
> Just one more question - what does the resourceName configuration entry
> mean in the .profiles files?
>
> Thanks again.
>
> Sean
>
> -----Original Message-----
> From: [email protected: dojo-interest-bo...@dojotoolkit.org]
> [email protected: dojo-interest-bo...@dojotoolkit.org] On Behalf Of James Burke
> Sent: Friday, August 10, 2007 4:11 PM
> To: [email protected: dojo-int...@dojotoolkit.org]
> Subject: Re: [Dojo-interest] Layers profiles and dojo 0.4.3
>
> It looks like the 0.4.3 profile.js file is missing the prefixes
> mapping for tcf? Add this part before the call to load()
>
> dependencies.prefixes = [
> ["tcf", "../fmr"]
> ];
>
> James
>
> On 8/10/07, O'Shea, Sean <Sean.O'Shea@fmr.com> wrote:
> > Hi all,
> >
> > I'm using the layers profile to build a personalized version of dojo
> > 0.4.3 & I'm running into a few issues. My .profile.js file looks like
> > this:
> >
> > var dependencies = [
> > "dojo.event.*"
> > ];
> >
> > dependencies.layers = [
> > {
> > name: "tcf.js",
> > resourceName: "fmr.tcf",
> > layerDependencies: [
> > "dojo.js"
> > ],
> > dependencies: [
> > "fmr.tcf",
> > "fmr.tcf.core",
> > "fmr.tcf.provider"
> > ]
> > }
> > ];
> >
> > // NOTE: this MUST be included or a list of files must be output via
> > print()
> > // manually.
> > load("getDependencyList.js");
> >
> > Basically, I need a file called tcf.js which is compressed in the same
> > manner as dojo.js and contains all the .js files under the fmr.tcf,
> > fmr.tcf.core & fmr.tcf.provider directories. When I run my ant build
> in
> > debug mode, I get the following output:
> >
> > The ' characters around the executable and arguments are
> > not part of the command.
> > [java] Mapping module dependencies...
> > [java] Compressing file: ../release/dojo/tcf.js
> > [java] Files baked into this build:
> >
> > [java] dojo.js:
> > [java] dojoGuardStart.js
> > [java] ../src/bootstrap1.js
> > [java] ../src/loader.js
> > [java] dojoGuardEnd.js
> > [java] ../src/hostenv_browser.js
> > [java] ../src/lang/common.js
> > [java] ../src/lang/array.js
> > [java] ../src/lang/extras.js
> > [java] ../src/lang/func.js
> > [java] ../src/event/common.js
> > [java] ../src/event/topic.js
> > [java] ../src/event/browser.js
> > [java] ../src/event/__package__.js
> >
> > [java] tcf.js:
> > [java] ../__package__.js
> >
> > Looks like the eventing pieces are being inserted into dojo.js, but I
> > end up with a tcf.js file which is 1KB in size and has none of my
> custom
> > code in it.
> >
> > Where should I place my code so that the dojo build can pick it up and
> > generate a tcf.js file which contains everything?
> >
> > Hope someone can help
> >
> > Sean
> >
> > PS. I was using the 0.9 build of dojo and was able to get this working
> > with the following profile.js file:
> >
> > dependencies = {
> > layers: [
> > {
> > name: "../tcf.js",
> > layerDependencies: [
> > "dojo.js"
> > ],
> > dependencies: [
> > "fmr.tcf",
> > "fmr.tcf.core",
> > "fmr.tcf.provider"
> > ]
> > }
> > ],
> >
> > prefixes: [
> > [ "tcf", "../fmr" ]
> > ]
> > }
> >
> > I had to back out of the 0.9 build of dojo though (which looks really
> > good btw) because the FilteringTable isn't ready just yet ...
> > _______________________________________________
> > FAQ: http://dojotoolkit.org/support/faq
> > Book: http://dojotoolkit.org/docs/book
> > Forums: http://dojotoolkit.org/forum
> > [email protected: Dojo-int...@dojotoolkit.org]
> > http://dojotoolkit.org/mailman/listinfo/dojo-interest
> >
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> [email protected: Dojo-int...@dojotoolkit.org]
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
> _______________________________________________
> FAQ: http://dojotoolkit.org/support/faq
> Book: http://dojotoolkit.org/docs/book
> Forums: http://dojotoolkit.org/forum
> [email protected: Dojo-int...@dojotoolkit.org]
> http://dojotoolkit.org/mailman/listinfo/dojo-interest
>
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://dojotoolkit.org/docs/book
Forums: http://dojotoolkit.org/forum
[email protected: Dojo-int...@dojotoolkit.org]
http://dojotoolkit.org/mailman/listinfo/dojo-interest