[Dojo-interest] Packaging
Daniel
daniel.carrera at zmsl.com
Fri Dec 21 22:29:32 UTC 2007
James Burke wrote:
> However, feel free to open an enhancement
> ticket in trac if you think it is useful.
I wonder if others would find this useful. How much do people care about
saving on 1 or 2 HTTP requests? I'm interested, but I doubt I'm typical.
> I think you can fake it today by manually injecting the i18n bundle
> contents in your layer file but do it right before the
> dojo._preloadLocalizations call that is near the end of the layer
> file.
I might try that tomorrow. I got as far as putting it *instead* of
dojo._preloadLocalizations, but that gave me some other bugs. I got some
very strange bugs which showed in dojo.js but were actually caused by my
attempts to join together layer-A.js and the translation.
> You can combine dojo.js and layer-A.js into one file by renaming the
> first layer in your build to "dojo.js" and putting the layer-A
> dependencies in that layer.
Interesting. How come it has to be named dojo.js?
I tried joining together dojo.js and layer-A.js but then it couldn't
find the translation file. It was weird, it was looking for the file in
the directory 'dojo/undefined/nls...' or some such. So clearly some
variable became undefined by joining the two files together.
So... before I try to join dojo.js with my later I must first make sure
I can add the translation to the layer.
Oh, and what if someone with a different locale uses my application?
Does that mean that the app will break in other locales? In my ideal
world, I would pack the locales en-us and en-gb only, as that would
cover nearly all my users. And the other 1% of users would just get two
extra HTTP requests. But I can't have the app break when someone in
Poland decides to use it.
> but if you want to cut down on
> the requests and you are not exporting code out for others then you
> can build your stuff in with dojo.js.
Not exporting for others at all.
Thanks for the help. I learned a few interesting things here.
Cheers,
Daniel.
More information about the Dojo-interest
mailing list