Skip to content
ajkochanowicz edited this page Oct 24, 2012 · 3 revisions

Config.ks will eventually be deprecated in favor of the more universal, json formatted convention for package management, package.json

We'll closely be following projects like Bower Ender, and Require.js to maintain consistency.

Currently, config.ks offers just two lines of resources for any package, "required" and "dependent." This simply means any dependent resources should wait until the required resources have loaded first.

Using JSON will allow us to define resources in a smarter syntax as well as allow users to define dependencies of dependencies.

{
  'master resource': {
    'resource1',
    'resource2': {
      'dependent on resource2',
      'also dependent on resource2'
    }
  }
}

Looking at Bower.js, which does not need to define resources in this hierarchy, only an array (main) is offerred.

{
  "name": "myProject",
  "version": "1.0.0",
  "main": ["./path/to/app.css", "./path/to/app.js", "./path/to/runlast.js"],
  "dependencies": {
    "jquery": "~1.7.2"
  }
}

It would make sense to define resources in way that does not break compatibility withe libraries like Bower. Also, many Kickstrap apps don't need the dependent line. However, if it does, there ought to be a "triaged" object.

{
  "name": "myProject",
  "version": "1.0.0",
  "main": ["./path/to/app.css", "./path/to/app.js", "./path/to/runlast.js"],
  "triage": {
    "./path/to/app.css",
    "./path/to/app.js" : {
      "./path/to/runlast.js"
    }
  }
  "dependencies": {
    "jquery": "~1.7.2"
  }
}

Kickstrap can now look for the triage object. If it does not exist, it will use main instead. This offers the possibility for projects including package.json to accidentally work! If not, the author can simply add the triage object to package.json.

or...

It appears require.js is the closest thing to what kickstrap.js is trying to do, and it may make more sense to just use the thing. More on that later.

In its first attempt, Kickstrap will likely continue to be limited to only two tiers...required and dependent. However, switching to package.json as early as possible means app developers can start writing future-proofed apps before that functionality is available.

Clone this wiki locally