AnnoLoader beta release
Posted: Mon Jan 17, 2011 11:53 am
http://code.google.com/p/annoloader/sou ... nnoLoader/
The problem
I have a lot of JS and CSS files needed to be loaded in a specific order based on their dependencies. I.e. an Ext.ex.grid.Panel extends the Ext.grid.Panel, so I need to load Ext.grid.Panel.js prior Ext.ex.grid.Panel.js in my HTML page. I have similar problems with CSS files - "overriding" styles should be loaded after the "original" ones.
The solution
I use PhpDoc like annotations in files that have some requirements. E.g.:
Ext.ex.grid.Panel.js
In general I may have:
Aliases:
Critique needed on
1. PhpUnit tests applied (AnnoLoader_Dependency_Builder_ListTest needs more testing, but I'm not sure I do it right)
2. Patterns used
3. Decoupling
TODO
More complex caching
Thank's !!!
The problem
I have a lot of JS and CSS files needed to be loaded in a specific order based on their dependencies. I.e. an Ext.ex.grid.Panel extends the Ext.grid.Panel, so I need to load Ext.grid.Panel.js prior Ext.ex.grid.Panel.js in my HTML page. I have similar problems with CSS files - "overriding" styles should be loaded after the "original" ones.
The solution
I use PhpDoc like annotations in files that have some requirements. E.g.:
Ext.ex.grid.Panel.js
Code: Select all
/**
* @annoloader-requires-file /Ext/grid/Panel.js
*/Code: Select all
/**
*
* @annoloader-requires-file 1.js
* @annoloader-requires-file 2.js
*
* @annoloader-requires-class Ext.Namespace.Class1
* @annoloader-requires-class Ext.Namespace.Class2
*
* @annoloader-requires-namespace Ext.Namespace
*
* @annoloader-requires-directory ex/grid
*
* @annoloader-requires-directory-tree ex/data
*
*/Code: Select all
/**
* the same as annoloader-requires-file
* @annoloader-after-file /Ext/grid/Panel.css
*/1. PhpUnit tests applied (AnnoLoader_Dependency_Builder_ListTest needs more testing, but I'm not sure I do it right)
2. Patterns used
3. Decoupling
TODO
More complex caching
Thank's !!!