FEATURE: Scheme loading via metadata.json


#1

Hi All,

Today I pushed some changes that will allow you to load your scheme.html file via metadata.json. This reduces the size of your application a tiny bit and make loading times feel a bit snappier :smile:

Old Code

main.js

  MyApplication.prototype.init = function(settings, metadata) {
    Application.prototype.init.apply(this, arguments);

    var self = this;
    this._loadScheme('./scheme.html', function(scheme) {
      self._addWindow(new MyWindow(self, metadata, scheme));
    });
  };

New Code

main.js

  MyApplication.prototype.init = function(settings, metadata, scheme) { // <- injected here :)
    Application.prototype.init.apply(this, arguments);
    this._addWindow(new MyWindow(this, metadata, scheme));
  };


metadata.json

{
  "preload": ["main.js", "main.css", {"src": "scheme.html", "type": "scheme"}]
}

UPDATE: Version bump - alpha80