Posts Tagged ‘module’


ADC & Appliness – Dependency Management with RequireJS

10.23.2012

As if you haven’t had enough dependency management bi’niss from my recent Slides – Dependency Management with RequireJS and JavaScript Architecture: RequireJS Dependency Management posts, here’s similar material I’ve authored through other outlets:

Adobe Developer Connection: Dependency Management with RequireJS
Appliness: Dependency Management with RequireJS


Slides – Dependency Management with RequireJS

10.22.2012

Presented at 360|Min 2012 in Las Vegas, NV.


JavaScript Architecture: RequireJS Dependency Management

03.20.2012

Updated Aug 11, 2012 to reflect current library versions.

In JavaScript Architecture: Organization and Quality, we discussed the importance of breaking apps down into very small, decoupled pieces following the single responsibility principle. Small pieces are generally easier to comprehend than a mess of large peices.

Some devs coming from other languages feel like they can only build a few large, spaghetti JavaScript files for their app. I tend to think this may be caused by three reasons:

  • That’s the way JavaScript has been done in the past.
  • Loading many JavaScript files requires many HTTP requests resulting in longer load times.
  • Dependency management is hard in JavaScript.

Don’t stoop to these excuses. We can do better than that and today there are fantastic libraries and standards that can help us out. However, let’s see what the above problems mean. Continue reading »


Loading a Remote Module into a Local App

08.14.2009

At work, we deal a lot with loading modules residing on remote servers into our applications running locally.  By locally I mean from a local path on our hard drives (the default Flex Builder run/debug settings), not on a local web server instance (localhost).  Depending on what type of module we are loading, we would normally use one of Flex’s built-in functions to load modules:

// Loading a language resource module:
resourceManager.loadResourceModule('http://aaronhardy.com/en_US_ResourceModule.swf');
 
// Loading a style module (e.g., a compiled font swf):
StyleManager.loadStyleDeclarations("http://aaronhardy.com/fonts/Astroid.swf");
 
// Loading miscellaneous modules:
var moduleInfo:IModuleInfo = ModuleManager.getModule('http://aaronhardy.com/MyModule.swf');
moduleInfo.load();

But these methods of importing modules result in errors like the following:

Unable to load resource module from http://aaronhardy.com/en_US_ResourceModule.swf
Error: Unable to load style(SWF is not a loadable module): http://aaronhardy.com/fonts/Astroid.swf.

Continue reading »


Loading a Remote Style SWF

04.14.2009

This post has been replaced by Loading a Remote Module into a Local App. Enjoy!