Thursday, June 08, 2006

Ajile 0.5 Released!

Download Ajile 0.5 here!

This release includes the following changes:
  • Now supports Opera 7.54+.
  • Simplified use via new shared auto-loader (index.js).
  • Faster importing with no window.onload dependency.
  • Automatic runtime source code cloaking.
  • Improved debug logging via enhanced window.alert() function.
  • Debug log viewing via new Ajile.ShowLog() function.
  • Memory management via new Ajile.Unload() function.
  • Renamed Ajile.DOT_NAMESPACE property to Ajile.USE_NAME.
  • Renamed Ajile.DIR_NAMESPACE property to Ajile.USE_PATH.
  • Backwards compatability for renamed properties.
The new index.js shared auto-loader simplifies use by making the com.iskitz.ajile.<version>.js script file the only one that needs to be specified in the web page. All other script/module dependencies can be defined within the file without modifying the web page, great for MVC implementations!.

Download the new release and try it!

21 Comments:

At Thursday, June 8, 2006 12:37:00 PM EDT , Anonymous thomas said...

Hello Michael,
I was just trying out the 0.5 version of your Ajile library. Very nice work but I'm having a few problems trying to get it to work.

I got an error with the new version btw
Some uncaught exception when I tried to use it.
Narrowed it down to the following line:-
container.removeChild(modules[i])
I just commented that line off for now.


I will explain what I did, maybe I just dont know how to set this up properly and hope you can provide me with some pointers.

-------------------------------
1. I copied the file in the lib directory of your app (com.iskitz.ajile.0.5.js and index.js) and put it under "ajile" dir under my app. I commented off the Import(example) command in the index.js file.

2. I have a dir called "widgets" undex my app and in it I have a file called v.widgets.SelectContainer.js which looks like:-
Package ("v.widgets");
v.widgets.SelectContainer =
{
moveUp: function ()
{
/*code*/
}
,moveDown: function ()
{
/*code*/
}
}

3. Now in my html page I have:-
script src=" http://localhost/appname/ajile/com.iskitz.ajile.0.5.js" type="text/javascript">/script>
script type="text/javascript">
Import("v.widgets.SelectContainer"," http://localhost/appname/widgets/v.widgets.SelectContainer.js",Ajile.USE_NAME);
/script>
input onClick="SelectContainer.moveUp ();" type="button" value="up">
-------------------------------

The above gives my a js error when html page is loaded into browser:-
RE_PARENT_NAMESPACE.exec(_parentNsID) has no properties com.iskitz.ajile.... (line 59)
Happens in the do while loop in ImportAs function

I'm not sure why this happens.

Now If i do this instead:-
Load("widgets/v.widgets.SelectContainer.js");
Import("v.widgets.SelectContainer");

Then it functions properly. But I'm not sure if thats the proper usage . Are you supposed to issue the Load command before Import? Isn't Import supposed to automatically load the widgets/v.widgets.SelectContainer.js file if I provide the location?

Any help is appreciated.
Thanks

 
At Thursday, June 8, 2006 6:35:00 PM EDT , Blogger Mike (i.Skitz) said...

Hi Thomas,
Glad you're trying out the new version. So, I've read your problem description and believe I see the reason.

When Importing you don't need to specify the full path, in fact you shouldn't. Specifying the module's directory is all that's needed.

Ajile automatically determines the actual filename using the first parameter "v.widgets.SelectContainer" and the naming style you specify, or the default Ajile.USE_NAME.

So instead of:
Import("v.widgets.SelectContainer"
,"http://localhost/appname/widgets/v.widgets.SelectContainer.js" ,Ajile.USE_NAME);

You should do:
Import("v.widgets.SelectContainer"
,"http://localhost/appname/widgets/");

The last parameter: Ajile.USE_NAME should'nt be necessary since it's the default and your module is already using name style packaging (i.e. v.widgets.SelectContainer.js)

Let me know if that works. The Help docs at ajile.iskitz.com/docs/ and in the download should provide good information about the parameters and their expected values.

Also, there is no need to do a Load before doing an Import or ImportAs.

Happy Coding!

 
At Friday, June 9, 2006 9:14:00 AM EDT , Anonymous Thomas said...

