Organizing Deeper History Using structureJS
I am a manic creator. I get an idea. Usually in the shower, the bathroom, or in bed and at the next chance I start working furiously on it until I reach a state where I feel the idea has become a reality. Some ideas, like Deeper History, are actually worth continuing to work on.
But when the mania is gone it becomes hard to pick my instrument (keyboard) back up-at least until my next creative surge. Well I’m in one now and DH has benefited greatly.
In the beginning, I work on pure creative adrenaline. “Quick & Dirty” is the best way to describe the syntactic results of such an endeavor. If the project is worthy, eventually I need to smooth out those rough edges. This is called refactoring, and boy and girls it is NO FUN.
One of my big problems with DH is that it was broken up into a # of files using a project I made called MMCD. While I had good intentions with MMCD, it turned out to be bloated and, most importantly, stood in the way of minification – something the growing DH is desperately in need of.
So in my infinite wisdom I decided to remake MMCD into something that didn’t suck and I think I succeeded. Taking all of the lessons of MMCD I managed to make something I am most proud of. It’s called structureJS. It does the following:
- Break your app up into seperate files.
- Create reusable, configurable modules.
- Declare the structure of the app in any order and structureJS will resolve order dependency automatically.
- Minify and combine all modules and files into a single file right from your browser.
- Utilize module dependencies easily and add semantic meaning to your modules
- Only puts one variable into the global namespace
- Partially AMD compliant (works with jQuery AMD for now, more to come)
Anyways, now DH is properly organized and minified. I am still working out some things with the massive new update in the pipeline so it’s probably going to be another couple of weeks before releasing DH. Anyways, I just wanted to share structureJS and a couple of thougts with you. Cheers!