Project Manager Interface

To access the  project manager interface (PMI), in your browser, go to the “localhost/<the directory housing structureJS>/pmi/structure-pm.html”

There are two purposes to the PMI:

  1. Create a minified version of you app’s Javascript code
  2. Combine a declared group’s modules into a single, correctly ordered file

The idea behind point #1 is that, for performance reasons, you really should having structureJS loading up files/modules every time a user requests your site. It is much more efficient to combine you Javascript code in to a single file. Instead of  HTTP requests to get all the separate files of your app, the Javascript code is loaded up with one HTTP request.

When minifying and combining a project, structureJS maintains the script order your defined in the project’s manifest so much of the code structureJS uses to laod your project is no longer needed and structreJS is smart enough to remove the core modules responsible for dependency resolution, compression, and project exportation. What you are left with is 3kB of the core.

The ability to combine groups into a single file is designed to improve code reuse. For example, if you have a grouping of modules/files you use to detect DOM events like key presses and mouse movement, you may find yourself using that group in a lot of projects that are heavy on user interaction.

In this case, you wouldn’t want to add all of the code necessary to declare that dOM grouping every place you use the group. It would be much easier if the files/modules of that group were in a single file you called “DOM.js” and whenever you wanted to use it in a project you would just declare  “DOM.js” in the project manifest. This will improve  the clarity of the manifest by reducing the amount of code needed.

 

Lastly, the PMI lets you save project details so you don’t have to re-type a project’s base directory and other fields the PMI needs to correctly operate on a given project. Also if you have multiple projects that are using structureJS, you are able to quickly create deployment versions by loading the save projects into the PMI.

Leave a comment