Thanks for the reply Mike, but unfortunately that didn't work either. I am getting the same errors with

Import("v.widgets.SelectContainer"
,"http://localhost/appname/widgets/");

I even tried putting v.widgets.SelectContainer.js in the same dir and the ajile files and just using
Import("v.widgets.SelectContainer");
Same errors still though :(

 
At Friday, June 9, 2006 10:06:00 AM EDT , Anonymous Thomas said...

Hey Mike, I made zip of my test files for Ajile.
If you have the time to take a look at it , its much appreciated.

http://www.autonode.ca/ajile_test.zip

Thanks.

 
At Monday, June 12, 2006 12:56:00 AM EDT , Blogger Mike (i.Skitz) said...

Hi Thomas,
I´m trekking in Peru for the next few weeks. I´ll try to take a look at your code when I get back. If I have time, I might even do something while here, but no promises :-)

 
At Monday, June 12, 2006 12:09:00 PM EDT , Anonymous Thomas said...

np Mike, have fun.

 
At Tuesday, July 11, 2006 4:27:00 AM EDT , Blogger Mike (i.Skitz) said...

Hey Thomas,
I'm back from my trip. Not sure if you're checking this thread, but I just made a new release that corrects some bugs and makes some improvements.

Thanks for the zip, I was able to reproduce the problem you reported at line 59. It was caused by a bug that I've since fixed in Ajile 0.5.5.

I wasn't able to reproduce the other exception you mentioned, what's your environment (e.g. browser & platform)?.

Using your ajile_test code and following the steps in this post's 2nd comment I was able to get your code working with Ajile 0.5.5.

Let me know if you have any problems with the new release.

-Mike

 
At Tuesday, July 11, 2006 9:45:00 AM EDT , Anonymous Thomas said...

Heyya Mike, WB, hope you had a good time.

I tested the new version (0.5.5) and it seems to be working now for the most part.

That line59 exception still pops on certain instances.
It took me a while to figure out why but I think this is whats happening:-

If you have the script tag to include Ajile AND the Import statement within the html head tag, then all is well and works as intended.

If you have either one of them outside the head tag ie inside html body tag then the exceptions get thrown. However the js code still works.

I have included my test file again with the problems:-
http://www.autonode.ca/ajile_test_exceptions.zip

ajile_test.html - works OK
ajile_test_exception1.html - throws 2 line59 exceptions after load. the imported js code functions nevertheless.
ajile_test_exception1.html - throws 3 line59 exceptions

My working env is Win2KPro
The problem happens in both IE 6 and Firefox 1.5

 
At Tuesday, July 11, 2006 11:14:00 AM EDT , Anonymous thomas said...

oops forgot to include the error:-

uncaught exception: [Exception... "Node was not found" code: "8" nsresult: "0x80530008 (NS_ERROR_DOM_NOT_FOUND_ERR)" location: "file:///C:/ajile_test/lib/Ajile/com.iskitz.ajile.0.5.5.js Line: 59"]

 
At Wednesday, July 12, 2006 4:40:00 AM EDT , Blogger Mike (i.Skitz) said...

Nice find Thomas! You're quick.

I know the cause of the problem, it was a silly mistake on my side, duh. I guess this is precisely why sometimes 2 minds are better than 1 :-)

I've made the fix and re-released Ajile 0.5.5, so please download and retry it.

Thanks for taking the time to put together samples that demonstrate the problem. Would you like to help out with testing? I didn't see this problem during development because I'm used to using Ajile in a few specific ways. I need to create better test cases, so I'll catch these earlier. Let me know.

 
At Wednesday, July 12, 2006 4:49:00 AM EDT , Blogger Mike (i.Skitz) said...

FYI:

I noticed that you didn't use index.js in your test samples, was that on purpose?

Did you know that you could move the v.widgets.SelectContainer Import to index.js?

Actually, the only script that needs to be in the HTML page is the Ajile script tag. The beauty of the index.js file is that it helps you (the developer) to separate the HTML from the JavaScript by acting as a generic script container.

The main purpose of index.js is to help decouple HTML design from JavaScript logic. As a result, it makes it easier to debug your JavaScript code.

