86Re: Shared Import
- Oct 25, 2006Hi Levani,
Thanks for uploading the sample app, it made it much easier to find the
problem and test the fix.
I'm scheduling the next Ajile release for either the end ofOctober or
early November. That release will include this fix and any others
completed by that date. I need to be sure that the fix doesn't cause
regressions or new problems.
I'm glad you stumbled across this problem, it's an important one and I'm
happy to have been able to implement a solution.
If you're curious, the following is a detailed explanation of the
The problem occurs because some of the scripts used by your sample
idea as doing so at the very least will break the default behavior of
built-in ones and custom ones developed by you or third-parties. Most
importantl is that it affects objects that you may not mean or want to
have to affected.
My solution takes into account the possibility that Object.prototype may
have been modified and works around it. When tested with your sample the
fix alleviates the problem and no error is generated from the Ajile
Check the main site [ http://ajile.iskitz.com/ ] for news about the new
release. When it's ready I'll post an announcement on the blog and
possibly most-likely announce it in this group.
--- In email@example.com, "dlevancho" <dlevancho@...> wrote:
> --- In firstname.lastname@example.org, "iskitzdev" iskitzdev@ wrote:
> > Hi Levani,
> > Glad you've been able to integrate Ajile with your project. Sounds
> > like something interesting from the looks of your imports ;-)
> > You're a lucky fellow. The feature you're asking about was
> > in Ajile 0.5.5, but I replaced it with an alternate solution in the
> > 0.6+ releases.
> > I've just released Ajile 0.6.5 which reintroduces that feature,
> > why you're lucky :-) I refer to it as a shared auto-loader, so if
> > see that term in discussions that's what's being talked about.
> > So, here's how you to use the shared loader:
> > 1. Put [script ... src="com.iskitz.ajile.0.6.5.js"][/script]
> s> in your HTM files. (Replace [ and ] with < and > respectively)
> > 2. Put all the imports you mentioned in an index.js file in
> > the same directory where you store com.iskitz.ajile.0.6.5.js.
> > 3. That's it! Ajile will automatically load that index.js
> > everytime a page loads Ajile.
> > An alternate solution if you're already using per-page loaders (i.e.
> > an auto-loaded script for each page):
> > 1. Create a separate .js file (i.e. my.shared.importer.js).
> > 2. Place all of the imports you mentioned within the file.
> > 3. In every per-page .js you use, have a
> > Load ("my.shared.importer.js"); or
> > Import("my.shared.importer.*");
> > if you want it's path to be automatically resolved.
> > Some tips for using Ajile:
> > 1. The Ajile.USE_PATH and Ajile.USE_NAME packaging style indicators
> > have been deprecated since version 0.6 you can use quoted characters
> > that match your prefered packaging style instead. So for instance if
> > you chose to store your files within subdirectories as follows:
> > .../scripts/my/site/modules.js
> > you would import then as:
> > Import("my.site.modules.js, null, "/");
> > Ajile 0.6+ allows you to use any valid file system character as your
> > packaging style. You can name your file: "my,site,modules.js" or
> > "my-site-modules.js" or "my site modules.js" there are many options.
> > 2. The Ajile module's packaging style and location act as the
> > automatic defaults for all imported scripts that don't explicitly
> > specify their own packaging style or location. Basically Ajile will
> > default to loading imported scripts from the directory where Ajile
> > exists and use the packaging style used by Ajile. This means you can
> > eliminate a lot of typing out the packaging style if it's all the
> > so for instance with:
> > .../scripts/com/iskitz/ajile.0.6.5.js
> > .../scripts/com/yahoo/...
> > .../scripts/com/amostudio/...
> > you should be able to do:
> > Import ("com.yahoo.logger.logger");
> > Import ("com.amostudio.utils.json");
> > Good luck wth your project and let me know how it goes. I'm always
> > interested to hear the creative/mundane ways ajile is being used.
> > -Michael
> > --- In email@example.com, "dlevancho" <dlevancho@> wrote:
> > >
> > > Hi, after successfuly integrating Ajile in my project I have small
> > > problem that I try to find a best approach to, say I have 5 pages
> > > all use YAHOO UI library , now instead of duing duplicate impots
> > > each page's .js file is there another sugegstive way to say have
> > > shared import file that will import all libraries that are used in
> > > every page?
> > > currenty I have something like that
> > >
> > > Import ("com.yahoo.yahoo.yahoo", null, Ajile.USE_PATH);
> > > Import ("com.yahoo.event.event", null, Ajile.USE_PATH);
> > > Import ("com.yahoo.dom.dom", null, Ajile.USE_PATH);
> > > Import ("com.yahoo.dragdrop.dragdrop", null, Ajile.USE_PATH);
> > > Import ("com.yahoo.animation.animation", null, Ajile.USE_PATH);
> > > Import ("com.yahoo.connection.connection", null, Ajile.USE_PATH);
> > > Import ("com.yahoo.container.container-min", null,
> > > Import ("com.yahoo.logger.logger", null, Ajile.USE_PATH);
> > >
> > >
> > > Import ("com.amostudio.utils.json", null, Ajile.USE_PATH);
> > > Import ("com.amostudio.validation.Verifiers", null,
> > > Import ("com.amostudio.core.IObject", null, Ajile.USE_PATH);
> > > Import ("com.amostudio.core.Extends", null, Ajile.USE_PATH);
> > > Import ("com.amostudio.core.controllers.BaseController", null,
> > > Ajile.USE_PATH);
> > > Import ("com.amostudio.collections.Vector", null, Ajile.USE_PATH)
> > > Import ("com.amostudio.core.portbox_Base", null, Ajile.USE_PATH);
> > >
> > >
> > > I want to put 75% of those in one shared file,
> > > thanks in advace for suggfestions
> > > Best Regards,
> > > Levani.
> > >
> Thanks for quick reply, I did download and updated but as soon as I
> change from 6.2 to 6.5 not even moving the imports I see
> "dependencies.getAll is not a function" error in firebug, everything
> still works.
[Non-text portions of this message have been removed]
- << Previous post in topic