Skip to content

Commit

Permalink
chore(all): prepare release 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jan 22, 2015
1 parent b52b1b0 commit c2f779b
Show file tree
Hide file tree
Showing 13 changed files with 379 additions and 107 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-framework",
"version": "0.7.0",
"version": "0.8.0",
"description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.",
"keywords": [
"aurelia",
Expand Down
46 changes: 25 additions & 21 deletions dist/amd/aurelia.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,9 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
slice = Array.prototype.slice;

function loadResources(container, resourcesToLoad, appResources) {
var resourceCoordinator = container.get(ResourceCoordinator), current;

function next() {
var next = function () {
if (current = resourcesToLoad.shift()) {
return resourceCoordinator.importResources(current).then(function (resources) {
return resourceCoordinator.importResources(current, current.resourceManifestUrl).then(function (resources) {
resources.forEach(function (x) {
return x.register(appResources);
});
Expand All @@ -34,7 +32,10 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
}

return Promise.resolve();
}
};

var resourceCoordinator = container.get(ResourceCoordinator),
current;

return next();
}
Expand All @@ -45,7 +46,11 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
this.container = container || new Container();
this.resources = resources || new ResourceRegistry();
this.resourcesToLoad = [];
this.plugins = new Plugins(this);
this.use = new Plugins(this);

if (!this.resources.baseResourcePath) {
this.resources.baseResourcePath = System.baseUrl || "";
}

this.withInstance(Aurelia, this);
this.withInstance(Loader, this.loader);
Expand All @@ -54,7 +59,7 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l

_prototypeProperties(Aurelia, null, {
withInstance: {
value: function (type, instance) {
value: function withInstance(type, instance) {
this.container.registerInstance(type, instance);
return this;
},
Expand All @@ -63,7 +68,7 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
withSingleton: {
value: function (type, implementation) {
value: function withSingleton(type, implementation) {
this.container.registerSingleton(type, implementation);
return this;
},
Expand All @@ -72,30 +77,27 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
withResources: {
value: function (resources) {
if (Array.isArray(resources)) {
this.resourcesToLoad.push(resources);
} else {
this.resourcesToLoad.push(slice.call(arguments));
}

value: function withResources(resources) {
var toAdd = Array.isArray(resources) ? resources : slice.call(arguments);
toAdd.resourceManifestUrl = this.currentPluginId;
this.resourcesToLoad.push(toAdd);
return this;
},
writable: true,
enumerable: true,
configurable: true
},
start: {
value: function () {
value: function start() {
var _this = this;
if (this.started) {
return;
return Promise.resolve(this);
}

this.started = true;
logger.info("Aurelia Starting");

return this.plugins.process().then(function () {
return this.use._process().then(function () {
if (!_this.container.hasHandler(BindingLanguage)) {
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
}
Expand All @@ -111,9 +113,10 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
setRoot: {
value: function (root, applicationHost) {
value: function setRoot(root, applicationHost) {
var _this2 = this;
var compositionEngine, instruction = {};
var compositionEngine,
instruction = {};

if (!applicationHost || typeof applicationHost == "string") {
this.host = document.getElementById(applicationHost || "applicationHost") || document.body;
Expand All @@ -126,8 +129,9 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l

compositionEngine = this.container.get(CompositionEngine);
instruction.viewModel = root;
instruction.viewSlot = new ViewSlot(this.host, true);
instruction.container = instruction.childContainer = this.container;
instruction.viewSlot = new ViewSlot(this.host, true);
instruction.viewSlot.transformChildNodesIntoView();

return compositionEngine.compose(instruction).then(function (root) {
_this2.root = root;
Expand Down
55 changes: 49 additions & 6 deletions dist/amd/plugins.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _aureliaLogging, _aureliaMetadata) {
"use strict";

var _prototypeProperties = function (child, staticProps, instanceProps) {
Expand All @@ -7,19 +7,23 @@ define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
};

var LogManager = _aureliaLogging;
var Metadata = _aureliaMetadata.Metadata;


var logger = LogManager.getLogger("aurelia");

function loadPlugin(aurelia, loader, info) {
logger.debug("Loading plugin " + info.moduleId + ".");

aurelia.currentPluginId = info.moduleId;

return loader.loadModule(info.moduleId, "").then(function (exportedValue) {
if ("install" in exportedValue) {
var result = exportedValue.install(aurelia, info.config || {});

if (result) {
return result.then(function () {
aurelia.currentPluginId = null;
logger.debug("Installed plugin " + info.moduleId + ".");
});
} else {
Expand All @@ -28,37 +32,76 @@ define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
} else {
logger.debug("Loaded plugin " + info.moduleId + ".");
}

aurelia.currentPluginId = null;
});
}

var Plugins = (function () {
function Plugins(aurelia) {
this.aurelia = aurelia;
this.info = [];
this.processed = false;
}

_prototypeProperties(Plugins, null, {
install: {
value: function (moduleId, config) {
this.info.push({ moduleId: moduleId, config: config });
plugin: {
value: function plugin(moduleId, config) {
var plugin = { moduleId: moduleId, config: config || {} };

if (this.processed) {
loadPlugin(this.aurelia, this.aurelia.loader, plugin);
} else {
this.info.push(plugin);
}

return this;
},
writable: true,
enumerable: true,
configurable: true
},
process: {
value: function () {
es5: {
value: function es5() {
Function.prototype.computed = function (computedProperties) {
for (var key in computedProperties) {
if (computedProperties.hasOwnProperty(key)) {
Object.defineProperty(this.prototype, key, { get: prop[key], enumerable: true });
}
}
};
},
writable: true,
enumerable: true,
configurable: true
},
atscript: {
value: function atscript() {
this.aurelia.container.supportAtScript();
Metadata.configure.location("annotate");
},
writable: true,
enumerable: true,
configurable: true
},
_process: {
value: function Process() {
var _this = this;
var aurelia = this.aurelia,
loader = aurelia.loader,
info = this.info,
current;

if (this.processed) {
return;
}

var next = function () {
if (current = info.shift()) {
return loadPlugin(aurelia, loader, current).then(next);
}

_this.processed = true;
return Promise.resolve();
};

Expand Down
46 changes: 25 additions & 21 deletions dist/commonjs/aurelia.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ var logger = LogManager.getLogger("aurelia"),
slice = Array.prototype.slice;

function loadResources(container, resourcesToLoad, appResources) {
var resourceCoordinator = container.get(ResourceCoordinator), current;

function next() {
var next = function () {
if (current = resourcesToLoad.shift()) {
return resourceCoordinator.importResources(current).then(function (resources) {
return resourceCoordinator.importResources(current, current.resourceManifestUrl).then(function (resources) {
resources.forEach(function (x) {
return x.register(appResources);
});
Expand All @@ -40,7 +38,10 @@ function loadResources(container, resourcesToLoad, appResources) {
}

return Promise.resolve();
}
};

var resourceCoordinator = container.get(ResourceCoordinator),
current;

return next();
}
Expand All @@ -51,7 +52,11 @@ var Aurelia = (function () {
this.container = container || new Container();
this.resources = resources || new ResourceRegistry();
this.resourcesToLoad = [];
this.plugins = new Plugins(this);
this.use = new Plugins(this);

if (!this.resources.baseResourcePath) {
this.resources.baseResourcePath = System.baseUrl || "";
}

this.withInstance(Aurelia, this);
this.withInstance(Loader, this.loader);
Expand All @@ -60,7 +65,7 @@ var Aurelia = (function () {

_prototypeProperties(Aurelia, null, {
withInstance: {
value: function (type, instance) {
value: function withInstance(type, instance) {
this.container.registerInstance(type, instance);
return this;
},
Expand All @@ -69,7 +74,7 @@ var Aurelia = (function () {
configurable: true
},
withSingleton: {
value: function (type, implementation) {
value: function withSingleton(type, implementation) {
this.container.registerSingleton(type, implementation);
return this;
},
Expand All @@ -78,30 +83,27 @@ var Aurelia = (function () {
configurable: true
},
withResources: {
value: function (resources) {
if (Array.isArray(resources)) {
this.resourcesToLoad.push(resources);
} else {
this.resourcesToLoad.push(slice.call(arguments));
}

value: function withResources(resources) {
var toAdd = Array.isArray(resources) ? resources : slice.call(arguments);
toAdd.resourceManifestUrl = this.currentPluginId;
this.resourcesToLoad.push(toAdd);
return this;
},
writable: true,
enumerable: true,
configurable: true
},
start: {
value: function () {
value: function start() {
var _this = this;
if (this.started) {
return;
return Promise.resolve(this);
}

this.started = true;
logger.info("Aurelia Starting");

return this.plugins.process().then(function () {
return this.use._process().then(function () {
if (!_this.container.hasHandler(BindingLanguage)) {
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
}
Expand All @@ -117,9 +119,10 @@ var Aurelia = (function () {
configurable: true
},
setRoot: {
value: function (root, applicationHost) {
value: function setRoot(root, applicationHost) {
var _this2 = this;
var compositionEngine, instruction = {};
var compositionEngine,
instruction = {};

if (!applicationHost || typeof applicationHost == "string") {
this.host = document.getElementById(applicationHost || "applicationHost") || document.body;
Expand All @@ -132,8 +135,9 @@ var Aurelia = (function () {

compositionEngine = this.container.get(CompositionEngine);
instruction.viewModel = root;
instruction.viewSlot = new ViewSlot(this.host, true);
instruction.container = instruction.childContainer = this.container;
instruction.viewSlot = new ViewSlot(this.host, true);
instruction.viewSlot.transformChildNodesIntoView();

return compositionEngine.compose(instruction).then(function (root) {
_this2.root = root;
Expand Down
Loading

0 comments on commit c2f779b

Please sign in to comment.