Have you looked at the Examples in the new release? I try to show some of the less obvious approaches and uses of Ajile, like the index.js file and wildcard imports. I'm interested to know which features are really needed/wanted/liked and which need to be improved...

 
At Wednesday, July 12, 2006 4:31:00 PM EDT , Anonymous Thomas said...

I downloaded 0.5.5 again and it is all working now. Nice work Mike.

I'm probably just as guilty as you for using the library in only a specific way so hopefully others will try it out and post their problems(if any) so you can get it resolved. But yea if I find something wrong, I'll let you know.

Yes I did look at the Examples directory. I'm sure I'll have more questions for you once I start using all the features.

About the index.js file. I didn't use it because most of the stuff I want to import would be based on some server logic so thats why I usually issue the import within the php template file (The MVC is done in the php, in my case). So sometimes I may only want to import some of the widgets based on some logic on the server end. Or maybe I'm missing something here and theres another way...

Anyways, Thanks for all your help Mike.

 
At Thursday, July 13, 2006 8:56:00 AM EDT , Blogger Mike (i.Skitz) said...

Thanks for the feedback. It helped to see some of the different ways Ajile is used.

The index.js may not be ideal for the situation you described, but I'm working on a variation of it that should make it easy to define per page/screen JavaScript templates (modules) that import/load common/base modules/widgets.

Within your web-based application, templates could be associated with individual screens, themes, or user profiles. Your PHP would simply include the template that it needed for a specific page...

It's a work in progress :-)

 
At Thursday, July 13, 2006 11:42:00 AM EDT , Anonymous Thomas said...

:( I'm running into another issue now.

The library seems to hang in IE. It might have something to do with the fix that you did regarding the html body and head tag

You can check the issue here :-
http://autonode.ca/ajile_ie1.html

The url loads fine in firefox but in IE it just stalls. But you can still "view source" in IE and the entire page's source code is there. Hopefully its something simple.

 
At Friday, July 14, 2006 5:23:00 AM EDT , Blogger Mike (i.Skitz) said...

Ahh... It never ends :-)

I've been without a functional IE debugger for a while now and it's apparently taken its toll...

Ok so I've found and fixed the problem and re-released 0.5.5. Hopefully that's it for 0.5.5 fixes.

Thanks for the heads up.

 
At Friday, July 14, 2006 9:55:00 AM EDT , Anonymous Thomas said...

Looking good now Mike. Thanks for the quick fix.

 
At Saturday, July 15, 2006 5:09:00 AM EDT , Blogger Mike (i.Skitz) said...

No problem Thomas. If you manage to create something that uses Ajile I'd really like to see it and possibly reference it, if that's ok with you.

 
At Saturday, July 15, 2006 7:02:00 PM EDT , Blogger Mike (i.Skitz) said...

Hey Thomas,
If you check back here, take a look at Ajile's Support Group at: http://groups.yahoo.com/group/ajile/.

I'm the groups moderator so you can count on the same or better Ajile support.

Cheers,
Mike

 
At Monday, July 17, 2006 10:07:00 AM EDT , Anonymous Thomas said...

Mike, right now im using it for some small and very specific "work" related stuff so I cant really release that in the open. But if I make something generic later on, I will definitely post back. Thanks for the link to the support group as well.

 
At Monday, July 17, 2006 8:48:00 PM EDT , Blogger Mike (i.Skitz) said...

FYI to All:

Ajile 0.5 is no longer available for download. All links have been updated to point to the Ajile 0.5.5 release.

Ajile 0.5.5 contains most of the functionality present in 0.5 and addresses problems discovered in the 0.5 release.

 
At Tuesday, August 1, 2006 10:51:00 AM EDT , Anonymous thomas said...

Hey Mike, ran into another issue:-

Basically same setup based on widgets as before. I have
script type="text/javascript"
Import("v.widgets.SelectContainer","path/");
/script

Once i import that I do
script type="text/javascript"
SelectContainer.testhash = {h:1,h:2}
/script

The above works ok in FF but in IE it errors out saying SelectContainer is not defined.

If i use the complete name then it works in IE. But after you import it , you should be able to use the imported name correct?

I can put up a sample if you need to see the code.

 

Post a Comment

Links to this post:

Create a Link

<< Home