Skip to content

Commit

Permalink
chore(all): prepare release 0.8.7
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Feb 28, 2015
1 parent 96fa4e4 commit 87d51ed
Show file tree
Hide file tree
Showing 15 changed files with 508 additions and 46 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.8.6",
"version": "0.8.7",
"description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.",
"keywords": [
"aurelia",
Expand Down
93 changes: 89 additions & 4 deletions dist/amd/aurelia.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l

var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };

var LogManager = _aureliaLogging;
var Container = _aureliaDependencyInjection.Container;
var Loader = _aureliaLoader.Loader;
Expand All @@ -11,14 +13,14 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
var ViewSlot = _aureliaTemplating.ViewSlot;
var ResourceRegistry = _aureliaTemplating.ResourceRegistry;
var CompositionEngine = _aureliaTemplating.CompositionEngine;
var Animator = _aureliaTemplating.Animator;
var Plugins = _plugins.Plugins;


var logger = LogManager.getLogger("aurelia"),
slice = Array.prototype.slice;

if (!window.CustomEvent || typeof window.CustomEvent !== "function") {
var CustomEvent = function (event, params) {
var CustomEvent = function CustomEvent(event, params) {
var params = params || {
bubbles: false,
cancelable: false,
Expand All @@ -34,6 +36,17 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
window.CustomEvent = CustomEvent;
}

function preventActionlessFormSubmit() {
document.body.addEventListener("submit", function (evt) {
var target = evt.target;
var action = target.action;

if (target.tagName.toLowerCase() === "form" && !action) {
evt.preventDefault();
}
});
}

function loadResources(container, resourcesToLoad, appResources) {
var resourceCoordinator = container.get(ResourceCoordinator),
current;
Expand All @@ -54,8 +67,20 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
return next();
}

/**
* The framework core that provides the main Aurelia object.
*
* @class Aurelia
* @constructor
* @param {Loader} loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.
* @param {Container} container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.
* @param {ResourceRegistry} resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.
*/

var Aurelia = exports.Aurelia = (function () {
function Aurelia(loader, container, resources) {
_classCallCheck(this, Aurelia);

this.loader = loader || Loader.createDefaultLoader();
this.container = container || new Container();
this.resources = resources || new ResourceRegistry();
Expand All @@ -73,6 +98,16 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l

_prototypeProperties(Aurelia, null, {
withInstance: {

/**
* Adds an existing object to the framework's dependency injection container.
*
* @method withInstance
* @param {Class} type The object type of the dependency that the framework will inject.
* @param {Object} instance The existing instance of the dependency that the framework will inject.
* @return {Aurelia} Returns the current Aurelia instance.
*/

value: function withInstance(type, instance) {
this.container.registerInstance(type, instance);
return this;
Expand All @@ -81,6 +116,16 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
withSingleton: {

/**
* Adds a singleton to the framework's dependency injection container.
*
* @method withSingleton
* @param {Class} type The object type of the dependency that the framework will inject.
* @param {Object} implementation The constructor function of the dependency that the framework will inject.
* @return {Aurelia} Returns the current Aurelia instance.
*/

value: function withSingleton(type, implementation) {
this.container.registerSingleton(type, implementation);
return this;
Expand All @@ -89,6 +134,15 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
withResources: {

/**
* Adds a resource to be imported into the Aurelia framework.
*
* @method withResources
* @param {Object|Array} resources The constructor function(s) to use when the dependency needs to be instantiated.
* @return {Aurelia} Returns the current Aurelia instance.
*/

value: function withResources(resources) {
var toAdd = Array.isArray(resources) ? resources : slice.call(arguments);
toAdd.resourceManifestUrl = this.currentPluginId;
Expand All @@ -99,21 +153,38 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
start: {

/**
* Loads plugins, then resources, and then starts the Aurelia instance.
*
* @method start
* @return {Aurelia} Returns the started Aurelia instance.
*/

value: function start() {
var _this = this;

if (this.started) {
return Promise.resolve(this);
}

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

preventActionlessFormSubmit();

var resourcesToLoad = this.resourcesToLoad;
this.resourcesToLoad = [];

return this.use._process().then(function () {
if (!_this.container.hasHandler(BindingLanguage)) {
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
var message = "You must configure Aurelia with a BindingLanguage implementation.";
logger.error(message);
throw new Error(message);
}

if (!_this.container.hasHandler(Animator)) {
_this.withInstance(Animator, new Animator());
}

_this.resourcesToLoad = _this.resourcesToLoad.concat(resourcesToLoad);
Expand All @@ -130,8 +201,19 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
configurable: true
},
setRoot: {

/**
* Instantiates the root view-model and view and add them to the DOM.
*
* @method withSingleton
* @param {Object} root The root view-model to load upon bootstrap.
* @param {string|Object} applicationHost The DOM object that Aurelia will attach to.
* @return {Aurelia} Returns the current Aurelia instance.
*/

value: function setRoot(root, applicationHost) {
var _this = this;

var compositionEngine,
instruction = {};

Expand Down Expand Up @@ -167,5 +249,8 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l

return Aurelia;
})();
exports.__esModule = true;

Object.defineProperty(exports, "__esModule", {
value: true
});
});
13 changes: 11 additions & 2 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@ define(["exports", "./aurelia", "aurelia-dependency-injection", "aurelia-binding

var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };

var _defaults = function (obj, defaults) { for (var key in defaults) { if (obj[key] === undefined) { obj[key] = defaults[key]; } } return obj; };
var _defaults = function (obj, defaults) { var keys = Object.getOwnPropertyNames(defaults); for (var i = 0; i < keys.length; i++) { var key = keys[i]; var value = Object.getOwnPropertyDescriptor(defaults, key); if (value && value.configurable && obj[key] === undefined) { Object.defineProperty(obj, key, value); } } return obj; };

/**
* The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.
*
* @module framework
*/

exports.Aurelia = _aurelia.Aurelia;

_defaults(exports, _interopRequireWildcard(_aureliaDependencyInjection));

_defaults(exports, _interopRequireWildcard(_aureliaBinding));
Expand All @@ -20,5 +27,7 @@ define(["exports", "./aurelia", "aurelia-dependency-injection", "aurelia-binding

var TheLogManager = _aureliaLogging;
var LogManager = exports.LogManager = TheLogManager;
exports.__esModule = true;
Object.defineProperty(exports, "__esModule", {
value: true
});
});
61 changes: 56 additions & 5 deletions dist/amd/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a

var _prototypeProperties = function (child, staticProps, instanceProps) { if (staticProps) Object.defineProperties(child, staticProps); if (instanceProps) Object.defineProperties(child.prototype, instanceProps); };

var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };

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;

var baseUrl = info.moduleId.startsWith("./") ? undefined : "";
var baseUrl = info.moduleId.indexOf("./") === 0 ? undefined : "";

return loader.loadModule(info.moduleId, baseUrl).then(function (exportedValue) {
if ("install" in exportedValue) {
Expand All @@ -36,16 +37,46 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a
});
}

/**
* Manages loading and installing plugins.
*
* @class Plugins
* @constructor
* @param {Aurelia} aurelia An instance of Aurelia.
*/

var Plugins = exports.Plugins = (function () {
function Plugins(aurelia) {
_classCallCheck(this, Plugins);

this.aurelia = aurelia;
this.info = [];
this.processed = false;
}

_prototypeProperties(Plugins, null, {
plugin: {
value: function plugin(moduleId, config) {

/**
* Installs a plugin before Aurelia starts.
*
* @method plugin
* @param {moduleId} moduleId The ID of the module to install.
* @param {config} config The configuration for the specified module.
* @return {Plugins} Returns the current Plugins instance.
*/

value: (function (_plugin) {
var _pluginWrapper = function plugin(_x, _x2) {
return _plugin.apply(this, arguments);
};

_pluginWrapper.toString = function () {
return _plugin.toString();
};

return _pluginWrapper;
})(function (moduleId, config) {
var plugin = { moduleId: moduleId, config: config || {} };

if (this.processed) {
Expand All @@ -55,11 +86,19 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a
}

return this;
},
}),
writable: true,
configurable: true
},
es5: {

/**
* Installs special support for ES5 authoring.
*
* @method es5
* @return {Plugins} Returns the current Plugins instance.
*/

value: function es5() {
Function.prototype.computed = function (computedProperties) {
for (var key in computedProperties) {
Expand All @@ -75,6 +114,14 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a
configurable: true
},
atscript: {

/**
* Installs special support for AtScript authoring.
*
* @method atscript
* @return {Plugins} Returns the current Plugins instance.
*/

value: function atscript() {
this.aurelia.container.supportAtScript();
Metadata.configure.locator(function (fn) {
Expand All @@ -88,6 +135,7 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a
_process: {
value: function _process() {
var _this = this;

var aurelia = this.aurelia,
loader = aurelia.loader,
info = this.info,
Expand Down Expand Up @@ -115,5 +163,8 @@ define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _a

return Plugins;
})();
exports.__esModule = true;

Object.defineProperty(exports, "__esModule", {
value: true
});
});
Loading

0 comments on commit 87d51ed

Please sign in to comment.