Making “combo” files

I’m working on a way to package up a set of files to load on demand. It turns out this is has a significant impact on the build process I started working on yesterday.

Even though my web page is just getting started, I noticed I was  pulling in over 20 files. Every features of YUI has its own JS file and sometimes a CSS file as well. Plus my own JS and CSS files, plus all the images and the page itself.

As I develop, I find it much easier to work on each ‘area’ individually. These are generally DIVs on the web page and turn out to be like little individual pieces. Each one has a JS file, a CSS file, a Template and also may pull in any number of external files (images, YUI components, etc.).

So, I spent some time and made a Loader in JavaScript. It can pull in 0-n JS, 0-n CSS and 0-n templates (images would be inside the template) and o-n set of data (generally AJAX calls). It has a standard set of methods like init, open, close, etc.

Now, I can have a button click open a dialog-box, for example, that is not even loaded yet. It makes a call to the Loader, pulls in all the files, initializes and then opens.

So far so good. Except, now I have tons of little tiny files which really should be combined. Back to the build process: I’m not trying to figure out how to integrate the knowledge of these Packages with the Build, so that it can make Combo files.

Advertisements

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: