APE JavaScript Library Monday, 5 May 2008
Frustrated with every other JavaScript framework, I have decided to write something better.
Points
- Minimal Framework, mainly used for AOP and OOP functionality
- All code is tested using YUI Test (TDD)
- AOP Event System with asynchronous error handling
- Namespacing
- Modularity, Cohesion, Packaging
- No browser detection
- JSDoc
Here it is: APE JavaScript Library
Testing
By using a test driven approach, I was able to avoid problems that I found in other libraries.
APE Core
The core of APE is so small that the overhead of adding APE to a project is significantly less than that of other libraries.
I generally don't like a lot of the libraries that use a "GOD" object approach. These objects can be recognized by being undefinable by more than a few words. The approach is quite popular and annoys me to no end. How do you describe the dojo object, for example?
The APE object itself is defined in APE.js, providing only the most basic things that a framework would need: 1) Object creational features, and 2) a core namespace. Although some might argue that a library core needs more than that.
The APE object is only 3k minified and less than 1k gzipped. The size is not the point. The point is that APE is not a kitchen-sink, or God object.
Help Wanted
You can join, too! Here's what APE needs:
New Features
There is much more that can be added. For example, some ADT's: Resizable (croppers, windows), FormSerializer.
SVN and Bugzilla
I still need to add hosted SVN to the directories and install bugzilla.
Performance Tests
I've always been big on performance, and not just for JavaScript but all areas of life, and I am very competitive in nature.
APE needs benchmarks to compare with other libraries. This will provide useful analysis for other library authors who aspire to have code that is as performant as that in APE.
Anyone interested in joining this project contact dhtmlkitchen - at - gmail - dot - com.
Technorati Tags: JavaScript Testing APE
It's tested in
* Firefox 2
* Safari 2/3 Mac and Windows (a couple tests in DOM fail)
* IE6 and IE7
* Opera 9, partially
Opera 9 seems to have a pretty serious bug -- Opera has a lot of serious bugs -- but the serious bug I'm talking about is with creating events. Method - initMouseEvent - seems to just die, and this can be seen here:
http://dhtmlkitchen.com/ape/test/tests/drag/Draggable-test.html
I filed a bug on YUI Test. I couldn't figure out a quick workaround and it doesn't seem to be fixed yet.
http://sourceforge.net/tracker/index.php?func=detail&aid=1923420&group_id=165715&atid=836476
I'm interested in finding more bugs, but I really need to get that bugtracker up and running.
Just wanted to add that the Opera bug is related to the tests.
Some tests can't run in Opera, including the drag and drop. The code that is being tested actually seems to work in Opera, but the test fails because the testrunner triggers an Opera bug.
Garrett,
I see that you are using Object.prototype.hasOwnProperty extensively. Isn't it unsupported in Safari <2.0.2?
True.
http://webkit.org/blog/32/webkit-fixes-in-safari-202-mac-os-x-1043/
That would mean that a good portion of the library would fail in Safari < 2.0.2.


AnimTree
Looks really good.
Would you clarify which browsers are supported?