From ba385b97a1d671f344e929c40037f7369d645570 Mon Sep 17 00:00:00 2001 From: Constantin Rack Date: Thu, 1 Oct 2015 09:28:03 +0200 Subject: [PATCH 001/549] doc: add link to Twitter --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c07c1c7d..fc86c49f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This library is part of the [Aurelia](http://www.aurelia.io/) platform and contains the aurelia framework which brings together all the required core aurelia libraries into a ready-to-go application-building platform. -> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards). +> To keep up to date on [Aurelia](http://www.aurelia.io/), please visit and subscribe to [the official blog](http://blog.durandal.io/) or follow [@AureliaEffect on Twitter](https://twitter.com/AureliaEffect). If you have questions, we invite you to [join us on Gitter](https://gitter.im/aurelia/discuss). If you would like to have deeper insight into our development process, please install the [ZenHub](https://zenhub.io) Chrome Extension and visit any of our repository's boards. You can get an overview of all Aurelia work by visiting [the framework board](https://github.com/aurelia/framework#boards). ## Dependencies From 4bc75161d39696e0db11582dea8c4693d0852869 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Sat, 10 Oct 2015 11:21:13 -0400 Subject: [PATCH 002/549] feat(all): incorporate pal --- config.js | 5 ++++ package.json | 2 ++ src/aurelia.js | 45 ++++++++++++--------------------- src/framework-configuration.js | 2 +- test/aurelia.spec.js | 32 ++++++++--------------- test/framework-configuration.js | 13 +++++++--- 6 files changed, 44 insertions(+), 55 deletions(-) diff --git a/config.js b/config.js index d24f3d63..36bc1e61 100644 --- a/config.js +++ b/config.js @@ -19,6 +19,8 @@ System.config({ "aurelia-loader": "github:aurelia/loader@0.9.0", "aurelia-logging": "github:aurelia/logging@0.7.0", "aurelia-metadata": "github:aurelia/metadata@0.8.0", + "aurelia-pal": "github:aurelia/pal@0.1.10", + "aurelia-pal-browser": "github:aurelia/pal-browser@0.1.13", "aurelia-path": "github:aurelia/path@0.9.0", "aurelia-task-queue": "github:aurelia/task-queue@0.7.0", "aurelia-templating": "github:aurelia/templating@0.15.0", @@ -45,6 +47,9 @@ System.config({ "github:aurelia/metadata@0.8.0": { "core-js": "npm:core-js@0.9.18" }, + "github:aurelia/pal-browser@0.1.13": { + "aurelia-pal": "github:aurelia/pal@0.1.10" + }, "github:aurelia/templating@0.15.0": { "aurelia-binding": "github:aurelia/binding@0.9.0", "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.10.0", diff --git a/package.json b/package.json index cc64305a..6f396876 100644 --- a/package.json +++ b/package.json @@ -30,12 +30,14 @@ "aurelia-loader": "github:aurelia/loader@^0.9.0", "aurelia-logging": "github:aurelia/logging@^0.7.0", "aurelia-metadata": "github:aurelia/metadata@^0.8.0", + "aurelia-pal": "github:aurelia/pal@^0.1.10", "aurelia-path": "github:aurelia/path@^0.9.0", "aurelia-task-queue": "github:aurelia/task-queue@^0.7.0", "aurelia-templating": "github:aurelia/templating@^0.15.0", "core-js": "npm:core-js@^0.9.5" }, "devDependencies": { + "aurelia-pal-browser": "github:aurelia/pal-browser@^0.1.13", "babel": "npm:babel-core@^5.1.13", "babel-runtime": "npm:babel-runtime@^5.1.13", "core-js": "npm:core-js@^0.9.5" diff --git a/src/aurelia.js b/src/aurelia.js index 8c66f195..c83037c1 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -1,5 +1,5 @@ /*eslint no-unused-vars:0*/ -import * as core from 'core-js'; +import 'core-js'; import * as TheLogManager from 'aurelia-logging'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; @@ -10,29 +10,12 @@ import { ViewSlot, ViewResources, CompositionEngine, - Animator, - DOMBoundary + Animator } from 'aurelia-templating'; - -if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { - let CustomEvent = function(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - - let evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - - CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = CustomEvent; -} +import {DOM} from 'aurelia-pal'; function preventActionlessFormSubmit() { - document.body.addEventListener('submit', evt => { + DOM.addEventListener('submit', evt => { const target = evt.target; const action = target.action; @@ -84,19 +67,19 @@ export class Aurelia { return this.use.apply().then(() => { preventActionlessFormSubmit(); - if (!this.container.hasHandler(BindingLanguage)) { + if (!this.container.hasResolver(BindingLanguage)) { let message = 'You must configure Aurelia with a BindingLanguage implementation.'; this.logger.error(message); throw new Error(message); } - if (!this.container.hasHandler(Animator)) { + if (!this.container.hasResolver(Animator)) { Animator.configureDefault(this.container); } this.logger.info('Aurelia Started'); - let evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); + let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + DOM.dispatchEvent(evt); return this; }); } @@ -153,20 +136,24 @@ export class Aurelia { applicationHost = applicationHost || this.host; if (!applicationHost || typeof applicationHost === 'string') { - this.host = document.getElementById(applicationHost || 'applicationHost') || document.body; + this.host = DOM.getElementById(applicationHost || 'applicationHost'); } else { this.host = applicationHost; } + if (!this.host) { + throw new Error('No applicationHost was specified.'); + } + this.hostConfigured = true; this.host.aurelia = this; this.hostSlot = new ViewSlot(this.host, true); this.hostSlot.transformChildNodesIntoView(); - this.container.registerInstance(DOMBoundary, this.host); + this.container.registerInstance(DOM.boundary, this.host); } _onAureliaComposed() { - let evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); - setTimeout(() => document.dispatchEvent(evt), 1); + let evt = DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + setTimeout(() => DOM.dispatchEvent(evt), 1); } } diff --git a/src/framework-configuration.js b/src/framework-configuration.js index c5718ea4..bf96be7b 100644 --- a/src/framework-configuration.js +++ b/src/framework-configuration.js @@ -1,5 +1,5 @@ /*eslint no-unused-vars:0, no-cond-assign:0*/ -import * as core from 'core-js'; +import 'core-js'; import * as TheLogManager from 'aurelia-logging'; import {ViewEngine} from 'aurelia-templating'; import {join} from 'aurelia-path'; diff --git a/test/aurelia.spec.js b/test/aurelia.spec.js index c333143a..ccdb81fe 100644 --- a/test/aurelia.spec.js +++ b/test/aurelia.spec.js @@ -3,8 +3,11 @@ import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; import {BindingLanguage, ViewSlot, ViewResources, CompositionEngine} from 'aurelia-templating'; import {FrameworkConfiguration} from '../src/framework-configuration'; +import {initialize} from 'aurelia-pal-browser'; describe('aurelia', () => { + beforeAll(() => initialize()); + describe("constructor", () => { it("should have good defaults", () => { @@ -53,8 +56,8 @@ describe('aurelia', () => { resolve(); })); - mockContainer = jasmine.createSpyObj('container', ['registerInstance', 'hasHandler', 'get', 'makeGlobal']); - mockContainer.hasHandler.and.returnValue(true); + mockContainer = jasmine.createSpyObj('container', ['registerInstance', 'hasResolver', 'get', 'makeGlobal']); + mockContainer.hasResolver.and.returnValue(true); mockContainer.get.and.returnValue(mockViewEngine); mockPlugin = jasmine.createSpyObj('plugin', ['apply']); @@ -86,10 +89,10 @@ describe('aurelia', () => { //I'm going to assume start should fail in this case. it("should check for a binding language and log an error if one is not set", (done) => { - mockContainer.hasHandler.and.returnValue(false); + mockContainer.hasResolver.and.returnValue(false); aurelia.start() .then(() => expect(true).toBeFalsy("Should have not started up")) - .catch(() => expect(mockContainer.hasHandler).toHaveBeenCalledWith(BindingLanguage)) + .catch(() => expect(mockContainer.hasResolver).toHaveBeenCalledWith(BindingLanguage)) .then(done); }); @@ -134,22 +137,8 @@ describe('aurelia', () => { } }); - //This needs to be reworded - it("should default the host to the document body if the supplied applicationHost is a string and no element with that id is found", (done) => { - var documentSpy = spyOn(document, "getElementById").and.callThrough(); - aurelia.setRoot(rootModel, "someIDThatShouldNotExist") - .then((result) => { - expect(result).toBe(aurelia); - expect(aurelia.host).toBe(document.body); - expect(document.body.aurelia).toBe(aurelia); - expect(documentSpy).toHaveBeenCalledWith("someIDThatShouldNotExist"); - }) - .catch((reason) => expect(false).toBeTruthy(reason)) - .then(done); - }); - it("should try and find the element with an id of applicationHost if one is not supplied", (done) => { - var documentSpy = spyOn(document, "getElementById").and.callThrough(); + let documentSpy = spyOn(document, "getElementById").and.returnValue(document.body); aurelia.setRoot(rootModel) .then((result) => { expect(result).toBe(aurelia); @@ -164,7 +153,7 @@ describe('aurelia', () => { it("should use the applicationHost if it's not a string as the host", (done) => { //This wouldn't have succeeded because registerInstance checks the type //But the function doesn't guard against applicationHost so this test is valid - var host = { firstChild:{} }; + let host = { firstChild:{} }; aurelia.setRoot(rootModel, host) .then((result) => { expect(result).toBe(aurelia); @@ -177,6 +166,7 @@ describe('aurelia', () => { it("should call the compose function of the composition instance with a well formed instruction", (done) => { let attachedSpy; + let documentSpy = spyOn(document, "getElementById").and.returnValue(document.body); mockCompositionEngine.compose.and.callFake((instruction) => { attachedSpy = spyOn(instruction.viewSlot, 'attached'); return composePromise; @@ -199,7 +189,7 @@ describe('aurelia', () => { }); it("should fire a custom aurelia-composed event when it's done", (done) => { - + let documentSpy = spyOn(document, "getElementById").and.returnValue(document.body); composeListener = (event) => { expect(event).toEqual(jasmine.any(window.Event)); expect(event.type).toEqual("aurelia-composed"); diff --git a/test/framework-configuration.js b/test/framework-configuration.js index 2f567dff..2bc46d2d 100644 --- a/test/framework-configuration.js +++ b/test/framework-configuration.js @@ -1,8 +1,11 @@ import {FrameworkConfiguration} from '../src/framework-configuration'; import {Aurelia} from '../src/aurelia'; import {Metadata} from 'aurelia-metadata'; +import {initialize} from 'aurelia-pal-browser'; describe('the framework config', () => { + beforeAll(() => initialize()); + it('should initialize', () => { let aureliaMock = jasmine.createSpyObj('aureliaMock', ['loader']); let config = new FrameworkConfiguration(aureliaMock); @@ -71,8 +74,8 @@ describe('the framework config', () => { resolve(); })); - mockContainer = jasmine.createSpyObj('container', ['registerInstance', 'hasHandler', 'get', 'makeGlobal']); - mockContainer.hasHandler.and.returnValue(true); + mockContainer = jasmine.createSpyObj('container', ['registerInstance', 'hasResolver', 'get', 'makeGlobal']); + mockContainer.hasResolver.and.returnValue(true); mockContainer.get.and.returnValue(mockViewEngine); aurelia = new Aurelia(mockLoader, mockContainer, mockResources); @@ -89,6 +92,7 @@ describe('the framework config', () => { }); }); + aurelia.loader.normalizeSync = jasmine.createSpy('normalizeSync').and.callFake(input => input); aurelia.loader.loadModule = loadModule; }); @@ -182,10 +186,11 @@ describe('the framework config', () => { resolve(); })); - mockContainer = jasmine.createSpyObj('container', ['registerInstance', 'hasHandler', 'get', 'makeGlobal']); - mockContainer.hasHandler.and.returnValue(true); + mockContainer = jasmine.createSpyObj('container', ['registerInstance', 'hasResolver', 'get', 'makeGlobal']); + mockContainer.hasResolver.and.returnValue(true); mockContainer.get.and.returnValue(mockViewEngine); + mockLoader.normalizeSync = jasmine.createSpy('normalizeSync').and.callFake(input => input); aurelia = new Aurelia(mockLoader, mockContainer, mockResources); }); From 471d8c516a423baf56e3af1f834f9c19fceb2808 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Sat, 10 Oct 2015 20:12:49 -0400 Subject: [PATCH 003/549] fix(aurelia): switch window loader check to platform loader check --- src/aurelia.js | 4 ++-- test/aurelia.spec.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/aurelia.js b/src/aurelia.js index c83037c1..949342fa 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -12,7 +12,7 @@ import { CompositionEngine, Animator } from 'aurelia-templating'; -import {DOM} from 'aurelia-pal'; +import {DOM, PLATFORM} from 'aurelia-pal'; function preventActionlessFormSubmit() { DOM.addEventListener('submit', evt => { @@ -38,7 +38,7 @@ export class Aurelia { use: FrameworkConfiguration; constructor(loader?: Loader, container?: Container, resources?: ViewResources) { - this.loader = loader || new window.AureliaLoader(); + this.loader = loader || new PLATFORM.Loader(); this.container = container || new Container(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); diff --git a/test/aurelia.spec.js b/test/aurelia.spec.js index ccdb81fe..4cbdbca6 100644 --- a/test/aurelia.spec.js +++ b/test/aurelia.spec.js @@ -4,6 +4,7 @@ import {Loader} from 'aurelia-loader'; import {BindingLanguage, ViewSlot, ViewResources, CompositionEngine} from 'aurelia-templating'; import {FrameworkConfiguration} from '../src/framework-configuration'; import {initialize} from 'aurelia-pal-browser'; +import {PLATFORM} from 'aurelia-pal'; describe('aurelia', () => { beforeAll(() => initialize()); @@ -12,7 +13,7 @@ describe('aurelia', () => { it("should have good defaults", () => { let mockLoader = {}; - window.AureliaLoader = function(){ + PLATFORM.Loader = function(){ return mockLoader; } let aurelia = new Aurelia(); From d6f569f70879bfabd4a09d543495d0335b582bd9 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Mon, 12 Oct 2015 00:51:45 -0400 Subject: [PATCH 004/549] feat(aurelia): initialize the binding system --- src/aurelia.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/aurelia.js b/src/aurelia.js index 949342fa..92e40481 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -3,16 +3,10 @@ import 'core-js'; import * as TheLogManager from 'aurelia-logging'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; -import {FrameworkConfiguration} from './framework-configuration'; -import { - BindingLanguage, - ViewEngine, - ViewSlot, - ViewResources, - CompositionEngine, - Animator -} from 'aurelia-templating'; +import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator} from 'aurelia-templating'; import {DOM, PLATFORM} from 'aurelia-pal'; +import {bindingSystem} from 'aurelia-binding'; +import {FrameworkConfiguration} from './framework-configuration'; function preventActionlessFormSubmit() { DOM.addEventListener('submit', evt => { @@ -77,6 +71,8 @@ export class Aurelia { Animator.configureDefault(this.container); } + bindingSystem.initialize(this.container); + this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); DOM.dispatchEvent(evt); From e19f56bdcb006511501e513d583d8893d3d44383 Mon Sep 17 00:00:00 2001 From: Jeremy Danyow Date: Mon, 12 Oct 2015 21:32:40 -0400 Subject: [PATCH 005/549] chore(bindingSystem): bindingSystem renamed bindingEngine --- src/aurelia.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/aurelia.js b/src/aurelia.js index 92e40481..c8e1ae3f 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -5,7 +5,7 @@ import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator} from 'aurelia-templating'; import {DOM, PLATFORM} from 'aurelia-pal'; -import {bindingSystem} from 'aurelia-binding'; +import {bindingEngine} from 'aurelia-binding'; import {FrameworkConfiguration} from './framework-configuration'; function preventActionlessFormSubmit() { @@ -71,7 +71,7 @@ export class Aurelia { Animator.configureDefault(this.container); } - bindingSystem.initialize(this.container); + bindingEngine.initialize(this.container); this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); From e60e516310ac8eb2ee3b69915ad82d36949bc324 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Tue, 13 Oct 2015 01:53:24 -0400 Subject: [PATCH 006/549] feat(aurelia): initialize new templatingEngine api --- src/aurelia.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/aurelia.js b/src/aurelia.js index c8e1ae3f..58d5dee1 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -3,9 +3,8 @@ import 'core-js'; import * as TheLogManager from 'aurelia-logging'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; -import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator} from 'aurelia-templating'; +import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine} from 'aurelia-templating'; import {DOM, PLATFORM} from 'aurelia-pal'; -import {bindingEngine} from 'aurelia-binding'; import {FrameworkConfiguration} from './framework-configuration'; function preventActionlessFormSubmit() { @@ -71,7 +70,7 @@ export class Aurelia { Animator.configureDefault(this.container); } - bindingEngine.initialize(this.container); + templatingEngine.initialize(this.container); this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); From 10ca62bbd93c06ffac05f6dc060b65fa62d57369 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Tue, 13 Oct 2015 02:48:16 -0400 Subject: [PATCH 007/549] feat(index): export all from pal --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index 11d27dbd..1acf1783 100644 --- a/src/index.js +++ b/src/index.js @@ -5,6 +5,7 @@ export * from 'aurelia-templating'; export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; +export * from 'aurelia-pal'; import * as TheLogManager from 'aurelia-logging'; export const LogManager = TheLogManager; From fe4bf2111ca9f532a5c11f5a9269495797df6e34 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Tue, 13 Oct 2015 05:13:39 -0400 Subject: [PATCH 008/549] chore(all): prepare release 0.17.0 --- bower.json | 19 ++--- config.js | 102 +++++++++++++++---------- dist/amd/aurelia-framework.d.ts | 6 +- dist/amd/aurelia-framework.js | 71 +++++++---------- dist/aurelia-framework.d.ts | 6 +- dist/aurelia-framework.js | 73 ++++++++---------- dist/commonjs/aurelia-framework.d.ts | 6 +- dist/commonjs/aurelia-framework.js | 75 ++++++++---------- dist/es6/aurelia-framework.d.ts | 6 +- dist/es6/aurelia-framework.js | 73 ++++++++---------- dist/system/aurelia-framework.d.ts | 6 +- dist/system/aurelia-framework.js | 83 +++++++++----------- doc/CHANGELOG.md | 110 +++++++++++++++++++++++++++ doc/api.json | 14 ++-- package.json | 46 +++-------- 15 files changed, 380 insertions(+), 316 deletions(-) diff --git a/bower.json b/bower.json index 0cef4228..53be3392 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.16.0", + "version": "0.17.0", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", @@ -17,14 +17,15 @@ "url": "http://github.com/aurelia/framework" }, "dependencies": { - "aurelia-binding": "^0.9.0", - "aurelia-dependency-injection": "^0.10.0", - "aurelia-loader": "^0.9.0", - "aurelia-logging": "^0.7.0", - "aurelia-metadata": "^0.8.0", - "aurelia-path": "^0.9.0", - "aurelia-task-queue": "^0.7.0", - "aurelia-templating": "^0.15.0", + "aurelia-binding": "^0.10.0", + "aurelia-dependency-injection": "^0.11.0", + "aurelia-loader": "^0.10.0", + "aurelia-logging": "^0.8.0", + "aurelia-metadata": "^0.9.0", + "aurelia-pal": "^0.2.0", + "aurelia-path": "^0.10.0", + "aurelia-task-queue": "^0.8.0", + "aurelia-templating": "^0.16.0", "core-js": "zloirock/core-js" } } diff --git a/config.js b/config.js index 36bc1e61..dd240f57 100644 --- a/config.js +++ b/config.js @@ -14,65 +14,87 @@ System.config({ }, map: { - "aurelia-binding": "github:aurelia/binding@0.9.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.10.0", - "aurelia-loader": "github:aurelia/loader@0.9.0", - "aurelia-logging": "github:aurelia/logging@0.7.0", - "aurelia-metadata": "github:aurelia/metadata@0.8.0", - "aurelia-pal": "github:aurelia/pal@0.1.10", - "aurelia-pal-browser": "github:aurelia/pal-browser@0.1.13", - "aurelia-path": "github:aurelia/path@0.9.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.7.0", - "aurelia-templating": "github:aurelia/templating@0.15.0", + "aurelia-binding": "github:aurelia/binding@0.10.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.11.0", + "aurelia-loader": "github:aurelia/loader@0.10.0", + "aurelia-logging": "github:aurelia/logging@0.8.0", + "aurelia-metadata": "github:aurelia/metadata@0.9.0", + "aurelia-pal": "github:aurelia/pal@0.2.0", + "aurelia-pal-browser": "github:aurelia/pal-browser@0.2.0", + "aurelia-path": "github:aurelia/path@0.10.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.8.0", + "aurelia-templating": "github:aurelia/templating@0.16.0", "babel": "npm:babel-core@5.2.2", "babel-runtime": "npm:babel-runtime@5.2.2", - "core-js": "npm:core-js@1.1.4", - "github:aurelia/binding@0.9.0": { - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.10.0", - "aurelia-metadata": "github:aurelia/metadata@0.8.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.7.0", + "core-js": "npm:core-js@1.2.1", + "github:aurelia/binding@0.10.0": { + "aurelia-metadata": "github:aurelia/metadata@0.9.0", + "aurelia-pal": "github:aurelia/pal@0.2.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.8.0", "core-js": "npm:core-js@0.9.18" }, - "github:aurelia/dependency-injection@0.10.0": { - "aurelia-logging": "github:aurelia/logging@0.7.0", - "aurelia-metadata": "github:aurelia/metadata@0.8.0", + "github:aurelia/dependency-injection@0.11.0": { + "aurelia-logging": "github:aurelia/logging@0.8.0", + "aurelia-metadata": "github:aurelia/metadata@0.9.0", + "aurelia-pal": "github:aurelia/pal@0.2.0", "core-js": "npm:core-js@0.9.18" }, - "github:aurelia/loader@0.9.0": { - "aurelia-html-template-element": "github:aurelia/html-template-element@0.3.0", - "aurelia-metadata": "github:aurelia/metadata@0.8.0", - "aurelia-path": "github:aurelia/path@0.9.0", - "core-js": "github:zloirock/core-js@0.8.4" + "github:aurelia/loader@0.10.0": { + "aurelia-metadata": "github:aurelia/metadata@0.9.0", + "aurelia-path": "github:aurelia/path@0.10.0" }, - "github:aurelia/metadata@0.8.0": { + "github:aurelia/metadata@0.9.0": { + "aurelia-pal": "github:aurelia/pal@0.2.0", "core-js": "npm:core-js@0.9.18" }, - "github:aurelia/pal-browser@0.1.13": { - "aurelia-pal": "github:aurelia/pal@0.1.10" + "github:aurelia/pal-browser@0.2.0": { + "aurelia-pal": "github:aurelia/pal@0.2.0" }, - "github:aurelia/templating@0.15.0": { - "aurelia-binding": "github:aurelia/binding@0.9.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.10.0", - "aurelia-html-template-element": "github:aurelia/html-template-element@0.3.0", - "aurelia-loader": "github:aurelia/loader@0.9.0", - "aurelia-logging": "github:aurelia/logging@0.7.0", - "aurelia-metadata": "github:aurelia/metadata@0.8.0", - "aurelia-path": "github:aurelia/path@0.9.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.7.0", + "github:aurelia/task-queue@0.8.0": { + "aurelia-pal": "github:aurelia/pal@0.2.0" + }, + "github:aurelia/templating@0.16.0": { + "aurelia-binding": "github:aurelia/binding@0.10.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.11.0", + "aurelia-loader": "github:aurelia/loader@0.10.0", + "aurelia-logging": "github:aurelia/logging@0.8.0", + "aurelia-metadata": "github:aurelia/metadata@0.9.0", + "aurelia-pal": "github:aurelia/pal@0.2.0", + "aurelia-path": "github:aurelia/path@0.10.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.8.0", "core-js": "npm:core-js@0.9.18" }, - "github:jspm/nodelibs-process@0.1.1": { - "process": "npm:process@0.10.1" + "github:jspm/nodelibs-assert@0.1.0": { + "assert": "npm:assert@1.3.0" + }, + "github:jspm/nodelibs-process@0.1.2": { + "process": "npm:process@0.11.2" + }, + "github:jspm/nodelibs-util@0.1.0": { + "util": "npm:util@0.10.3" + }, + "npm:assert@1.3.0": { + "util": "npm:util@0.10.3" }, "npm:core-js@0.9.18": { "fs": "github:jspm/nodelibs-fs@0.1.2", - "process": "github:jspm/nodelibs-process@0.1.1", + "process": "github:jspm/nodelibs-process@0.1.2", "systemjs-json": "github:systemjs/plugin-json@0.1.0" }, - "npm:core-js@1.1.4": { + "npm:core-js@1.2.1": { "fs": "github:jspm/nodelibs-fs@0.1.2", - "process": "github:jspm/nodelibs-process@0.1.1", + "process": "github:jspm/nodelibs-process@0.1.2", "systemjs-json": "github:systemjs/plugin-json@0.1.0" + }, + "npm:inherits@2.0.1": { + "util": "github:jspm/nodelibs-util@0.1.0" + }, + "npm:process@0.11.2": { + "assert": "github:jspm/nodelibs-assert@0.1.0" + }, + "npm:util@0.10.3": { + "inherits": "npm:inherits@2.0.1", + "process": "github:jspm/nodelibs-process@0.1.2" } } }); diff --git a/dist/amd/aurelia-framework.d.ts b/dist/amd/aurelia-framework.d.ts index 7dc763aa..768caee6 100644 --- a/dist/amd/aurelia-framework.d.ts +++ b/dist/amd/aurelia-framework.d.ts @@ -1,10 +1,11 @@ declare module 'aurelia-framework' { - import * as core from 'core-js'; + import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, DOMBoundary } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; + import { DOM, PLATFORM } from 'aurelia-pal'; /** * Manages configuring the aurelia framework instance. @@ -175,5 +176,6 @@ declare module 'aurelia-framework' { export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; + export * from 'aurelia-pal'; export const LogManager: any; } \ No newline at end of file diff --git a/dist/amd/aurelia-framework.js b/dist/amd/aurelia-framework.js index a4e74d4e..0f67bd2d 100644 --- a/dist/amd/aurelia-framework.js +++ b/dist/amd/aurelia-framework.js @@ -1,4 +1,4 @@ -define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-path', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-binding', 'aurelia-metadata', 'aurelia-task-queue'], function (exports, _coreJs, _aureliaLogging, _aureliaTemplating, _aureliaPath, _aureliaDependencyInjection, _aureliaLoader, _aureliaBinding, _aureliaMetadata, _aureliaTaskQueue) { +define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-path', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-pal', 'aurelia-binding', 'aurelia-metadata', 'aurelia-task-queue'], function (exports, _coreJs, _aureliaLogging, _aureliaTemplating, _aureliaPath, _aureliaDependencyInjection, _aureliaLoader, _aureliaPal, _aureliaBinding, _aureliaMetadata, _aureliaTaskQueue) { 'use strict'; exports.__esModule = true; @@ -73,9 +73,7 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- this.postTasks = []; this.resourcesToLoad = {}; this.preTask(function () { - return System.normalize('aurelia-bootstrapper').then(function (bootstrapperName) { - return _this.bootstrapperName = bootstrapperName; - }); + return _this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper'); }); this.postTask(function () { return loadResources(aurelia.container, _this.resourcesToLoad, aurelia.resources); @@ -160,13 +158,12 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- this.plugin(plugin); this.preTask(function () { - return System.normalize(name, _this2.bootstrapperName).then(function (normalizedName) { - normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; + var normalizedName = _this2.aurelia.loader.normalizeSync(name, _this2.bootstrapperName); + normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; - plugin.moduleId = normalizedName; - plugin.resourcesRelativeTo = normalizedName; - System.map[name] = normalizedName; - }); + plugin.moduleId = normalizedName; + plugin.resourcesRelativeTo = normalizedName; + _this2.aurelia.loader.map(name, normalizedName); }); return this; @@ -200,11 +197,10 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- var _this3 = this; this.preTask(function () { - return System.normalize('aurelia-logging-console', _this3.bootstrapperName).then(function (name) { - return _this3.aurelia.loader.loadModule(name).then(function (m) { - _aureliaLogging.addAppender(new m.ConsoleAppender()); - _aureliaLogging.setLevel(_aureliaLogging.logLevel.debug); - }); + var name = _this3.aurelia.loader.normalizeSync('aurelia-logging-console', _this3.bootstrapperName); + return _this3.aurelia.loader.loadModule(name).then(function (m) { + _aureliaLogging.addAppender(new m.ConsoleAppender()); + _aureliaLogging.setLevel(_aureliaLogging.logLevel.debug); }); }); @@ -243,25 +239,8 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- exports.FrameworkConfiguration = FrameworkConfiguration; - if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { - var _CustomEvent = function _CustomEvent(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - - _CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = _CustomEvent; - } - function preventActionlessFormSubmit() { - document.body.addEventListener('submit', function (evt) { + _aureliaPal.DOM.addEventListener('submit', function (evt) { var target = evt.target; var action = target.action; @@ -275,7 +254,7 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- function Aurelia(loader, container, resources) { _classCallCheck(this, Aurelia); - this.loader = loader || new window.AureliaLoader(); + this.loader = loader || new _aureliaPal.PLATFORM.Loader(); this.container = container || new _aureliaDependencyInjection.Container(); this.resources = resources || new _aureliaTemplating.ViewResources(); this.use = new FrameworkConfiguration(this); @@ -302,19 +281,21 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- return this.use.apply().then(function () { preventActionlessFormSubmit(); - if (!_this5.container.hasHandler(_aureliaTemplating.BindingLanguage)) { + if (!_this5.container.hasResolver(_aureliaTemplating.BindingLanguage)) { var message = 'You must configure Aurelia with a BindingLanguage implementation.'; _this5.logger.error(message); throw new Error(message); } - if (!_this5.container.hasHandler(_aureliaTemplating.Animator)) { + if (!_this5.container.hasResolver(_aureliaTemplating.Animator)) { _aureliaTemplating.Animator.configureDefault(_this5.container); } + _aureliaTemplating.templatingEngine.initialize(_this5.container); + _this5.logger.info('Aurelia Started'); - var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); + var evt = _aureliaPal.DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + _aureliaPal.DOM.dispatchEvent(evt); return _this5; }); }; @@ -369,22 +350,26 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- applicationHost = applicationHost || this.host; if (!applicationHost || typeof applicationHost === 'string') { - this.host = document.getElementById(applicationHost || 'applicationHost') || document.body; + this.host = _aureliaPal.DOM.getElementById(applicationHost || 'applicationHost'); } else { this.host = applicationHost; } + if (!this.host) { + throw new Error('No applicationHost was specified.'); + } + this.hostConfigured = true; this.host.aurelia = this; this.hostSlot = new _aureliaTemplating.ViewSlot(this.host, true); this.hostSlot.transformChildNodesIntoView(); - this.container.registerInstance(_aureliaTemplating.DOMBoundary, this.host); + this.container.registerInstance(_aureliaPal.DOM.boundary, this.host); }; Aurelia.prototype._onAureliaComposed = function _onAureliaComposed() { - var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + var evt = _aureliaPal.DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); setTimeout(function () { - return document.dispatchEvent(evt); + return _aureliaPal.DOM.dispatchEvent(evt); }, 1); }; @@ -407,6 +392,8 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- _defaults(exports, _interopExportWildcard(_aureliaPath, _defaults)); + _defaults(exports, _interopExportWildcard(_aureliaPal, _defaults)); + var LogManager = _aureliaLogging; exports.LogManager = LogManager; }); \ No newline at end of file diff --git a/dist/aurelia-framework.d.ts b/dist/aurelia-framework.d.ts index 7dc763aa..768caee6 100644 --- a/dist/aurelia-framework.d.ts +++ b/dist/aurelia-framework.d.ts @@ -1,10 +1,11 @@ declare module 'aurelia-framework' { - import * as core from 'core-js'; + import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, DOMBoundary } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; + import { DOM, PLATFORM } from 'aurelia-pal'; /** * Manages configuring the aurelia framework instance. @@ -175,5 +176,6 @@ declare module 'aurelia-framework' { export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; + export * from 'aurelia-pal'; export const LogManager: any; } \ No newline at end of file diff --git a/dist/aurelia-framework.js b/dist/aurelia-framework.js index 8409df93..8ce9c901 100644 --- a/dist/aurelia-framework.js +++ b/dist/aurelia-framework.js @@ -1,9 +1,10 @@ -import * as core from 'core-js'; +import 'core-js'; import * as TheLogManager from 'aurelia-logging'; -import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,CompositionEngine,Animator,DOMBoundary} from 'aurelia-templating'; +import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,CompositionEngine,Animator,templatingEngine} from 'aurelia-templating'; import {join} from 'aurelia-path'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; +import {DOM,PLATFORM} from 'aurelia-pal'; /*eslint no-unused-vars:0, no-cond-assign:0*/ const logger = TheLogManager.getLogger('aurelia'); @@ -72,7 +73,7 @@ export class FrameworkConfiguration { this.preTasks = []; this.postTasks = []; this.resourcesToLoad = {}; - this.preTask(() => System.normalize('aurelia-bootstrapper').then(bootstrapperName => this.bootstrapperName = bootstrapperName)); + this.preTask(() => this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper')); this.postTask(() => loadResources(aurelia.container, this.resourcesToLoad, aurelia.resources)); } @@ -203,14 +204,13 @@ export class FrameworkConfiguration { this.plugin(plugin); this.preTask(() => { - return System.normalize(name, this.bootstrapperName).then(normalizedName => { - normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') - ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; + let normalizedName = this.aurelia.loader.normalizeSync(name, this.bootstrapperName); + normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') + ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; - plugin.moduleId = normalizedName; - plugin.resourcesRelativeTo = normalizedName; - System.map[name] = normalizedName; - }); + plugin.moduleId = normalizedName; + plugin.resourcesRelativeTo = normalizedName; + this.aurelia.loader.map(name, normalizedName); }); return this; @@ -270,11 +270,10 @@ export class FrameworkConfiguration { */ developmentLogging(): FrameworkConfiguration { this.preTask(() => { - return System.normalize('aurelia-logging-console', this.bootstrapperName).then(name => { - return this.aurelia.loader.loadModule(name).then(m => { - TheLogManager.addAppender(new m.ConsoleAppender()); - TheLogManager.setLevel(TheLogManager.logLevel.debug); - }); + let name = this.aurelia.loader.normalizeSync('aurelia-logging-console', this.bootstrapperName); + return this.aurelia.loader.loadModule(name).then(m => { + TheLogManager.addAppender(new m.ConsoleAppender()); + TheLogManager.setLevel(TheLogManager.logLevel.debug); }); }); @@ -310,25 +309,8 @@ export class FrameworkConfiguration { } /*eslint no-unused-vars:0*/ -if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { - let CustomEvent = function(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - - let evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - - CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = CustomEvent; -} - function preventActionlessFormSubmit() { - document.body.addEventListener('submit', evt => { + DOM.addEventListener('submit', evt => { const target = evt.target; const action = target.action; @@ -351,7 +333,7 @@ export class Aurelia { use: FrameworkConfiguration; constructor(loader?: Loader, container?: Container, resources?: ViewResources) { - this.loader = loader || new window.AureliaLoader(); + this.loader = loader || new PLATFORM.Loader(); this.container = container || new Container(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); @@ -380,19 +362,21 @@ export class Aurelia { return this.use.apply().then(() => { preventActionlessFormSubmit(); - if (!this.container.hasHandler(BindingLanguage)) { + if (!this.container.hasResolver(BindingLanguage)) { let message = 'You must configure Aurelia with a BindingLanguage implementation.'; this.logger.error(message); throw new Error(message); } - if (!this.container.hasHandler(Animator)) { + if (!this.container.hasResolver(Animator)) { Animator.configureDefault(this.container); } + templatingEngine.initialize(this.container); + this.logger.info('Aurelia Started'); - let evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); + let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + DOM.dispatchEvent(evt); return this; }); } @@ -449,21 +433,25 @@ export class Aurelia { applicationHost = applicationHost || this.host; if (!applicationHost || typeof applicationHost === 'string') { - this.host = document.getElementById(applicationHost || 'applicationHost') || document.body; + this.host = DOM.getElementById(applicationHost || 'applicationHost'); } else { this.host = applicationHost; } + if (!this.host) { + throw new Error('No applicationHost was specified.'); + } + this.hostConfigured = true; this.host.aurelia = this; this.hostSlot = new ViewSlot(this.host, true); this.hostSlot.transformChildNodesIntoView(); - this.container.registerInstance(DOMBoundary, this.host); + this.container.registerInstance(DOM.boundary, this.host); } _onAureliaComposed() { - let evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); - setTimeout(() => document.dispatchEvent(evt), 1); + let evt = DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + setTimeout(() => DOM.dispatchEvent(evt), 1); } } @@ -474,5 +462,6 @@ export * from 'aurelia-templating'; export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; +export * from 'aurelia-pal'; export const LogManager = TheLogManager; diff --git a/dist/commonjs/aurelia-framework.d.ts b/dist/commonjs/aurelia-framework.d.ts index 7dc763aa..768caee6 100644 --- a/dist/commonjs/aurelia-framework.d.ts +++ b/dist/commonjs/aurelia-framework.d.ts @@ -1,10 +1,11 @@ declare module 'aurelia-framework' { - import * as core from 'core-js'; + import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, DOMBoundary } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; + import { DOM, PLATFORM } from 'aurelia-pal'; /** * Manages configuring the aurelia framework instance. @@ -175,5 +176,6 @@ declare module 'aurelia-framework' { export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; + export * from 'aurelia-pal'; export const LogManager: any; } \ No newline at end of file diff --git a/dist/commonjs/aurelia-framework.js b/dist/commonjs/aurelia-framework.js index 8e2c9971..c8bf124b 100644 --- a/dist/commonjs/aurelia-framework.js +++ b/dist/commonjs/aurelia-framework.js @@ -10,9 +10,7 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } -var _coreJs = require('core-js'); - -var core = _interopRequireWildcard(_coreJs); +require('core-js'); var _aureliaLogging = require('aurelia-logging'); @@ -26,6 +24,8 @@ var _aureliaDependencyInjection = require('aurelia-dependency-injection'); var _aureliaLoader = require('aurelia-loader'); +var _aureliaPal = require('aurelia-pal'); + var logger = TheLogManager.getLogger('aurelia'); function runTasks(config, tasks) { @@ -90,9 +90,7 @@ var FrameworkConfiguration = (function () { this.postTasks = []; this.resourcesToLoad = {}; this.preTask(function () { - return System.normalize('aurelia-bootstrapper').then(function (bootstrapperName) { - return _this.bootstrapperName = bootstrapperName; - }); + return _this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper'); }); this.postTask(function () { return loadResources(aurelia.container, _this.resourcesToLoad, aurelia.resources); @@ -177,13 +175,12 @@ var FrameworkConfiguration = (function () { this.plugin(plugin); this.preTask(function () { - return System.normalize(name, _this2.bootstrapperName).then(function (normalizedName) { - normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; + var normalizedName = _this2.aurelia.loader.normalizeSync(name, _this2.bootstrapperName); + normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; - plugin.moduleId = normalizedName; - plugin.resourcesRelativeTo = normalizedName; - System.map[name] = normalizedName; - }); + plugin.moduleId = normalizedName; + plugin.resourcesRelativeTo = normalizedName; + _this2.aurelia.loader.map(name, normalizedName); }); return this; @@ -217,11 +214,10 @@ var FrameworkConfiguration = (function () { var _this3 = this; this.preTask(function () { - return System.normalize('aurelia-logging-console', _this3.bootstrapperName).then(function (name) { - return _this3.aurelia.loader.loadModule(name).then(function (m) { - TheLogManager.addAppender(new m.ConsoleAppender()); - TheLogManager.setLevel(TheLogManager.logLevel.debug); - }); + var name = _this3.aurelia.loader.normalizeSync('aurelia-logging-console', _this3.bootstrapperName); + return _this3.aurelia.loader.loadModule(name).then(function (m) { + TheLogManager.addAppender(new m.ConsoleAppender()); + TheLogManager.setLevel(TheLogManager.logLevel.debug); }); }); @@ -260,25 +256,8 @@ var FrameworkConfiguration = (function () { exports.FrameworkConfiguration = FrameworkConfiguration; -if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { - var _CustomEvent = function _CustomEvent(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - - _CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = _CustomEvent; -} - function preventActionlessFormSubmit() { - document.body.addEventListener('submit', function (evt) { + _aureliaPal.DOM.addEventListener('submit', function (evt) { var target = evt.target; var action = target.action; @@ -292,7 +271,7 @@ var Aurelia = (function () { function Aurelia(loader, container, resources) { _classCallCheck(this, Aurelia); - this.loader = loader || new window.AureliaLoader(); + this.loader = loader || new _aureliaPal.PLATFORM.Loader(); this.container = container || new _aureliaDependencyInjection.Container(); this.resources = resources || new _aureliaTemplating.ViewResources(); this.use = new FrameworkConfiguration(this); @@ -319,19 +298,21 @@ var Aurelia = (function () { return this.use.apply().then(function () { preventActionlessFormSubmit(); - if (!_this5.container.hasHandler(_aureliaTemplating.BindingLanguage)) { + if (!_this5.container.hasResolver(_aureliaTemplating.BindingLanguage)) { var message = 'You must configure Aurelia with a BindingLanguage implementation.'; _this5.logger.error(message); throw new Error(message); } - if (!_this5.container.hasHandler(_aureliaTemplating.Animator)) { + if (!_this5.container.hasResolver(_aureliaTemplating.Animator)) { _aureliaTemplating.Animator.configureDefault(_this5.container); } + _aureliaTemplating.templatingEngine.initialize(_this5.container); + _this5.logger.info('Aurelia Started'); - var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); + var evt = _aureliaPal.DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + _aureliaPal.DOM.dispatchEvent(evt); return _this5; }); }; @@ -386,22 +367,26 @@ var Aurelia = (function () { applicationHost = applicationHost || this.host; if (!applicationHost || typeof applicationHost === 'string') { - this.host = document.getElementById(applicationHost || 'applicationHost') || document.body; + this.host = _aureliaPal.DOM.getElementById(applicationHost || 'applicationHost'); } else { this.host = applicationHost; } + if (!this.host) { + throw new Error('No applicationHost was specified.'); + } + this.hostConfigured = true; this.host.aurelia = this; this.hostSlot = new _aureliaTemplating.ViewSlot(this.host, true); this.hostSlot.transformChildNodesIntoView(); - this.container.registerInstance(_aureliaTemplating.DOMBoundary, this.host); + this.container.registerInstance(_aureliaPal.DOM.boundary, this.host); }; Aurelia.prototype._onAureliaComposed = function _onAureliaComposed() { - var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + var evt = _aureliaPal.DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); setTimeout(function () { - return document.dispatchEvent(evt); + return _aureliaPal.DOM.dispatchEvent(evt); }, 1); }; @@ -430,5 +415,7 @@ _defaults(exports, _interopExportWildcard(_aureliaTaskQueue, _defaults)); _defaults(exports, _interopExportWildcard(_aureliaPath, _defaults)); +_defaults(exports, _interopExportWildcard(_aureliaPal, _defaults)); + var LogManager = TheLogManager; exports.LogManager = LogManager; \ No newline at end of file diff --git a/dist/es6/aurelia-framework.d.ts b/dist/es6/aurelia-framework.d.ts index 7dc763aa..768caee6 100644 --- a/dist/es6/aurelia-framework.d.ts +++ b/dist/es6/aurelia-framework.d.ts @@ -1,10 +1,11 @@ declare module 'aurelia-framework' { - import * as core from 'core-js'; + import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, DOMBoundary } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; + import { DOM, PLATFORM } from 'aurelia-pal'; /** * Manages configuring the aurelia framework instance. @@ -175,5 +176,6 @@ declare module 'aurelia-framework' { export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; + export * from 'aurelia-pal'; export const LogManager: any; } \ No newline at end of file diff --git a/dist/es6/aurelia-framework.js b/dist/es6/aurelia-framework.js index 8409df93..8ce9c901 100644 --- a/dist/es6/aurelia-framework.js +++ b/dist/es6/aurelia-framework.js @@ -1,9 +1,10 @@ -import * as core from 'core-js'; +import 'core-js'; import * as TheLogManager from 'aurelia-logging'; -import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,CompositionEngine,Animator,DOMBoundary} from 'aurelia-templating'; +import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,CompositionEngine,Animator,templatingEngine} from 'aurelia-templating'; import {join} from 'aurelia-path'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; +import {DOM,PLATFORM} from 'aurelia-pal'; /*eslint no-unused-vars:0, no-cond-assign:0*/ const logger = TheLogManager.getLogger('aurelia'); @@ -72,7 +73,7 @@ export class FrameworkConfiguration { this.preTasks = []; this.postTasks = []; this.resourcesToLoad = {}; - this.preTask(() => System.normalize('aurelia-bootstrapper').then(bootstrapperName => this.bootstrapperName = bootstrapperName)); + this.preTask(() => this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper')); this.postTask(() => loadResources(aurelia.container, this.resourcesToLoad, aurelia.resources)); } @@ -203,14 +204,13 @@ export class FrameworkConfiguration { this.plugin(plugin); this.preTask(() => { - return System.normalize(name, this.bootstrapperName).then(normalizedName => { - normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') - ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; + let normalizedName = this.aurelia.loader.normalizeSync(name, this.bootstrapperName); + normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') + ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; - plugin.moduleId = normalizedName; - plugin.resourcesRelativeTo = normalizedName; - System.map[name] = normalizedName; - }); + plugin.moduleId = normalizedName; + plugin.resourcesRelativeTo = normalizedName; + this.aurelia.loader.map(name, normalizedName); }); return this; @@ -270,11 +270,10 @@ export class FrameworkConfiguration { */ developmentLogging(): FrameworkConfiguration { this.preTask(() => { - return System.normalize('aurelia-logging-console', this.bootstrapperName).then(name => { - return this.aurelia.loader.loadModule(name).then(m => { - TheLogManager.addAppender(new m.ConsoleAppender()); - TheLogManager.setLevel(TheLogManager.logLevel.debug); - }); + let name = this.aurelia.loader.normalizeSync('aurelia-logging-console', this.bootstrapperName); + return this.aurelia.loader.loadModule(name).then(m => { + TheLogManager.addAppender(new m.ConsoleAppender()); + TheLogManager.setLevel(TheLogManager.logLevel.debug); }); }); @@ -310,25 +309,8 @@ export class FrameworkConfiguration { } /*eslint no-unused-vars:0*/ -if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { - let CustomEvent = function(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - - let evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - - CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = CustomEvent; -} - function preventActionlessFormSubmit() { - document.body.addEventListener('submit', evt => { + DOM.addEventListener('submit', evt => { const target = evt.target; const action = target.action; @@ -351,7 +333,7 @@ export class Aurelia { use: FrameworkConfiguration; constructor(loader?: Loader, container?: Container, resources?: ViewResources) { - this.loader = loader || new window.AureliaLoader(); + this.loader = loader || new PLATFORM.Loader(); this.container = container || new Container(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); @@ -380,19 +362,21 @@ export class Aurelia { return this.use.apply().then(() => { preventActionlessFormSubmit(); - if (!this.container.hasHandler(BindingLanguage)) { + if (!this.container.hasResolver(BindingLanguage)) { let message = 'You must configure Aurelia with a BindingLanguage implementation.'; this.logger.error(message); throw new Error(message); } - if (!this.container.hasHandler(Animator)) { + if (!this.container.hasResolver(Animator)) { Animator.configureDefault(this.container); } + templatingEngine.initialize(this.container); + this.logger.info('Aurelia Started'); - let evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); + let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + DOM.dispatchEvent(evt); return this; }); } @@ -449,21 +433,25 @@ export class Aurelia { applicationHost = applicationHost || this.host; if (!applicationHost || typeof applicationHost === 'string') { - this.host = document.getElementById(applicationHost || 'applicationHost') || document.body; + this.host = DOM.getElementById(applicationHost || 'applicationHost'); } else { this.host = applicationHost; } + if (!this.host) { + throw new Error('No applicationHost was specified.'); + } + this.hostConfigured = true; this.host.aurelia = this; this.hostSlot = new ViewSlot(this.host, true); this.hostSlot.transformChildNodesIntoView(); - this.container.registerInstance(DOMBoundary, this.host); + this.container.registerInstance(DOM.boundary, this.host); } _onAureliaComposed() { - let evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); - setTimeout(() => document.dispatchEvent(evt), 1); + let evt = DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + setTimeout(() => DOM.dispatchEvent(evt), 1); } } @@ -474,5 +462,6 @@ export * from 'aurelia-templating'; export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; +export * from 'aurelia-pal'; export const LogManager = TheLogManager; diff --git a/dist/system/aurelia-framework.d.ts b/dist/system/aurelia-framework.d.ts index 7dc763aa..768caee6 100644 --- a/dist/system/aurelia-framework.d.ts +++ b/dist/system/aurelia-framework.d.ts @@ -1,10 +1,11 @@ declare module 'aurelia-framework' { - import * as core from 'core-js'; + import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, DOMBoundary } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; + import { DOM, PLATFORM } from 'aurelia-pal'; /** * Manages configuring the aurelia framework instance. @@ -175,5 +176,6 @@ declare module 'aurelia-framework' { export * from 'aurelia-loader'; export * from 'aurelia-task-queue'; export * from 'aurelia-path'; + export * from 'aurelia-pal'; export const LogManager: any; } \ No newline at end of file diff --git a/dist/system/aurelia-framework.js b/dist/system/aurelia-framework.js index 5919e7f4..46a9e630 100644 --- a/dist/system/aurelia-framework.js +++ b/dist/system/aurelia-framework.js @@ -1,7 +1,7 @@ -System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-path', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-binding', 'aurelia-metadata', 'aurelia-task-queue'], function (_export) { +System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-path', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-pal', 'aurelia-binding', 'aurelia-metadata', 'aurelia-task-queue'], function (_export) { 'use strict'; - var core, TheLogManager, ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, DOMBoundary, join, Container, Loader, logger, FrameworkConfiguration, _CustomEvent, Aurelia, LogManager; + var TheLogManager, ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine, join, Container, Loader, DOM, PLATFORM, logger, FrameworkConfiguration, Aurelia, LogManager; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } @@ -54,7 +54,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa } function preventActionlessFormSubmit() { - document.body.addEventListener('submit', function (evt) { + DOM.addEventListener('submit', function (evt) { var target = evt.target; var action = target.action; @@ -65,9 +65,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa } return { - setters: [function (_coreJs) { - core = _coreJs; - }, function (_aureliaLogging) { + setters: [function (_coreJs) {}, function (_aureliaLogging) { TheLogManager = _aureliaLogging; }, function (_aureliaTemplating) { ViewEngine = _aureliaTemplating.ViewEngine; @@ -76,7 +74,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa ViewResources = _aureliaTemplating.ViewResources; CompositionEngine = _aureliaTemplating.CompositionEngine; Animator = _aureliaTemplating.Animator; - DOMBoundary = _aureliaTemplating.DOMBoundary; + templatingEngine = _aureliaTemplating.templatingEngine; for (var _key4 in _aureliaTemplating) { if (_key4 !== 'default') _export(_key4, _aureliaTemplating[_key4]); @@ -99,6 +97,13 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa for (var _key5 in _aureliaLoader) { if (_key5 !== 'default') _export(_key5, _aureliaLoader[_key5]); } + }, function (_aureliaPal) { + DOM = _aureliaPal.DOM; + PLATFORM = _aureliaPal.PLATFORM; + + for (var _key8 in _aureliaPal) { + if (_key8 !== 'default') _export(_key8, _aureliaPal[_key8]); + } }, function (_aureliaBinding) { for (var _key2 in _aureliaBinding) { if (_key2 !== 'default') _export(_key2, _aureliaBinding[_key2]); @@ -129,9 +134,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa this.postTasks = []; this.resourcesToLoad = {}; this.preTask(function () { - return System.normalize('aurelia-bootstrapper').then(function (bootstrapperName) { - return _this.bootstrapperName = bootstrapperName; - }); + return _this.bootstrapperName = aurelia.loader.normalizeSync('aurelia-bootstrapper'); }); this.postTask(function () { return loadResources(aurelia.container, _this.resourcesToLoad, aurelia.resources); @@ -216,13 +219,12 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa this.plugin(plugin); this.preTask(function () { - return System.normalize(name, _this2.bootstrapperName).then(function (normalizedName) { - normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; + var normalizedName = _this2.aurelia.loader.normalizeSync(name, _this2.bootstrapperName); + normalizedName = normalizedName.endsWith('.js') || normalizedName.endsWith('.ts') ? normalizedName.substring(0, normalizedName.length - 3) : normalizedName; - plugin.moduleId = normalizedName; - plugin.resourcesRelativeTo = normalizedName; - System.map[name] = normalizedName; - }); + plugin.moduleId = normalizedName; + plugin.resourcesRelativeTo = normalizedName; + _this2.aurelia.loader.map(name, normalizedName); }); return this; @@ -256,11 +258,10 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa var _this3 = this; this.preTask(function () { - return System.normalize('aurelia-logging-console', _this3.bootstrapperName).then(function (name) { - return _this3.aurelia.loader.loadModule(name).then(function (m) { - TheLogManager.addAppender(new m.ConsoleAppender()); - TheLogManager.setLevel(TheLogManager.logLevel.debug); - }); + var name = _this3.aurelia.loader.normalizeSync('aurelia-logging-console', _this3.bootstrapperName); + return _this3.aurelia.loader.loadModule(name).then(function (m) { + TheLogManager.addAppender(new m.ConsoleAppender()); + TheLogManager.setLevel(TheLogManager.logLevel.debug); }); }); @@ -299,27 +300,11 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa _export('FrameworkConfiguration', FrameworkConfiguration); - if (!window.CustomEvent || typeof window.CustomEvent !== 'function') { - _CustomEvent = function _CustomEvent(event, params) { - params = params || { - bubbles: false, - cancelable: false, - detail: undefined - }; - - var evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); - return evt; - }; - - _CustomEvent.prototype = window.Event.prototype; - window.CustomEvent = _CustomEvent; - } Aurelia = (function () { function Aurelia(loader, container, resources) { _classCallCheck(this, Aurelia); - this.loader = loader || new window.AureliaLoader(); + this.loader = loader || new PLATFORM.Loader(); this.container = container || new Container(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); @@ -346,19 +331,21 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa return this.use.apply().then(function () { preventActionlessFormSubmit(); - if (!_this5.container.hasHandler(BindingLanguage)) { + if (!_this5.container.hasResolver(BindingLanguage)) { var message = 'You must configure Aurelia with a BindingLanguage implementation.'; _this5.logger.error(message); throw new Error(message); } - if (!_this5.container.hasHandler(Animator)) { + if (!_this5.container.hasResolver(Animator)) { Animator.configureDefault(_this5.container); } + templatingEngine.initialize(_this5.container); + _this5.logger.info('Aurelia Started'); - var evt = new window.CustomEvent('aurelia-started', { bubbles: true, cancelable: true }); - document.dispatchEvent(evt); + var evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); + DOM.dispatchEvent(evt); return _this5; }); }; @@ -413,22 +400,26 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa applicationHost = applicationHost || this.host; if (!applicationHost || typeof applicationHost === 'string') { - this.host = document.getElementById(applicationHost || 'applicationHost') || document.body; + this.host = DOM.getElementById(applicationHost || 'applicationHost'); } else { this.host = applicationHost; } + if (!this.host) { + throw new Error('No applicationHost was specified.'); + } + this.hostConfigured = true; this.host.aurelia = this; this.hostSlot = new ViewSlot(this.host, true); this.hostSlot.transformChildNodesIntoView(); - this.container.registerInstance(DOMBoundary, this.host); + this.container.registerInstance(DOM.boundary, this.host); }; Aurelia.prototype._onAureliaComposed = function _onAureliaComposed() { - var evt = new window.CustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); + var evt = DOM.createCustomEvent('aurelia-composed', { bubbles: true, cancelable: true }); setTimeout(function () { - return document.dispatchEvent(evt); + return DOM.dispatchEvent(evt); }, 1); }; diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 7da83355..0abd27d3 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,113 @@ +## 0.17.0 (2015-10-13) + + +#### Bug Fixes + +* **all:** + * create a property framework configuration object ([bab4c776](http://github.com/aurelia/framework/commit/bab4c776f4266b727e4cf04b04ba409ead3bfeed)) + * update compiler and metadata plugin ([50e3afe0](http://github.com/aurelia/framework/commit/50e3afe0e5a4c6c0e15242433007e4fe068e35fc)) + * load resources by module id only ([655192b2](http://github.com/aurelia/framework/commit/655192b26f7c8b47fb57ad1522e85af58d971443)) +* **aurelia:** + * switch window loader check to platform loader check ([471d8c51](http://github.com/aurelia/framework/commit/471d8c516a423baf56e3af1f834f9c19fceb2808)) + * enable multiple calls to setRoot ([10708cae](http://github.com/aurelia/framework/commit/10708caefb9e26556c9c45686198f8c343de6a5d)) + * update to use ViewResources instead of ResourceRegistry ([f458a193](http://github.com/aurelia/framework/commit/f458a193f69dfa1d8174b2424ba81d5b864b7429)) + * throw a descriptive error when globalizeResources is called with non-strings ([09038c83](http://github.com/aurelia/framework/commit/09038c83b4ca02f2e55b30804b330c59207f682d)) + * update to use latest animator default config api ([5dea25b5](http://github.com/aurelia/framework/commit/5dea25b57512ccf4701daf6520c0156582a5182b)) + * update to use new view engine ([e6d20c42](http://github.com/aurelia/framework/commit/e6d20c42ead1f74652fb1bce5b5ae728b4b6bb77)) + * update to load global resources through new resource pipeline ([bdbca554](http://github.com/aurelia/framework/commit/bdbca554e8d0e7ee839fb1b3b8269f590bc7aa97)) + * global resources left out ([4bb098a3](http://github.com/aurelia/framework/commit/4bb098a36ea226dedc5343f3c629d889f9028580)) + * custom event undefined in local scope ([c3594bf9](http://github.com/aurelia/framework/commit/c3594bf9ae0b9836ef433d857f422131e65674c5)) + * ensure plugin resources are loaded first ([bffcd614](http://github.com/aurelia/framework/commit/bffcd6146167b1169d9d43acf4857be84636ccc7)) + * ensure all start code paths return a promise ([02752512](http://github.com/aurelia/framework/commit/0275251243271e30a7a484903ff0dd5a0da8eb80)) + * load groups of resources in order ([2d936e5f](http://github.com/aurelia/framework/commit/2d936e5f6d1750841e99180d72078416926326f1)) + * directly use app container to create root view model ([d86665b3](http://github.com/aurelia/framework/commit/d86665b390dbfa65f8c53c148adfc740d7e8ebb2)) + * remove dependency on event aggregator ([424fa2bf](http://github.com/aurelia/framework/commit/424fa2bf3b9d2a4b79c2bb5cec5ad45d87273327)) + * plugin loading module id fix ([ba79cb93](http://github.com/aurelia/framework/commit/ba79cb933e86e9cea6d391cb3664c82a31231f7e)) +* **build:** + * update linting, testing and tools ([ed65edc6](http://github.com/aurelia/framework/commit/ed65edc6cc7d6e6250ac6885f02780c0ea640cb4)) + * add missing bower bump ([111797ae](http://github.com/aurelia/framework/commit/111797ae2f669b3eb9a86538c23f5e537fc259c5)) +* **dts:** update promise-based apis ([94548514](http://github.com/aurelia/framework/commit/94548514165b1cb8ba0629f5e775d0d758630ce9)) +* **framework:** Use correct import for core-js ([da0756fd](http://github.com/aurelia/framework/commit/da0756fd94f5a60df5218ceaa09fdb3bb0e2ad27)) +* **framework-configuration:** + * add public properties ([a5b32853](http://github.com/aurelia/framework/commit/a5b3285341063578cdc8631533bf7c92ff7fe354), closes [#199](http://github.com/aurelia/framework/issues/199)) + * parameter config in feature and plugin method is optional ([b07c4817](http://github.com/aurelia/framework/commit/b07c481744746d95f60f0c5bebb3caf3306dea55)) + * improve standardConfiguration ([c91ea2b9](http://github.com/aurelia/framework/commit/c91ea2b9cf5e36042930bf48b27b7287f425067c)) + * correct type information ([f1fc9987](http://github.com/aurelia/framework/commit/f1fc998735d1821b2a29361bd9247077e646c1bc)) +* **index:** ensure export of path module api ([17cf46cd](http://github.com/aurelia/framework/commit/17cf46cdfbf4081e08c41db3c20a0590c885d254)) +* **package:** + * change jspm directories ([37f2670b](http://github.com/aurelia/framework/commit/37f2670b5498618a4b0602234008c2ed779bca4f)) + * update dependencies ([79feec43](http://github.com/aurelia/framework/commit/79feec432b8f3afd7a2ca90fc4eec2445e34940f)) + * update deps and fix bower semver ranges ([3f05b27e](http://github.com/aurelia/framework/commit/3f05b27ed1c7961fc5049f848ea2f220949d7414)) + * update dependencies ([b52b1b05](http://github.com/aurelia/framework/commit/b52b1b050a3d5809f7b0f602ebc8479f3d57eecb)) + * update Aurelia dependencies ([f9df6e55](http://github.com/aurelia/framework/commit/f9df6e55ab139d8589516d8ebdf4f27ae3f83b90)) + * update dependencies to latest ([bfcd292e](http://github.com/aurelia/framework/commit/bfcd292e5c26bde6b7064e866db566201f280b4f)) + * update templating to latest version ([63d4c5f6](http://github.com/aurelia/framework/commit/63d4c5f6db58a50f6e1776b2b4939ca81ce4edf5)) + * update templating to latest version ([5d1305e6](http://github.com/aurelia/framework/commit/5d1305e637d827f83c97df3e08db4f60f47915df)) + * update templating to latest version ([1e981956](http://github.com/aurelia/framework/commit/1e9819565f1e4fa024c38c1d08f05cc00757b96f)) + * update dependencies to latest versions ([12f0f9a8](http://github.com/aurelia/framework/commit/12f0f9a8af4d8178e80e87fc4ce7d9a8a53eba85)) + * update dependencies to latest versions ([5ca82ad1](http://github.com/aurelia/framework/commit/5ca82ad11adf1163e984e3fe05cd64a132990624)) + * update dependencies to their latest versions ([fe83ef37](http://github.com/aurelia/framework/commit/fe83ef37fdcdf878dd79564ed9b97ee56de8d621)) +* **plugin:** + * add feature api and prepare for jspm beta ([5f0b7cf3](http://github.com/aurelia/framework/commit/5f0b7cf35c7c7b445f06b237aab704ceb44c88ae)) + * make api use configure like other apis in framework ([cbfdaad7](http://github.com/aurelia/framework/commit/cbfdaad764abca997a15302073819d0723ccd32a), closes [#96](http://github.com/aurelia/framework/issues/96)) +* **plugins:** + * preserve built-in plugin load order ([25a35297](http://github.com/aurelia/framework/commit/25a35297cb330bdbac7796a20b4ad6842e8de477)) + * address changes in jspm/system.js beta ([90afee4d](http://github.com/aurelia/framework/commit/90afee4de0770c576fb8fd4f0af5fb3191833f0f)) + * removed unnecessary es5 helper support ([710499a8](http://github.com/aurelia/framework/commit/710499a896ccbc6d787b29aa8da8aeb373bfae8f)) + * set es5 computed properties correctly ([f1b140d9](http://github.com/aurelia/framework/commit/f1b140d9d2c846cc75e986d6fb967132d82df5e1)) + * enable relative path plugins ([7cbe4d22](http://github.com/aurelia/framework/commit/7cbe4d22e47ef586a4800d1104ff90d15ff93b98)) + * language helpers should return this for chaining ([d8817425](http://github.com/aurelia/framework/commit/d8817425e1ca618d752e9708e76674a3fb6e1191)) + * install sequentially ([cc78f9a0](http://github.com/aurelia/framework/commit/cc78f9a07974df00c1dcd88b6c71afcf1e52fcc9)) + * ensure plugin installation can only happen once ([9b37c848](http://github.com/aurelia/framework/commit/9b37c8485ce7d966e1f10eb66f088e341d9a4d4e)) + + +#### Features + +* **all:** + * incorporate pal ([4bc75161](http://github.com/aurelia/framework/commit/4bc75161d39696e0db11582dea8c4693d0852869)) + * update to new loader apis to remove global System ([07bd2982](http://github.com/aurelia/framework/commit/07bd29827df73ba52cdf67450469efcda39cda59)) +* **aurelia:** + * initialize new templatingEngine api ([e60e5163](http://github.com/aurelia/framework/commit/e60e516310ac8eb2ee3b69915ad82d36949bc324)) + * initialize the binding system ([d6f569f7](http://github.com/aurelia/framework/commit/d6f569f70879bfabd4a09d543495d0335b582bd9)) + * add preliminary enhance api ([f970c65c](http://github.com/aurelia/framework/commit/f970c65c2053391a5b6bd79079102fde8c750612)) + * configure host as root dom boundary ([5a99ab02](http://github.com/aurelia/framework/commit/5a99ab0284813eba42b579058e3059a756ca485d)) + * update to use composition host instruction value ([bd456bc5](http://github.com/aurelia/framework/commit/bd456bc5411ed7f122bc14a2ecc0d7b0cc2f192b)) + * take advantage of previously configured host ([0c5bbcd7](http://github.com/aurelia/framework/commit/0c5bbcd799be99958dcea3c3a1f850bdd43700a4)) + * add parameter default to setRoot ([f3955d22](http://github.com/aurelia/framework/commit/f3955d228483758ce8b385bba14d99e053468612)) + * ensure animator implementation ([e3ab3ab0](http://github.com/aurelia/framework/commit/e3ab3ab08aac022d0c7b58ddef7b8632f2e5f980)) + * raise DOM events for start and compose ([feed2a3a](http://github.com/aurelia/framework/commit/feed2a3a05fe8cd9f5463a84ddb692aba4912193)) + * enable splash screen swaps on load ([c2135d41](http://github.com/aurelia/framework/commit/c2135d41333328a2c7a6acfe4e0325d5c6bfb090)) + * set root sets element in container and uses composition engine ([9f6fa60d](http://github.com/aurelia/framework/commit/9f6fa60d27dc7e9d418970925df2fc23514c1422)) +* **build:** + * add command line argument for semver bump. resolve #28 ([39652c80](http://github.com/aurelia/framework/commit/39652c8026dd26e459ed5e84a0924e1f58724d53)) + * update compiler and switch to register module format ([63c5d367](http://github.com/aurelia/framework/commit/63c5d367ed576a4350fcf6bfc3d87b4d55370372)) +* **docs:** + * generate api.json from .d.ts file ([38c06e2c](http://github.com/aurelia/framework/commit/38c06e2ce93b22244950cf57e97e28493fc2334b)) + * generate api.json from .d.ts file ([1e2af71b](http://github.com/aurelia/framework/commit/1e2af71bf0aee020033cef33faaca1b869e7b5d9)) + * generate api.json from .d.ts file ([a6960cbc](http://github.com/aurelia/framework/commit/a6960cbc6e171142c3a3b8dada4915e11b433ecc)) +* **framework:** + * prevent forms without [action] from submiting ([a5805257](http://github.com/aurelia/framework/commit/a58052571281cce001089bc065858e47ee595874)) + * enable plugin loading and config ([f3b02ea9](http://github.com/aurelia/framework/commit/f3b02ea96c0a607b77bb7fbc7e0389748fb07c12)) +* **index:** export all from pal ([10ca62bb](http://github.com/aurelia/framework/commit/10ca62bbd93c06ffac05f6dc060b65fa62d57369)) +* **plugins:** + * better api by moving some bootstrapper code directly into aurelia ([f76baf08](http://github.com/aurelia/framework/commit/f76baf084f382c168d3a2225df091df5d36f9a50)) + * remove AtScript support ([f1adb01a](http://github.com/aurelia/framework/commit/f1adb01ab32afcd8ba3b427e9274f72fb4d56fda)) + * update to use new metadata locator function ([4b09490d](http://github.com/aurelia/framework/commit/4b09490daf7f351e1001557c8e8a8032bdadbf1c)) + * support legacy atscript annotation location ([37463681](http://github.com/aurelia/framework/commit/374636810d3e5249b3f1d8d6b4767f97c21a1240)) + * update atscript helper to use new metadata api ([c9b4fb99](http://github.com/aurelia/framework/commit/c9b4fb99b1ac32fb71a69ad8e945cd4a208ca1eb)) + * enable loading after bootstrapped ([790c9da2](http://github.com/aurelia/framework/commit/790c9da2ba89018d25f1dcf6c929b421f47c0b73)) + * new plugin api including explicit support for es5 and at script ([b5c588bc](http://github.com/aurelia/framework/commit/b5c588bc716955273833ebbeabb33deb431bda5d)) + * track plugin id for relative resource loading without system hack ([3465e849](http://github.com/aurelia/framework/commit/3465e84963e871b713cc4c3ca049eb459023ec9e)) + + +#### Breaking Changes + +* If you were using ES5 and used the computed helper on +function, this will affect you as that is no longer present. + + ([710499a8](http://github.com/aurelia/framework/commit/710499a896ccbc6d787b29aa8da8aeb373bfae8f)) + + ## 0.16.0 (2015-09-05) diff --git a/doc/api.json b/doc/api.json index 5adb5be1..a3ed5016 100644 --- a/doc/api.json +++ b/doc/api.json @@ -61,7 +61,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 1473, + "id": 1506, "moduleName": "\"aurelia-loader\"" } }, @@ -76,7 +76,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1367, + "id": 1386, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -91,7 +91,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 1907, + "id": 2074, "moduleName": "\"aurelia-templating\"" } } @@ -116,7 +116,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1367, + "id": 1386, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -131,7 +131,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 1473, + "id": 1506, "moduleName": "\"aurelia-loader\"" } }, @@ -146,7 +146,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 1907, + "id": 2074, "moduleName": "\"aurelia-templating\"" } }, @@ -446,7 +446,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1367, + "id": 1386, "moduleName": "\"aurelia-dependency-injection\"" } }, diff --git a/package.json b/package.json index 6f396876..8b1f8240 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.16.0", + "version": "0.17.0", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", @@ -25,19 +25,19 @@ "lib": "dist/amd" }, "dependencies": { - "aurelia-binding": "github:aurelia/binding@^0.9.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.10.0", - "aurelia-loader": "github:aurelia/loader@^0.9.0", - "aurelia-logging": "github:aurelia/logging@^0.7.0", - "aurelia-metadata": "github:aurelia/metadata@^0.8.0", - "aurelia-pal": "github:aurelia/pal@^0.1.10", - "aurelia-path": "github:aurelia/path@^0.9.0", - "aurelia-task-queue": "github:aurelia/task-queue@^0.7.0", - "aurelia-templating": "github:aurelia/templating@^0.15.0", + "aurelia-binding": "github:aurelia/binding@^0.10.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.11.0", + "aurelia-loader": "github:aurelia/loader@^0.10.0", + "aurelia-logging": "github:aurelia/logging@^0.8.0", + "aurelia-metadata": "github:aurelia/metadata@^0.9.0", + "aurelia-pal": "github:aurelia/pal@^0.2.0", + "aurelia-path": "github:aurelia/path@^0.10.0", + "aurelia-task-queue": "github:aurelia/task-queue@^0.8.0", + "aurelia-templating": "github:aurelia/templating@^0.16.0", "core-js": "npm:core-js@^0.9.5" }, "devDependencies": { - "aurelia-pal-browser": "github:aurelia/pal-browser@^0.1.13", + "aurelia-pal-browser": "github:aurelia/pal-browser@^0.2.0", "babel": "npm:babel-core@^5.1.13", "babel-runtime": "npm:babel-runtime@^5.1.13", "core-js": "npm:core-js@^0.9.5" @@ -74,30 +74,8 @@ "yargs": "^2.1.1" }, "aurelia": { - "usedBy": [ - "aurelia-bootstrapper" - ], "documentation": { - "links": [ - { - "rel": "license", - "mediaType": "text/plain", - "title": "The MIT License (MIT)", - "href": "LICENSE" - }, - { - "rel": "describedby", - "mediaType": "application/aurelia-doc+json", - "title": "API", - "href": "doc/api.json" - }, - { - "rel": "version-history", - "mediaType": "text/markdown", - "title": "Change Log", - "href": "doc/CHANGELOG.md" - } - ] + "articles": [] } } } From 37f5fbf9ed7146542c3019e2274d08c9003b14a2 Mon Sep 17 00:00:00 2001 From: Jeremy Danyow Date: Wed, 21 Oct 2015 07:46:36 -0400 Subject: [PATCH 009/549] chore(templating-engine): remove templatingEngine initialize The templatingEngine static object has been converted to a class. The initialize call is no longer necessary. --- src/aurelia.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/aurelia.js b/src/aurelia.js index 58d5dee1..b1efadcf 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -3,7 +3,7 @@ import 'core-js'; import * as TheLogManager from 'aurelia-logging'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; -import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine} from 'aurelia-templating'; +import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator} from 'aurelia-templating'; import {DOM, PLATFORM} from 'aurelia-pal'; import {FrameworkConfiguration} from './framework-configuration'; @@ -70,8 +70,6 @@ export class Aurelia { Animator.configureDefault(this.container); } - templatingEngine.initialize(this.container); - this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); DOM.dispatchEvent(evt); From c59cf2486bf73b68fa743f9a09eaa38c66fe86d2 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Fri, 23 Oct 2015 22:51:19 -0400 Subject: [PATCH 010/549] doc(all): lock down api and finalize api docs --- dist/amd/aurelia-framework.d.ts | 58 +++++++++++--- dist/amd/aurelia-framework.js | 3 +- dist/aurelia-framework.d.ts | 58 +++++++++++--- dist/aurelia-framework.js | 54 +++++++++---- dist/commonjs/aurelia-framework.d.ts | 58 +++++++++++--- dist/commonjs/aurelia-framework.js | 3 +- dist/es6/aurelia-framework.d.ts | 58 +++++++++++--- dist/es6/aurelia-framework.js | 54 +++++++++---- dist/system/aurelia-framework.d.ts | 58 +++++++++++--- dist/system/aurelia-framework.js | 3 +- doc/api.json | 109 ++++++++++++++++++--------- src/aurelia.js | 39 +++++++--- src/framework-configuration.js | 12 ++- src/index.js | 4 + 14 files changed, 436 insertions(+), 135 deletions(-) diff --git a/dist/amd/aurelia-framework.d.ts b/dist/amd/aurelia-framework.d.ts index 768caee6..0959411f 100644 --- a/dist/amd/aurelia-framework.d.ts +++ b/dist/amd/aurelia-framework.d.ts @@ -9,11 +9,23 @@ declare module 'aurelia-framework' { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia); /** @@ -136,20 +148,40 @@ declare module 'aurelia-framework' { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + + /** + * The loader used by the application. + */ loader: Loader; + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources); /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise; @@ -157,17 +189,17 @@ declare module 'aurelia-framework' { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext?: Object, applicationHost?: any): Promise; + enhance(bindingContext?: Object, applicationHost?: string | Element): Promise; /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root?: string, applicationHost?: any): Promise; + setRoot(root?: string, applicationHost?: string | Element): Promise; } export * from 'aurelia-dependency-injection'; export * from 'aurelia-binding'; @@ -177,5 +209,9 @@ declare module 'aurelia-framework' { export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; + + /** + * The log manager. + */ export const LogManager: any; } \ No newline at end of file diff --git a/dist/amd/aurelia-framework.js b/dist/amd/aurelia-framework.js index 0f67bd2d..0bdfca10 100644 --- a/dist/amd/aurelia-framework.js +++ b/dist/amd/aurelia-framework.js @@ -255,7 +255,7 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- _classCallCheck(this, Aurelia); this.loader = loader || new _aureliaPal.PLATFORM.Loader(); - this.container = container || new _aureliaDependencyInjection.Container(); + this.container = container || new _aureliaDependencyInjection.Container().makeGlobal(); this.resources = resources || new _aureliaTemplating.ViewResources(); this.use = new FrameworkConfiguration(this); this.logger = _aureliaLogging.getLogger('aurelia'); @@ -265,7 +265,6 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- this.use.instance(Aurelia, this); this.use.instance(_aureliaLoader.Loader, this.loader); this.use.instance(_aureliaTemplating.ViewResources, this.resources); - this.container.makeGlobal(); } Aurelia.prototype.start = function start() { diff --git a/dist/aurelia-framework.d.ts b/dist/aurelia-framework.d.ts index 768caee6..0959411f 100644 --- a/dist/aurelia-framework.d.ts +++ b/dist/aurelia-framework.d.ts @@ -9,11 +9,23 @@ declare module 'aurelia-framework' { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia); /** @@ -136,20 +148,40 @@ declare module 'aurelia-framework' { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + + /** + * The loader used by the application. + */ loader: Loader; + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources); /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise; @@ -157,17 +189,17 @@ declare module 'aurelia-framework' { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext?: Object, applicationHost?: any): Promise; + enhance(bindingContext?: Object, applicationHost?: string | Element): Promise; /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root?: string, applicationHost?: any): Promise; + setRoot(root?: string, applicationHost?: string | Element): Promise; } export * from 'aurelia-dependency-injection'; export * from 'aurelia-binding'; @@ -177,5 +209,9 @@ declare module 'aurelia-framework' { export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; + + /** + * The log manager. + */ export const LogManager: any; } \ No newline at end of file diff --git a/dist/aurelia-framework.js b/dist/aurelia-framework.js index 8ce9c901..9b0dcdde 100644 --- a/dist/aurelia-framework.js +++ b/dist/aurelia-framework.js @@ -59,12 +59,22 @@ function assertProcessed(plugins) { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia) { this.aurelia = aurelia; this.container = aurelia.container; @@ -322,19 +332,35 @@ function preventActionlessFormSubmit() { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + /** + * The loader used by the application. + */ loader: Loader; + /** + * The root DI container used by the application. + */ container: Container; + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources) { this.loader = loader || new PLATFORM.Loader(); - this.container = container || new Container(); + this.container = container || (new Container()).makeGlobal(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); this.logger = TheLogManager.getLogger('aurelia'); @@ -344,12 +370,11 @@ export class Aurelia { this.use.instance(Aurelia, this); this.use.instance(Loader, this.loader); this.use.instance(ViewResources, this.resources); - this.container.makeGlobal(); } /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise { if (this.started) { @@ -385,9 +410,9 @@ export class Aurelia { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext: Object = {}, applicationHost = null): Promise { + enhance(bindingContext: Object = {}, applicationHost: string | Element = null): Promise { this._configureHost(applicationHost); return new Promise(resolve => { @@ -400,12 +425,12 @@ export class Aurelia { } /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root: string = 'app', applicationHost = null): Promise { + setRoot(root: string = 'app', applicationHost: string | Element = null): Promise { let compositionEngine; let instruction = {}; @@ -464,4 +489,7 @@ export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; +/** + * The log manager. + */ export const LogManager = TheLogManager; diff --git a/dist/commonjs/aurelia-framework.d.ts b/dist/commonjs/aurelia-framework.d.ts index 768caee6..0959411f 100644 --- a/dist/commonjs/aurelia-framework.d.ts +++ b/dist/commonjs/aurelia-framework.d.ts @@ -9,11 +9,23 @@ declare module 'aurelia-framework' { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia); /** @@ -136,20 +148,40 @@ declare module 'aurelia-framework' { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + + /** + * The loader used by the application. + */ loader: Loader; + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources); /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise; @@ -157,17 +189,17 @@ declare module 'aurelia-framework' { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext?: Object, applicationHost?: any): Promise; + enhance(bindingContext?: Object, applicationHost?: string | Element): Promise; /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root?: string, applicationHost?: any): Promise; + setRoot(root?: string, applicationHost?: string | Element): Promise; } export * from 'aurelia-dependency-injection'; export * from 'aurelia-binding'; @@ -177,5 +209,9 @@ declare module 'aurelia-framework' { export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; + + /** + * The log manager. + */ export const LogManager: any; } \ No newline at end of file diff --git a/dist/commonjs/aurelia-framework.js b/dist/commonjs/aurelia-framework.js index c8bf124b..9d3cb38e 100644 --- a/dist/commonjs/aurelia-framework.js +++ b/dist/commonjs/aurelia-framework.js @@ -272,7 +272,7 @@ var Aurelia = (function () { _classCallCheck(this, Aurelia); this.loader = loader || new _aureliaPal.PLATFORM.Loader(); - this.container = container || new _aureliaDependencyInjection.Container(); + this.container = container || new _aureliaDependencyInjection.Container().makeGlobal(); this.resources = resources || new _aureliaTemplating.ViewResources(); this.use = new FrameworkConfiguration(this); this.logger = TheLogManager.getLogger('aurelia'); @@ -282,7 +282,6 @@ var Aurelia = (function () { this.use.instance(Aurelia, this); this.use.instance(_aureliaLoader.Loader, this.loader); this.use.instance(_aureliaTemplating.ViewResources, this.resources); - this.container.makeGlobal(); } Aurelia.prototype.start = function start() { diff --git a/dist/es6/aurelia-framework.d.ts b/dist/es6/aurelia-framework.d.ts index 768caee6..0959411f 100644 --- a/dist/es6/aurelia-framework.d.ts +++ b/dist/es6/aurelia-framework.d.ts @@ -9,11 +9,23 @@ declare module 'aurelia-framework' { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia); /** @@ -136,20 +148,40 @@ declare module 'aurelia-framework' { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + + /** + * The loader used by the application. + */ loader: Loader; + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources); /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise; @@ -157,17 +189,17 @@ declare module 'aurelia-framework' { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext?: Object, applicationHost?: any): Promise; + enhance(bindingContext?: Object, applicationHost?: string | Element): Promise; /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root?: string, applicationHost?: any): Promise; + setRoot(root?: string, applicationHost?: string | Element): Promise; } export * from 'aurelia-dependency-injection'; export * from 'aurelia-binding'; @@ -177,5 +209,9 @@ declare module 'aurelia-framework' { export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; + + /** + * The log manager. + */ export const LogManager: any; } \ No newline at end of file diff --git a/dist/es6/aurelia-framework.js b/dist/es6/aurelia-framework.js index 8ce9c901..9b0dcdde 100644 --- a/dist/es6/aurelia-framework.js +++ b/dist/es6/aurelia-framework.js @@ -59,12 +59,22 @@ function assertProcessed(plugins) { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia) { this.aurelia = aurelia; this.container = aurelia.container; @@ -322,19 +332,35 @@ function preventActionlessFormSubmit() { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + /** + * The loader used by the application. + */ loader: Loader; + /** + * The root DI container used by the application. + */ container: Container; + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources) { this.loader = loader || new PLATFORM.Loader(); - this.container = container || new Container(); + this.container = container || (new Container()).makeGlobal(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); this.logger = TheLogManager.getLogger('aurelia'); @@ -344,12 +370,11 @@ export class Aurelia { this.use.instance(Aurelia, this); this.use.instance(Loader, this.loader); this.use.instance(ViewResources, this.resources); - this.container.makeGlobal(); } /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise { if (this.started) { @@ -385,9 +410,9 @@ export class Aurelia { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext: Object = {}, applicationHost = null): Promise { + enhance(bindingContext: Object = {}, applicationHost: string | Element = null): Promise { this._configureHost(applicationHost); return new Promise(resolve => { @@ -400,12 +425,12 @@ export class Aurelia { } /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root: string = 'app', applicationHost = null): Promise { + setRoot(root: string = 'app', applicationHost: string | Element = null): Promise { let compositionEngine; let instruction = {}; @@ -464,4 +489,7 @@ export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; +/** + * The log manager. + */ export const LogManager = TheLogManager; diff --git a/dist/system/aurelia-framework.d.ts b/dist/system/aurelia-framework.d.ts index 768caee6..0959411f 100644 --- a/dist/system/aurelia-framework.d.ts +++ b/dist/system/aurelia-framework.d.ts @@ -9,11 +9,23 @@ declare module 'aurelia-framework' { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia); /** @@ -136,20 +148,40 @@ declare module 'aurelia-framework' { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + + /** + * The loader used by the application. + */ loader: Loader; + + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources); /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise; @@ -157,17 +189,17 @@ declare module 'aurelia-framework' { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext?: Object, applicationHost?: any): Promise; + enhance(bindingContext?: Object, applicationHost?: string | Element): Promise; /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root?: string, applicationHost?: any): Promise; + setRoot(root?: string, applicationHost?: string | Element): Promise; } export * from 'aurelia-dependency-injection'; export * from 'aurelia-binding'; @@ -177,5 +209,9 @@ declare module 'aurelia-framework' { export * from 'aurelia-task-queue'; export * from 'aurelia-path'; export * from 'aurelia-pal'; + + /** + * The log manager. + */ export const LogManager: any; } \ No newline at end of file diff --git a/dist/system/aurelia-framework.js b/dist/system/aurelia-framework.js index 46a9e630..140380de 100644 --- a/dist/system/aurelia-framework.js +++ b/dist/system/aurelia-framework.js @@ -305,7 +305,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa _classCallCheck(this, Aurelia); this.loader = loader || new PLATFORM.Loader(); - this.container = container || new Container(); + this.container = container || new Container().makeGlobal(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); this.logger = TheLogManager.getLogger('aurelia'); @@ -315,7 +315,6 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa this.use.instance(Aurelia, this); this.use.instance(Loader, this.loader); this.use.instance(ViewResources, this.resources); - this.container.makeGlobal(); } Aurelia.prototype.start = function start() { diff --git a/doc/api.json b/doc/api.json index a3ed5016..8b3a4d2a 100644 --- a/doc/api.json +++ b/doc/api.json @@ -14,24 +14,7 @@ "isExported": true }, "comment": { - "shortText": "The framework core that provides the main Aurelia object.", - "tags": [ - { - "tag": "param", - "text": "The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader.", - "param": "loader" - }, - { - "tag": "param", - "text": "The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container.", - "param": "container" - }, - { - "tag": "param", - "text": "The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.\n", - "param": "resources" - } - ] + "shortText": "The framework core that provides the main Aurelia object." }, "children": [ { @@ -42,6 +25,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "Creates an instance of Aurelia." + }, "signatures": [ { "id": 64, @@ -49,6 +35,9 @@ "kind": 16384, "kindString": "Constructor signature", "flags": {}, + "comment": { + "shortText": "Creates an instance of Aurelia." + }, "parameters": [ { "id": 65, @@ -58,6 +47,9 @@ "flags": { "isOptional": true }, + "comment": { + "shortText": "The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader." + }, "type": { "type": "reference", "name": "Loader", @@ -73,6 +65,9 @@ "flags": { "isOptional": true }, + "comment": { + "shortText": "The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container." + }, "type": { "type": "reference", "name": "Container", @@ -88,6 +83,9 @@ "flags": { "isOptional": true }, + "comment": { + "shortText": "The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry.\n" + }, "type": { "type": "reference", "name": "ViewResources", @@ -113,6 +111,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The root DI container used by the application." + }, "type": { "type": "reference", "name": "Container", @@ -128,6 +129,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The loader used by the application." + }, "type": { "type": "reference", "name": "Loader", @@ -143,6 +147,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The global view resources used by the application." + }, "type": { "type": "reference", "name": "ViewResources", @@ -158,6 +165,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The configuration used during application startup." + }, "type": { "type": "reference", "name": "FrameworkConfiguration", @@ -182,7 +192,7 @@ "flags": {}, "comment": { "shortText": "Enhances the host's existing elements with behaviors and bindings.", - "returns": "Returns the current Aurelia instance.\n" + "returns": "Returns a Promise for the current Aurelia instance.\n" }, "parameters": [ { @@ -213,8 +223,17 @@ "text": "The DOM object that Aurelia will enhance." }, "type": { - "type": "instrinct", - "name": "any" + "type": "union", + "types": [ + { + "type": "instrinct", + "name": "string" + }, + { + "type": "reference", + "name": "Element" + } + ] } } ], @@ -248,8 +267,8 @@ "kindString": "Call signature", "flags": {}, "comment": { - "shortText": "Instantiates the root view-model and view and add them to the DOM.", - "returns": "Returns the current Aurelia instance.\n" + "shortText": "Instantiates the root component and adds it to the DOM.", + "returns": "Returns a Promise of the current Aurelia instance.\n" }, "parameters": [ { @@ -261,7 +280,7 @@ "isOptional": true }, "comment": { - "text": "The root view-model to load upon bootstrap." + "text": "The root component to load upon bootstrap." }, "type": { "type": "instrinct", @@ -280,8 +299,17 @@ "text": "The DOM object that Aurelia will attach to." }, "type": { - "type": "instrinct", - "name": "any" + "type": "union", + "types": [ + { + "type": "instrinct", + "name": "string" + }, + { + "type": "reference", + "name": "Element" + } + ] } } ], @@ -316,7 +344,7 @@ "flags": {}, "comment": { "shortText": "Loads plugins, then resources, and then starts the Aurelia instance.", - "returns": "Returns the started Aurelia instance.\n" + "returns": "Returns a Promise with the started Aurelia instance.\n" }, "type": { "type": "reference", @@ -371,14 +399,7 @@ "isExported": true }, "comment": { - "shortText": "Manages configuring the aurelia framework instance.", - "tags": [ - { - "tag": "param", - "text": "An instance of Aurelia.\n", - "param": "aurelia" - } - ] + "shortText": "Manages configuring the aurelia framework instance." }, "children": [ { @@ -389,6 +410,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "Creates an instance of FrameworkConfiguration." + }, "signatures": [ { "id": 7, @@ -396,6 +420,9 @@ "kind": 16384, "kindString": "Constructor signature", "flags": {}, + "comment": { + "shortText": "Creates an instance of FrameworkConfiguration." + }, "parameters": [ { "id": 8, @@ -403,6 +430,9 @@ "kind": 32768, "kindString": "Parameter", "flags": {}, + "comment": { + "shortText": "An instance of Aurelia.\n" + }, "type": { "type": "reference", "name": "Aurelia", @@ -428,6 +458,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The aurelia instance." + }, "type": { "type": "reference", "name": "Aurelia", @@ -443,6 +476,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The root DI container used by the application." + }, "type": { "type": "reference", "name": "Container", @@ -1226,6 +1262,9 @@ "flags": { "isExported": true }, + "comment": { + "shortText": "The log manager." + }, "type": { "type": "instrinct", "name": "any" diff --git a/src/aurelia.js b/src/aurelia.js index b1efadcf..6189ebf9 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -20,19 +20,35 @@ function preventActionlessFormSubmit() { /** * The framework core that provides the main Aurelia object. - * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use a defaultLoader. - * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty container. - * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. */ export class Aurelia { + /** + * The loader used by the application. + */ loader: Loader; + /** + * The root DI container used by the application. + */ container: Container; + /** + * The global view resources used by the application. + */ resources: ViewResources; + + /** + * The configuration used during application startup. + */ use: FrameworkConfiguration; + /** + * Creates an instance of Aurelia. + * @param loader The loader for this Aurelia instance to use. If a loader is not specified, Aurelia will use the loader type specified by PLATFORM.Loader. + * @param container The dependency injection container for this Aurelia instance to use. If a container is not specified, Aurelia will create an empty, global container. + * @param resources The resource registry for this Aurelia instance to use. If a resource registry is not specified, Aurelia will create an empty registry. + */ constructor(loader?: Loader, container?: Container, resources?: ViewResources) { this.loader = loader || new PLATFORM.Loader(); - this.container = container || new Container(); + this.container = container || (new Container()).makeGlobal(); this.resources = resources || new ViewResources(); this.use = new FrameworkConfiguration(this); this.logger = TheLogManager.getLogger('aurelia'); @@ -42,12 +58,11 @@ export class Aurelia { this.use.instance(Aurelia, this); this.use.instance(Loader, this.loader); this.use.instance(ViewResources, this.resources); - this.container.makeGlobal(); } /** * Loads plugins, then resources, and then starts the Aurelia instance. - * @return Returns the started Aurelia instance. + * @return Returns a Promise with the started Aurelia instance. */ start(): Promise { if (this.started) { @@ -81,9 +96,9 @@ export class Aurelia { * Enhances the host's existing elements with behaviors and bindings. * @param bindingContext A binding context for the enhanced elements. * @param applicationHost The DOM object that Aurelia will enhance. - * @return Returns the current Aurelia instance. + * @return Returns a Promise for the current Aurelia instance. */ - enhance(bindingContext: Object = {}, applicationHost = null): Promise { + enhance(bindingContext: Object = {}, applicationHost: string | Element = null): Promise { this._configureHost(applicationHost); return new Promise(resolve => { @@ -96,12 +111,12 @@ export class Aurelia { } /** - * Instantiates the root view-model and view and add them to the DOM. - * @param root The root view-model to load upon bootstrap. + * Instantiates the root component and adds it to the DOM. + * @param root The root component to load upon bootstrap. * @param applicationHost The DOM object that Aurelia will attach to. - * @return Returns the current Aurelia instance. + * @return Returns a Promise of the current Aurelia instance. */ - setRoot(root: string = 'app', applicationHost = null): Promise { + setRoot(root: string = 'app', applicationHost: string | Element = null): Promise { let compositionEngine; let instruction = {}; diff --git a/src/framework-configuration.js b/src/framework-configuration.js index bf96be7b..fb63e801 100644 --- a/src/framework-configuration.js +++ b/src/framework-configuration.js @@ -57,12 +57,22 @@ function assertProcessed(plugins) { /** * Manages configuring the aurelia framework instance. - * @param {Aurelia} aurelia An instance of Aurelia. */ export class FrameworkConfiguration { + /** + * The root DI container used by the application. + */ container: Container; + + /** + * The aurelia instance. + */ aurelia: Aurelia; + /** + * Creates an instance of FrameworkConfiguration. + * @param aurelia An instance of Aurelia. + */ constructor(aurelia: Aurelia) { this.aurelia = aurelia; this.container = aurelia.container; diff --git a/src/index.js b/src/index.js index 1acf1783..7dfc21fa 100644 --- a/src/index.js +++ b/src/index.js @@ -8,4 +8,8 @@ export * from 'aurelia-path'; export * from 'aurelia-pal'; import * as TheLogManager from 'aurelia-logging'; + +/** + * The log manager. + */ export const LogManager = TheLogManager; From edf2b5f8e5a47984219e2be26d7b762b9d7eab7c Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Mon, 26 Oct 2015 21:06:12 -0400 Subject: [PATCH 011/549] fix(all): update to work with latest TemplatingEngine --- src/aurelia.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/aurelia.js b/src/aurelia.js index 6189ebf9..8429a7ee 100644 --- a/src/aurelia.js +++ b/src/aurelia.js @@ -3,7 +3,7 @@ import 'core-js'; import * as TheLogManager from 'aurelia-logging'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; -import {BindingLanguage, ViewEngine, ViewSlot, ViewResources, CompositionEngine, Animator} from 'aurelia-templating'; +import {BindingLanguage, ViewSlot, ViewResources, TemplatingEngine} from 'aurelia-templating'; import {DOM, PLATFORM} from 'aurelia-pal'; import {FrameworkConfiguration} from './framework-configuration'; @@ -81,10 +81,6 @@ export class Aurelia { throw new Error(message); } - if (!this.container.hasResolver(Animator)) { - Animator.configureDefault(this.container); - } - this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); DOM.dispatchEvent(evt); @@ -102,8 +98,8 @@ export class Aurelia { this._configureHost(applicationHost); return new Promise(resolve => { - let viewEngine = this.container.get(ViewEngine); - this.root = viewEngine.enhance(this.container, this.host, this.resources, bindingContext); + let engine = this.container.get(TemplatingEngine); + this.root = engine.enhance({container: this.container, element: this.host, resources: this.resources, bindingContext: bindingContext}); this.root.attached(); this._onAureliaComposed(); return this; @@ -117,18 +113,18 @@ export class Aurelia { * @return Returns a Promise of the current Aurelia instance. */ setRoot(root: string = 'app', applicationHost: string | Element = null): Promise { - let compositionEngine; + let engine; let instruction = {}; this._configureHost(applicationHost); - compositionEngine = this.container.get(CompositionEngine); + engine = this.container.get(TemplatingEngine); instruction.viewModel = root; instruction.container = instruction.childContainer = this.container; instruction.viewSlot = this.hostSlot; instruction.host = this.host; - return compositionEngine.compose(instruction).then(r => { + return engine.compose(instruction).then(r => { this.root = r; instruction.viewSlot.attached(); this._onAureliaComposed(); From 5eeaef0e5807dcde28bb87c8856d5586bed4750c Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Tue, 10 Nov 2015 11:02:56 -0500 Subject: [PATCH 012/549] chore(package): update dependencies --- bower.json | 18 ++++----- config.js | 108 ++++++++++++++++++++++++++------------------------- package.json | 26 ++++++------- 3 files changed, 77 insertions(+), 75 deletions(-) diff --git a/bower.json b/bower.json index 53be3392..bfa4000e 100644 --- a/bower.json +++ b/bower.json @@ -17,15 +17,15 @@ "url": "http://github.com/aurelia/framework" }, "dependencies": { - "aurelia-binding": "^0.10.0", - "aurelia-dependency-injection": "^0.11.0", - "aurelia-loader": "^0.10.0", - "aurelia-logging": "^0.8.0", - "aurelia-metadata": "^0.9.0", - "aurelia-pal": "^0.2.0", - "aurelia-path": "^0.10.0", - "aurelia-task-queue": "^0.8.0", - "aurelia-templating": "^0.16.0", + "aurelia-binding": "^0.11.0", + "aurelia-dependency-injection": "^0.12.0", + "aurelia-loader": "^0.11.0", + "aurelia-logging": "^0.9.0", + "aurelia-metadata": "^0.10.0", + "aurelia-pal": "^0.3.0", + "aurelia-path": "^0.11.0", + "aurelia-task-queue": "^0.9.0", + "aurelia-templating": "^0.17.0", "core-js": "zloirock/core-js" } } diff --git a/config.js b/config.js index dd240f57..8ef35648 100644 --- a/config.js +++ b/config.js @@ -14,59 +14,62 @@ System.config({ }, map: { - "aurelia-binding": "github:aurelia/binding@0.10.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.11.0", - "aurelia-loader": "github:aurelia/loader@0.10.0", - "aurelia-logging": "github:aurelia/logging@0.8.0", - "aurelia-metadata": "github:aurelia/metadata@0.9.0", - "aurelia-pal": "github:aurelia/pal@0.2.0", - "aurelia-pal-browser": "github:aurelia/pal-browser@0.2.0", - "aurelia-path": "github:aurelia/path@0.10.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.8.0", - "aurelia-templating": "github:aurelia/templating@0.16.0", + "aurelia-binding": "github:aurelia/binding@0.11.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.12.0", + "aurelia-loader": "github:aurelia/loader@0.11.0", + "aurelia-logging": "github:aurelia/logging@0.9.0", + "aurelia-metadata": "github:aurelia/metadata@0.10.0", + "aurelia-pal": "github:aurelia/pal@0.3.0", + "aurelia-pal-browser": "github:aurelia/pal-browser@0.3.0", + "aurelia-path": "github:aurelia/path@0.11.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.9.0", + "aurelia-templating": "github:aurelia/templating@0.17.0", "babel": "npm:babel-core@5.2.2", "babel-runtime": "npm:babel-runtime@5.2.2", - "core-js": "npm:core-js@1.2.1", - "github:aurelia/binding@0.10.0": { - "aurelia-metadata": "github:aurelia/metadata@0.9.0", - "aurelia-pal": "github:aurelia/pal@0.2.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.8.0", - "core-js": "npm:core-js@0.9.18" - }, - "github:aurelia/dependency-injection@0.11.0": { - "aurelia-logging": "github:aurelia/logging@0.8.0", - "aurelia-metadata": "github:aurelia/metadata@0.9.0", - "aurelia-pal": "github:aurelia/pal@0.2.0", - "core-js": "npm:core-js@0.9.18" - }, - "github:aurelia/loader@0.10.0": { - "aurelia-metadata": "github:aurelia/metadata@0.9.0", - "aurelia-path": "github:aurelia/path@0.10.0" - }, - "github:aurelia/metadata@0.9.0": { - "aurelia-pal": "github:aurelia/pal@0.2.0", - "core-js": "npm:core-js@0.9.18" - }, - "github:aurelia/pal-browser@0.2.0": { - "aurelia-pal": "github:aurelia/pal@0.2.0" - }, - "github:aurelia/task-queue@0.8.0": { - "aurelia-pal": "github:aurelia/pal@0.2.0" - }, - "github:aurelia/templating@0.16.0": { - "aurelia-binding": "github:aurelia/binding@0.10.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.11.0", - "aurelia-loader": "github:aurelia/loader@0.10.0", - "aurelia-logging": "github:aurelia/logging@0.8.0", - "aurelia-metadata": "github:aurelia/metadata@0.9.0", - "aurelia-pal": "github:aurelia/pal@0.2.0", - "aurelia-path": "github:aurelia/path@0.10.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.8.0", - "core-js": "npm:core-js@0.9.18" + "core-js": "npm:core-js@1.2.6", + "github:aurelia/binding@0.11.0": { + "aurelia-metadata": "github:aurelia/metadata@0.10.0", + "aurelia-pal": "github:aurelia/pal@0.3.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.9.0", + "core-js": "npm:core-js@1.2.6" + }, + "github:aurelia/dependency-injection@0.12.0": { + "aurelia-logging": "github:aurelia/logging@0.9.0", + "aurelia-metadata": "github:aurelia/metadata@0.10.0", + "aurelia-pal": "github:aurelia/pal@0.3.0", + "core-js": "npm:core-js@1.2.6" + }, + "github:aurelia/loader@0.11.0": { + "aurelia-metadata": "github:aurelia/metadata@0.10.0", + "aurelia-path": "github:aurelia/path@0.11.0" + }, + "github:aurelia/metadata@0.10.0": { + "aurelia-pal": "github:aurelia/pal@0.3.0", + "core-js": "npm:core-js@1.2.6" + }, + "github:aurelia/pal-browser@0.3.0": { + "aurelia-pal": "github:aurelia/pal@0.3.0" + }, + "github:aurelia/task-queue@0.9.0": { + "aurelia-pal": "github:aurelia/pal@0.3.0" + }, + "github:aurelia/templating@0.17.0": { + "aurelia-binding": "github:aurelia/binding@0.11.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.12.0", + "aurelia-loader": "github:aurelia/loader@0.11.0", + "aurelia-logging": "github:aurelia/logging@0.9.0", + "aurelia-metadata": "github:aurelia/metadata@0.10.0", + "aurelia-pal": "github:aurelia/pal@0.3.0", + "aurelia-path": "github:aurelia/path@0.11.0", + "aurelia-task-queue": "github:aurelia/task-queue@0.9.0", + "core-js": "npm:core-js@1.2.6" }, "github:jspm/nodelibs-assert@0.1.0": { "assert": "npm:assert@1.3.0" }, + "github:jspm/nodelibs-path@0.1.0": { + "path-browserify": "npm:path-browserify@0.0.0" + }, "github:jspm/nodelibs-process@0.1.2": { "process": "npm:process@0.11.2" }, @@ -76,19 +79,18 @@ System.config({ "npm:assert@1.3.0": { "util": "npm:util@0.10.3" }, - "npm:core-js@0.9.18": { - "fs": "github:jspm/nodelibs-fs@0.1.2", - "process": "github:jspm/nodelibs-process@0.1.2", - "systemjs-json": "github:systemjs/plugin-json@0.1.0" - }, - "npm:core-js@1.2.1": { + "npm:core-js@1.2.6": { "fs": "github:jspm/nodelibs-fs@0.1.2", + "path": "github:jspm/nodelibs-path@0.1.0", "process": "github:jspm/nodelibs-process@0.1.2", "systemjs-json": "github:systemjs/plugin-json@0.1.0" }, "npm:inherits@2.0.1": { "util": "github:jspm/nodelibs-util@0.1.0" }, + "npm:path-browserify@0.0.0": { + "process": "github:jspm/nodelibs-process@0.1.2" + }, "npm:process@0.11.2": { "assert": "github:jspm/nodelibs-assert@0.1.0" }, diff --git a/package.json b/package.json index 8b1f8240..79932d8d 100644 --- a/package.json +++ b/package.json @@ -25,27 +25,27 @@ "lib": "dist/amd" }, "dependencies": { - "aurelia-binding": "github:aurelia/binding@^0.10.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.11.0", - "aurelia-loader": "github:aurelia/loader@^0.10.0", - "aurelia-logging": "github:aurelia/logging@^0.8.0", - "aurelia-metadata": "github:aurelia/metadata@^0.9.0", - "aurelia-pal": "github:aurelia/pal@^0.2.0", - "aurelia-path": "github:aurelia/path@^0.10.0", - "aurelia-task-queue": "github:aurelia/task-queue@^0.8.0", - "aurelia-templating": "github:aurelia/templating@^0.16.0", - "core-js": "npm:core-js@^0.9.5" + "aurelia-binding": "github:aurelia/binding@^0.11.0", + "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.12.0", + "aurelia-loader": "github:aurelia/loader@^0.11.0", + "aurelia-logging": "github:aurelia/logging@^0.9.0", + "aurelia-metadata": "github:aurelia/metadata@^0.10.0", + "aurelia-pal": "github:aurelia/pal@^0.3.0", + "aurelia-path": "github:aurelia/path@^0.11.0", + "aurelia-task-queue": "github:aurelia/task-queue@^0.9.0", + "aurelia-templating": "github:aurelia/templating@^0.17.0", + "core-js": "npm:core-js@^1.2.6" }, "devDependencies": { - "aurelia-pal-browser": "github:aurelia/pal-browser@^0.2.0", + "aurelia-pal-browser": "github:aurelia/pal-browser@^0.3.0", "babel": "npm:babel-core@^5.1.13", "babel-runtime": "npm:babel-runtime@^5.1.13", - "core-js": "npm:core-js@^0.9.5" + "core-js": "npm:core-js@^1.2.6" } }, "devDependencies": { "aurelia-tools": "^0.1.12", - "babel-dts-generator": "^0.2.9", + "babel-dts-generator": "^0.2.16", "babel-eslint": "^4.1.1", "conventional-changelog": "0.0.11", "del": "^1.1.0", From 9f0743a5c1d0b86f49f23138e63dabfb8aad89f0 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Tue, 10 Nov 2015 11:05:04 -0500 Subject: [PATCH 013/549] chore(all): prepare release 0.18.0 --- bower.json | 2 +- dist/amd/aurelia-framework.d.ts | 2 +- dist/amd/aurelia-framework.js | 16 +++++----------- dist/aurelia-framework.d.ts | 2 +- dist/aurelia-framework.js | 18 ++++++------------ dist/commonjs/aurelia-framework.d.ts | 2 +- dist/commonjs/aurelia-framework.js | 16 +++++----------- dist/es6/aurelia-framework.d.ts | 2 +- dist/es6/aurelia-framework.js | 18 ++++++------------ dist/system/aurelia-framework.d.ts | 2 +- dist/system/aurelia-framework.js | 22 +++++++--------------- doc/CHANGELOG.md | 8 ++++++++ doc/api.json | 14 +++++++------- package.json | 2 +- 14 files changed, 51 insertions(+), 75 deletions(-) diff --git a/bower.json b/bower.json index bfa4000e..85790709 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.17.0", + "version": "0.18.0", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", diff --git a/dist/amd/aurelia-framework.d.ts b/dist/amd/aurelia-framework.d.ts index 0959411f..8052ac98 100644 --- a/dist/amd/aurelia-framework.d.ts +++ b/dist/amd/aurelia-framework.d.ts @@ -1,7 +1,7 @@ declare module 'aurelia-framework' { import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; diff --git a/dist/amd/aurelia-framework.js b/dist/amd/aurelia-framework.js index 0bdfca10..22eee4dd 100644 --- a/dist/amd/aurelia-framework.js +++ b/dist/amd/aurelia-framework.js @@ -286,12 +286,6 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- throw new Error(message); } - if (!_this5.container.hasResolver(_aureliaTemplating.Animator)) { - _aureliaTemplating.Animator.configureDefault(_this5.container); - } - - _aureliaTemplating.templatingEngine.initialize(_this5.container); - _this5.logger.info('Aurelia Started'); var evt = _aureliaPal.DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); _aureliaPal.DOM.dispatchEvent(evt); @@ -308,8 +302,8 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- this._configureHost(applicationHost); return new Promise(function (resolve) { - var viewEngine = _this6.container.get(_aureliaTemplating.ViewEngine); - _this6.root = viewEngine.enhance(_this6.container, _this6.host, _this6.resources, bindingContext); + var engine = _this6.container.get(_aureliaTemplating.TemplatingEngine); + _this6.root = engine.enhance({ container: _this6.container, element: _this6.host, resources: _this6.resources, bindingContext: bindingContext }); _this6.root.attached(); _this6._onAureliaComposed(); return _this6; @@ -322,18 +316,18 @@ define(['exports', 'core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia- var root = arguments.length <= 0 || arguments[0] === undefined ? 'app' : arguments[0]; var applicationHost = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var compositionEngine = undefined; + var engine = undefined; var instruction = {}; this._configureHost(applicationHost); - compositionEngine = this.container.get(_aureliaTemplating.CompositionEngine); + engine = this.container.get(_aureliaTemplating.TemplatingEngine); instruction.viewModel = root; instruction.container = instruction.childContainer = this.container; instruction.viewSlot = this.hostSlot; instruction.host = this.host; - return compositionEngine.compose(instruction).then(function (r) { + return engine.compose(instruction).then(function (r) { _this7.root = r; instruction.viewSlot.attached(); _this7._onAureliaComposed(); diff --git a/dist/aurelia-framework.d.ts b/dist/aurelia-framework.d.ts index 0959411f..8052ac98 100644 --- a/dist/aurelia-framework.d.ts +++ b/dist/aurelia-framework.d.ts @@ -1,7 +1,7 @@ declare module 'aurelia-framework' { import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; diff --git a/dist/aurelia-framework.js b/dist/aurelia-framework.js index 9b0dcdde..5b6fe66a 100644 --- a/dist/aurelia-framework.js +++ b/dist/aurelia-framework.js @@ -1,6 +1,6 @@ import 'core-js'; import * as TheLogManager from 'aurelia-logging'; -import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,CompositionEngine,Animator,templatingEngine} from 'aurelia-templating'; +import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,TemplatingEngine} from 'aurelia-templating'; import {join} from 'aurelia-path'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; @@ -393,12 +393,6 @@ export class Aurelia { throw new Error(message); } - if (!this.container.hasResolver(Animator)) { - Animator.configureDefault(this.container); - } - - templatingEngine.initialize(this.container); - this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); DOM.dispatchEvent(evt); @@ -416,8 +410,8 @@ export class Aurelia { this._configureHost(applicationHost); return new Promise(resolve => { - let viewEngine = this.container.get(ViewEngine); - this.root = viewEngine.enhance(this.container, this.host, this.resources, bindingContext); + let engine = this.container.get(TemplatingEngine); + this.root = engine.enhance({container: this.container, element: this.host, resources: this.resources, bindingContext: bindingContext}); this.root.attached(); this._onAureliaComposed(); return this; @@ -431,18 +425,18 @@ export class Aurelia { * @return Returns a Promise of the current Aurelia instance. */ setRoot(root: string = 'app', applicationHost: string | Element = null): Promise { - let compositionEngine; + let engine; let instruction = {}; this._configureHost(applicationHost); - compositionEngine = this.container.get(CompositionEngine); + engine = this.container.get(TemplatingEngine); instruction.viewModel = root; instruction.container = instruction.childContainer = this.container; instruction.viewSlot = this.hostSlot; instruction.host = this.host; - return compositionEngine.compose(instruction).then(r => { + return engine.compose(instruction).then(r => { this.root = r; instruction.viewSlot.attached(); this._onAureliaComposed(); diff --git a/dist/commonjs/aurelia-framework.d.ts b/dist/commonjs/aurelia-framework.d.ts index 0959411f..8052ac98 100644 --- a/dist/commonjs/aurelia-framework.d.ts +++ b/dist/commonjs/aurelia-framework.d.ts @@ -1,7 +1,7 @@ declare module 'aurelia-framework' { import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; diff --git a/dist/commonjs/aurelia-framework.js b/dist/commonjs/aurelia-framework.js index 9d3cb38e..840bf4ea 100644 --- a/dist/commonjs/aurelia-framework.js +++ b/dist/commonjs/aurelia-framework.js @@ -303,12 +303,6 @@ var Aurelia = (function () { throw new Error(message); } - if (!_this5.container.hasResolver(_aureliaTemplating.Animator)) { - _aureliaTemplating.Animator.configureDefault(_this5.container); - } - - _aureliaTemplating.templatingEngine.initialize(_this5.container); - _this5.logger.info('Aurelia Started'); var evt = _aureliaPal.DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); _aureliaPal.DOM.dispatchEvent(evt); @@ -325,8 +319,8 @@ var Aurelia = (function () { this._configureHost(applicationHost); return new Promise(function (resolve) { - var viewEngine = _this6.container.get(_aureliaTemplating.ViewEngine); - _this6.root = viewEngine.enhance(_this6.container, _this6.host, _this6.resources, bindingContext); + var engine = _this6.container.get(_aureliaTemplating.TemplatingEngine); + _this6.root = engine.enhance({ container: _this6.container, element: _this6.host, resources: _this6.resources, bindingContext: bindingContext }); _this6.root.attached(); _this6._onAureliaComposed(); return _this6; @@ -339,18 +333,18 @@ var Aurelia = (function () { var root = arguments.length <= 0 || arguments[0] === undefined ? 'app' : arguments[0]; var applicationHost = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var compositionEngine = undefined; + var engine = undefined; var instruction = {}; this._configureHost(applicationHost); - compositionEngine = this.container.get(_aureliaTemplating.CompositionEngine); + engine = this.container.get(_aureliaTemplating.TemplatingEngine); instruction.viewModel = root; instruction.container = instruction.childContainer = this.container; instruction.viewSlot = this.hostSlot; instruction.host = this.host; - return compositionEngine.compose(instruction).then(function (r) { + return engine.compose(instruction).then(function (r) { _this7.root = r; instruction.viewSlot.attached(); _this7._onAureliaComposed(); diff --git a/dist/es6/aurelia-framework.d.ts b/dist/es6/aurelia-framework.d.ts index 0959411f..8052ac98 100644 --- a/dist/es6/aurelia-framework.d.ts +++ b/dist/es6/aurelia-framework.d.ts @@ -1,7 +1,7 @@ declare module 'aurelia-framework' { import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; diff --git a/dist/es6/aurelia-framework.js b/dist/es6/aurelia-framework.js index 9b0dcdde..5b6fe66a 100644 --- a/dist/es6/aurelia-framework.js +++ b/dist/es6/aurelia-framework.js @@ -1,6 +1,6 @@ import 'core-js'; import * as TheLogManager from 'aurelia-logging'; -import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,CompositionEngine,Animator,templatingEngine} from 'aurelia-templating'; +import {ViewEngine,BindingLanguage,ViewSlot,ViewResources,TemplatingEngine} from 'aurelia-templating'; import {join} from 'aurelia-path'; import {Container} from 'aurelia-dependency-injection'; import {Loader} from 'aurelia-loader'; @@ -393,12 +393,6 @@ export class Aurelia { throw new Error(message); } - if (!this.container.hasResolver(Animator)) { - Animator.configureDefault(this.container); - } - - templatingEngine.initialize(this.container); - this.logger.info('Aurelia Started'); let evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); DOM.dispatchEvent(evt); @@ -416,8 +410,8 @@ export class Aurelia { this._configureHost(applicationHost); return new Promise(resolve => { - let viewEngine = this.container.get(ViewEngine); - this.root = viewEngine.enhance(this.container, this.host, this.resources, bindingContext); + let engine = this.container.get(TemplatingEngine); + this.root = engine.enhance({container: this.container, element: this.host, resources: this.resources, bindingContext: bindingContext}); this.root.attached(); this._onAureliaComposed(); return this; @@ -431,18 +425,18 @@ export class Aurelia { * @return Returns a Promise of the current Aurelia instance. */ setRoot(root: string = 'app', applicationHost: string | Element = null): Promise { - let compositionEngine; + let engine; let instruction = {}; this._configureHost(applicationHost); - compositionEngine = this.container.get(CompositionEngine); + engine = this.container.get(TemplatingEngine); instruction.viewModel = root; instruction.container = instruction.childContainer = this.container; instruction.viewSlot = this.hostSlot; instruction.host = this.host; - return compositionEngine.compose(instruction).then(r => { + return engine.compose(instruction).then(r => { this.root = r; instruction.viewSlot.attached(); this._onAureliaComposed(); diff --git a/dist/system/aurelia-framework.d.ts b/dist/system/aurelia-framework.d.ts index 0959411f..8052ac98 100644 --- a/dist/system/aurelia-framework.d.ts +++ b/dist/system/aurelia-framework.d.ts @@ -1,7 +1,7 @@ declare module 'aurelia-framework' { import 'core-js'; import * as TheLogManager from 'aurelia-logging'; - import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine } from 'aurelia-templating'; + import { ViewEngine, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine } from 'aurelia-templating'; import { join } from 'aurelia-path'; import { Container } from 'aurelia-dependency-injection'; import { Loader } from 'aurelia-loader'; diff --git a/dist/system/aurelia-framework.js b/dist/system/aurelia-framework.js index 140380de..f1451c03 100644 --- a/dist/system/aurelia-framework.js +++ b/dist/system/aurelia-framework.js @@ -1,7 +1,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-path', 'aurelia-dependency-injection', 'aurelia-loader', 'aurelia-pal', 'aurelia-binding', 'aurelia-metadata', 'aurelia-task-queue'], function (_export) { 'use strict'; - var TheLogManager, ViewEngine, BindingLanguage, ViewSlot, ViewResources, CompositionEngine, Animator, templatingEngine, join, Container, Loader, DOM, PLATFORM, logger, FrameworkConfiguration, Aurelia, LogManager; + var TheLogManager, ViewEngine, BindingLanguage, ViewSlot, ViewResources, TemplatingEngine, join, Container, Loader, DOM, PLATFORM, logger, FrameworkConfiguration, Aurelia, LogManager; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } @@ -72,9 +72,7 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa BindingLanguage = _aureliaTemplating.BindingLanguage; ViewSlot = _aureliaTemplating.ViewSlot; ViewResources = _aureliaTemplating.ViewResources; - CompositionEngine = _aureliaTemplating.CompositionEngine; - Animator = _aureliaTemplating.Animator; - templatingEngine = _aureliaTemplating.templatingEngine; + TemplatingEngine = _aureliaTemplating.TemplatingEngine; for (var _key4 in _aureliaTemplating) { if (_key4 !== 'default') _export(_key4, _aureliaTemplating[_key4]); @@ -336,12 +334,6 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa throw new Error(message); } - if (!_this5.container.hasResolver(Animator)) { - Animator.configureDefault(_this5.container); - } - - templatingEngine.initialize(_this5.container); - _this5.logger.info('Aurelia Started'); var evt = DOM.createCustomEvent('aurelia-started', { bubbles: true, cancelable: true }); DOM.dispatchEvent(evt); @@ -358,8 +350,8 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa this._configureHost(applicationHost); return new Promise(function (resolve) { - var viewEngine = _this6.container.get(ViewEngine); - _this6.root = viewEngine.enhance(_this6.container, _this6.host, _this6.resources, bindingContext); + var engine = _this6.container.get(TemplatingEngine); + _this6.root = engine.enhance({ container: _this6.container, element: _this6.host, resources: _this6.resources, bindingContext: bindingContext }); _this6.root.attached(); _this6._onAureliaComposed(); return _this6; @@ -372,18 +364,18 @@ System.register(['core-js', 'aurelia-logging', 'aurelia-templating', 'aurelia-pa var root = arguments.length <= 0 || arguments[0] === undefined ? 'app' : arguments[0]; var applicationHost = arguments.length <= 1 || arguments[1] === undefined ? null : arguments[1]; - var compositionEngine = undefined; + var engine = undefined; var instruction = {}; this._configureHost(applicationHost); - compositionEngine = this.container.get(CompositionEngine); + engine = this.container.get(TemplatingEngine); instruction.viewModel = root; instruction.container = instruction.childContainer = this.container; instruction.viewSlot = this.hostSlot; instruction.host = this.host; - return compositionEngine.compose(instruction).then(function (r) { + return engine.compose(instruction).then(function (r) { _this7.root = r; instruction.viewSlot.attached(); _this7._onAureliaComposed(); diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index 0abd27d3..fd18ce33 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,11 @@ +## 0.18.0 (2015-11-10) + + +#### Bug Fixes + +* **all:** update to work with latest TemplatingEngine ([edf2b5f8](http://github.com/aurelia/framework/commit/edf2b5f8e5a47984219e2be26d7b762b9d7eab7c)) + + ## 0.17.0 (2015-10-13) diff --git a/doc/api.json b/doc/api.json index 8b3a4d2a..0e3ad219 100644 --- a/doc/api.json +++ b/doc/api.json @@ -53,7 +53,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 1506, + "id": 1714, "moduleName": "\"aurelia-loader\"" } }, @@ -71,7 +71,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1386, + "id": 1593, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -89,7 +89,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 2074, + "id": 2261, "moduleName": "\"aurelia-templating\"" } } @@ -117,7 +117,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1386, + "id": 1593, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -135,7 +135,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 1506, + "id": 1714, "moduleName": "\"aurelia-loader\"" } }, @@ -153,7 +153,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 2074, + "id": 2261, "moduleName": "\"aurelia-templating\"" } }, @@ -482,7 +482,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1386, + "id": 1593, "moduleName": "\"aurelia-dependency-injection\"" } }, diff --git a/package.json b/package.json index 79932d8d..df20d71d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.17.0", + "version": "0.18.0", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", From dbeb8a4a6b43726f22a2afc5a4f4818e3ab65b2a Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Mon, 16 Nov 2015 10:27:36 -0500 Subject: [PATCH 014/549] chore(all): prepare release 1.0.0-beta.1 --- bower.json | 20 +++++----- build/tasks/doc.js | 4 +- build/tasks/test.js | 26 +++++-------- config.js | 94 ++++++++++++++++++++++----------------------- doc/CHANGELOG.md | 4 +- doc/api.json | 14 +++---- package.json | 39 ++++++++++++------- 7 files changed, 105 insertions(+), 96 deletions(-) diff --git a/bower.json b/bower.json index 85790709..f35e76df 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.18.0", + "version": "1.0.0-beta.1", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", @@ -17,15 +17,15 @@ "url": "http://github.com/aurelia/framework" }, "dependencies": { - "aurelia-binding": "^0.11.0", - "aurelia-dependency-injection": "^0.12.0", - "aurelia-loader": "^0.11.0", - "aurelia-logging": "^0.9.0", - "aurelia-metadata": "^0.10.0", - "aurelia-pal": "^0.3.0", - "aurelia-path": "^0.11.0", - "aurelia-task-queue": "^0.9.0", - "aurelia-templating": "^0.17.0", + "aurelia-binding": "^1.0.0-beta.1.0.1", + "aurelia-dependency-injection": "^1.0.0-beta.1", + "aurelia-loader": "^1.0.0-beta.1", + "aurelia-logging": "^1.0.0-beta.1", + "aurelia-metadata": "^1.0.0-beta.1", + "aurelia-pal": "^1.0.0-beta.1", + "aurelia-path": "^1.0.0-beta.1", + "aurelia-task-queue": "^1.0.0-beta.1", + "aurelia-templating": "^1.0.0-beta.1", "core-js": "zloirock/core-js" } } diff --git a/build/tasks/doc.js b/build/tasks/doc.js index a2781668..7fdf3422 100644 --- a/build/tasks/doc.js +++ b/build/tasks/doc.js @@ -5,7 +5,7 @@ var typedocExtractor = require("gulp-typedoc-extractor"); var runSequence = require('run-sequence'); gulp.task('doc-generate', function(){ - return gulp.src([paths.output + '*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/github/aurelia/*/*.d.ts']) + return gulp.src([paths.output + '*.d.ts', paths.doc + '/core-js.d.ts', './jspm_packages/npm/*/*.d.ts']) .pipe(typedoc({             target: "es6",             includeDeclarations: true, @@ -30,4 +30,4 @@ gulp.task('doc', function(callback){ 'doc-extract', callback ); -}); \ No newline at end of file +}); diff --git a/build/tasks/test.js b/build/tasks/test.js index 71884759..c7af441c 100644 --- a/build/tasks/test.js +++ b/build/tasks/test.js @@ -1,34 +1,30 @@ var gulp = require('gulp'); -var karma = require('karma').server; +var Karma = require('karma').Server; /** * Run test once and exit */ gulp.task('test', function (done) { - karma.start({ - configFile: __dirname + '/../../karma.conf.js', - singleRun: true - }, function(e) { - done(); - }); + new Karma({ + configFile: __dirname + '/../../karma.conf.js', + singleRun: true + }, done).start(); }); /** * Watch for file changes and re-run tests on each change */ gulp.task('tdd', function (done) { - karma.start({ - configFile: __dirname + '/../../karma.conf.js' - }, function(e) { - done(); - }); + new Karma({ + configFile: __dirname + '/../../karma.conf.js' + }, done).start(); }); /** * Run test once with code coverage and exit */ gulp.task('cover', function (done) { - karma.start({ + new Karma({ configFile: __dirname + '/../../karma.conf.js', singleRun: true, reporters: ['coverage'], @@ -40,7 +36,5 @@ gulp.task('cover', function (done) { type: 'html', dir: 'build/reports/coverage' } - }, function (e) { - done(); - }); + }, done).start(); }); diff --git a/config.js b/config.js index 8ef35648..a0030804 100644 --- a/config.js +++ b/config.js @@ -14,56 +14,19 @@ System.config({ }, map: { - "aurelia-binding": "github:aurelia/binding@0.11.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.12.0", - "aurelia-loader": "github:aurelia/loader@0.11.0", - "aurelia-logging": "github:aurelia/logging@0.9.0", - "aurelia-metadata": "github:aurelia/metadata@0.10.0", - "aurelia-pal": "github:aurelia/pal@0.3.0", - "aurelia-pal-browser": "github:aurelia/pal-browser@0.3.0", - "aurelia-path": "github:aurelia/path@0.11.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.9.0", - "aurelia-templating": "github:aurelia/templating@0.17.0", + "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.0.1", + "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1", + "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1", + "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1", + "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1", + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1", + "aurelia-pal-browser": "npm:aurelia-pal-browser@1.0.0-beta.1", + "aurelia-path": "npm:aurelia-path@1.0.0-beta.1", + "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1", + "aurelia-templating": "npm:aurelia-templating@1.0.0-beta.1", "babel": "npm:babel-core@5.2.2", "babel-runtime": "npm:babel-runtime@5.2.2", "core-js": "npm:core-js@1.2.6", - "github:aurelia/binding@0.11.0": { - "aurelia-metadata": "github:aurelia/metadata@0.10.0", - "aurelia-pal": "github:aurelia/pal@0.3.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.9.0", - "core-js": "npm:core-js@1.2.6" - }, - "github:aurelia/dependency-injection@0.12.0": { - "aurelia-logging": "github:aurelia/logging@0.9.0", - "aurelia-metadata": "github:aurelia/metadata@0.10.0", - "aurelia-pal": "github:aurelia/pal@0.3.0", - "core-js": "npm:core-js@1.2.6" - }, - "github:aurelia/loader@0.11.0": { - "aurelia-metadata": "github:aurelia/metadata@0.10.0", - "aurelia-path": "github:aurelia/path@0.11.0" - }, - "github:aurelia/metadata@0.10.0": { - "aurelia-pal": "github:aurelia/pal@0.3.0", - "core-js": "npm:core-js@1.2.6" - }, - "github:aurelia/pal-browser@0.3.0": { - "aurelia-pal": "github:aurelia/pal@0.3.0" - }, - "github:aurelia/task-queue@0.9.0": { - "aurelia-pal": "github:aurelia/pal@0.3.0" - }, - "github:aurelia/templating@0.17.0": { - "aurelia-binding": "github:aurelia/binding@0.11.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@0.12.0", - "aurelia-loader": "github:aurelia/loader@0.11.0", - "aurelia-logging": "github:aurelia/logging@0.9.0", - "aurelia-metadata": "github:aurelia/metadata@0.10.0", - "aurelia-pal": "github:aurelia/pal@0.3.0", - "aurelia-path": "github:aurelia/path@0.11.0", - "aurelia-task-queue": "github:aurelia/task-queue@0.9.0", - "core-js": "npm:core-js@1.2.6" - }, "github:jspm/nodelibs-assert@0.1.0": { "assert": "npm:assert@1.3.0" }, @@ -79,6 +42,43 @@ System.config({ "npm:assert@1.3.0": { "util": "npm:util@0.10.3" }, + "npm:aurelia-binding@1.0.0-beta.1.0.1": { + "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1", + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1", + "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1", + "core-js": "npm:core-js@1.2.6" + }, + "npm:aurelia-dependency-injection@1.0.0-beta.1": { + "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1", + "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1", + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1", + "core-js": "npm:core-js@1.2.6" + }, + "npm:aurelia-loader@1.0.0-beta.1": { + "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1", + "aurelia-path": "npm:aurelia-path@1.0.0-beta.1" + }, + "npm:aurelia-metadata@1.0.0-beta.1": { + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1", + "core-js": "npm:core-js@1.2.6" + }, + "npm:aurelia-pal-browser@1.0.0-beta.1": { + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1" + }, + "npm:aurelia-task-queue@1.0.0-beta.1": { + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1" + }, + "npm:aurelia-templating@1.0.0-beta.1": { + "aurelia-binding": "npm:aurelia-binding@1.0.0-beta.1.0.1", + "aurelia-dependency-injection": "npm:aurelia-dependency-injection@1.0.0-beta.1", + "aurelia-loader": "npm:aurelia-loader@1.0.0-beta.1", + "aurelia-logging": "npm:aurelia-logging@1.0.0-beta.1", + "aurelia-metadata": "npm:aurelia-metadata@1.0.0-beta.1", + "aurelia-pal": "npm:aurelia-pal@1.0.0-beta.1", + "aurelia-path": "npm:aurelia-path@1.0.0-beta.1", + "aurelia-task-queue": "npm:aurelia-task-queue@1.0.0-beta.1", + "core-js": "npm:core-js@1.2.6" + }, "npm:core-js@1.2.6": { "fs": "github:jspm/nodelibs-fs@0.1.2", "path": "github:jspm/nodelibs-path@0.1.0", diff --git a/doc/CHANGELOG.md b/doc/CHANGELOG.md index fd18ce33..3de85b10 100644 --- a/doc/CHANGELOG.md +++ b/doc/CHANGELOG.md @@ -1,3 +1,6 @@ +### 1.0.0-beta.1 (2015-11-16) + + ## 0.18.0 (2015-11-10) @@ -458,4 +461,3 @@ function, this will affect you as that is no longer present. #### Bug Fixes * **package:** update dependencies to their latest versions ([fe83ef37](http://github.com/aurelia/framework/commit/fe83ef37fdcdf878dd79564ed9b97ee56de8d621)) - diff --git a/doc/api.json b/doc/api.json index 0e3ad219..d5a9acd5 100644 --- a/doc/api.json +++ b/doc/api.json @@ -53,7 +53,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 1714, + "id": 605, "moduleName": "\"aurelia-loader\"" } }, @@ -71,7 +71,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1593, + "id": 484, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -89,7 +89,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 2261, + "id": 1158, "moduleName": "\"aurelia-templating\"" } } @@ -117,7 +117,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1593, + "id": 484, "moduleName": "\"aurelia-dependency-injection\"" } }, @@ -135,7 +135,7 @@ "type": { "type": "reference", "name": "Loader", - "id": 1714, + "id": 605, "moduleName": "\"aurelia-loader\"" } }, @@ -153,7 +153,7 @@ "type": { "type": "reference", "name": "ViewResources", - "id": 2261, + "id": 1158, "moduleName": "\"aurelia-templating\"" } }, @@ -482,7 +482,7 @@ "type": { "type": "reference", "name": "Container", - "id": 1593, + "id": 484, "moduleName": "\"aurelia-dependency-injection\"" } }, diff --git a/package.json b/package.json index df20d71d..47c2aff6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "aurelia-framework", - "version": "0.18.0", + "version": "1.0.0-beta.1", "description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.", "keywords": [ "aurelia", @@ -18,6 +18,7 @@ "type": "git", "url": "http://github.com/aurelia/framework" }, + "jspmNodeConversion": false, "jspm": { "main": "aurelia-framework", "format": "amd", @@ -25,27 +26,39 @@ "lib": "dist/amd" }, "dependencies": { - "aurelia-binding": "github:aurelia/binding@^0.11.0", - "aurelia-dependency-injection": "github:aurelia/dependency-injection@^0.12.0", - "aurelia-loader": "github:aurelia/loader@^0.11.0", - "aurelia-logging": "github:aurelia/logging@^0.9.0", - "aurelia-metadata": "github:aurelia/metadata@^0.10.0", - "aurelia-pal": "github:aurelia/pal@^0.3.0", - "aurelia-path": "github:aurelia/path@^0.11.0", - "aurelia-task-queue": "github:aurelia/task-queue@^0.9.0", - "aurelia-templating": "github:aurelia/templating@^0.17.0", + "aurelia-binding": "npm:aurelia-binding@^1.0.0-beta.1.0.1", + "aurelia-dependency-injection": "npm:aurelia-dependency-injection@^1.0.0-beta.1", + "aurelia-loader": "npm:aurelia-loader@^1.0.0-beta.1", + "aurelia-logging": "npm:aurelia-logging@^1.0.0-beta.1", + "aurelia-metadata": "npm:aurelia-metadata@^1.0.0-beta.1", + "aurelia-pal": "npm:aurelia-pal@^1.0.0-beta.1", + "aurelia-path": "npm:aurelia-path@^1.0.0-beta.1", + "aurelia-task-queue": "npm:aurelia-task-queue@^1.0.0-beta.1", + "aurelia-templating": "npm:aurelia-templating@^1.0.0-beta.1", "core-js": "npm:core-js@^1.2.6" }, "devDependencies": { - "aurelia-pal-browser": "github:aurelia/pal-browser@^0.3.0", + "aurelia-pal-browser": "npm:aurelia-pal-browser@^1.0.0-beta.1", "babel": "npm:babel-core@^5.1.13", "babel-runtime": "npm:babel-runtime@^5.1.13", "core-js": "npm:core-js@^1.2.6" } }, + "dependencies": { + "aurelia-binding": "^1.0.0-beta.1.0.1", + "aurelia-dependency-injection": "^1.0.0-beta.1", + "aurelia-loader": "^1.0.0-beta.1", + "aurelia-logging": "^1.0.0-beta.1", + "aurelia-metadata": "^1.0.0-beta.1", + "aurelia-pal": "^1.0.0-beta.1", + "aurelia-path": "^1.0.0-beta.1", + "aurelia-task-queue": "^1.0.0-beta.1", + "aurelia-templating": "^1.0.0-beta.1", + "core-js": "^1.2.6" + }, "devDependencies": { "aurelia-tools": "^0.1.12", - "babel-dts-generator": "^0.2.16", + "babel-dts-generator": "^0.2.17", "babel-eslint": "^4.1.1", "conventional-changelog": "0.0.11", "del": "^1.1.0", @@ -59,7 +72,7 @@ "gulp-typedoc": "^1.2.1", "gulp-typedoc-extractor": "0.0.8", "jasmine-core": "^2.1.3", - "karma": "^0.12.28", + "karma": "^0.13.15", "karma-babel-preprocessor": "^5.2.2", "karma-chrome-launcher": "^0.1.7", "karma-coverage": "^0.3.1", From 5551c229351aa233c4a3286dad644ac40322f7a1 Mon Sep 17 00:00:00 2001 From: Rob Eisenberg Date: Wed, 18 Nov 2015 13:38:46 -0500 Subject: [PATCH 015/549] doc(all): some new docs content --- doc/article/en-US/a-production-setup.html | 112 ++ doc/article/en-US/business-advantages.html | 46 + doc/article/en-US/cheat-sheet.html | 1885 ++++++++++++++++++++ doc/article/en-US/creating-components.html | 141 ++ doc/article/en-US/getting-help.html | 18 + doc/article/en-US/getting-started.html | 731 ++++++++ doc/article/en-US/technical-benefits.html | 99 + doc/article/en-US/what-is-aurelia.html | 40 + 8 files changed, 3072 insertions(+) create mode 100644 doc/article/en-US/a-production-setup.html create mode 100644 doc/article/en-US/business-advantages.html create mode 100644 doc/article/en-US/cheat-sheet.html create mode 100644 doc/article/en-US/creating-components.html create mode 100644 doc/article/en-US/getting-help.html create mode 100644 doc/article/en-US/getting-started.html create mode 100644 doc/article/en-US/technical-benefits.html create mode 100644 doc/article/en-US/what-is-aurelia.html diff --git a/doc/article/en-US/a-production-setup.html b/doc/article/en-US/a-production-setup.html new file mode 100644 index 00000000..167fc3ee --- /dev/null +++ b/doc/article/en-US/a-production-setup.html @@ -0,0 +1,112 @@ + + + A Production Setup + + + + + + + + ## Configuring Your Environment + + Let's start by getting you set up with a great set of tools that you can use to build modern JavaScript applications. All our tooling is built on [Node.js](http://nodejs.org/). If you have that installed already, great! If not, you should go to [the official web site](http://nodejs.org/), download and install it. Everything else we need will be installed via Node's package manager ([npm](https://docs.npmjs.com/getting-started/what-is-npm)). If you already have npm installed, make sure you've got the [latest version](https://github.com/npm/npm/wiki/Troubleshooting#try-the-latest-stable-version-of-node) to avoid any issues with the other tools. + + > **Note:** For command-line operations, we recommend Windows users to use Git Bash or Git Shell. + + First, let's begin by installing [Gulp](http://gulpjs.com/) which we'll be using for build automation. If you don't have it already, you can use npm to set it up like this (in some environments you may need to use `sudo`): + + ```shell + npm install -g gulp + ``` + + Next, we need to install [jspm](http://jspm.io/). This will serve as our client-side package manager. You can do that like this: + + ```shell + npm install -g jspm + ``` + + > **Note:** Don't want to use jspm? No problem. All Aurelia packages are available via [Bower](http://bower.io/) as well. + + + + ## Setting up the Project Structure and Build + + With the tooling installed, we can now turn our attention to setting up a basic structure for your app. Begin by [downloading the navigation skeleton](https://github.com/aurelia/skeleton-navigation/releases). Unzip it and rename the folder to appropriately represent the app you want to build. + + > **Note:** Alternatively, you can use [Yeoman](http://yeoman.io) to "generate" the skeleton project in the target folder, as follows: + > + > ``` + > npm install -g yo generator-aurelia + > yo aurelia + > ``` + > + > This also runs the `npm` and `jspm` commands listed below. + + Inside the folder you will now find everything you need, including a basic build, package configuration, styles and more. With all this in place, let's run some commands. + + 1. Open a console and change directory into your app's directory. + 2. Execute the following command to install the Gulp plugins listed in the _devDependencies_ section of the package manifest: + ```shell + npm install + ``` + 3. Next, execute the following command to install the Aurelia libraries, bootstrap and font-awesome, listed in the _jspm.dependencies_ section of the package manifest: + ```shell + jspm install -y + ``` + Everything we've done so far is standard Node.js build and package management procedures. It doesn't have anything specific to do with Aurelia itself. We're just walking you through setting up a modern JavaScript project and build configuration from scratch. You may be familiar with this already, but if not then welcome to this new and exciting world! + + > **Note:** Bootstrap and Font-Awesome are **not** dependencies of Aurelia. We only leverage them as part of the starter kit in order to help you quickly achieve a decent look out-of-the-box. You can easily replace them with whatever your favorite CSS framework and/or icon library is. + + + + + ## Running The App + + If you've followed along this far, you now have all the libraries, build configuration and tools you need to create amazing JavaScript apps with Aurelia. The next thing to do is run the sample app. To see this in action, on your console, use the following command to build and launch the server: + ```shell + gulp watch + ``` + You can now browse to [http://localhost:9000/](http://localhost:9000/) to see the app. + + > **Note:** The Skeleton App uses [BrowserSync](http://www.browsersync.io/) for automated page refreshes on code/markup changes concurrently accross multiple browsers. If you prefer to disable the mirroring feature set the [ghostMode option](http://www.browsersync.io/docs/options/#option-ghostMode) to false in your build config. + + + + ## Running The Unit Tests + + To run the unit tests, first ensure that you have followed the steps above in order to install all dependencies and successfully build the library. Once you have done that, proceed with these additional steps: + + 1. Ensure that the [Karma](http://karma-runner.github.io/) CLI is installed. If you need to install it, use the following command: + ```shell + npm install -g karma-cli + ``` + 2. You can now run the tests with this command: + ```shell + karma start + ``` + + + + ## Running The E2E Tests + + Integration tests are performed with [Protractor](http://angular.github.io/protractor/#/). + + 1. Place your E2E-Tests into the folder ```test/e2e/src```. + 2. Install the necessary webdriver: + ```shell + gulp webdriver_update + ``` + 3. Configure the path to the webdriver by opening the file ```protractor.conf.js``` and adjusting the ```seleniumServerJar``` property. Typically it's only needed to adjust the version number. + 4. Make sure your app runs and is accessible: + ```shell + gulp watch + ``` + 5. In another console run the E2E-Tests: + ```shell + gulp e2e + ``` + + + diff --git a/doc/article/en-US/business-advantages.html b/doc/article/en-US/business-advantages.html new file mode 100644 index 00000000..02103f35 --- /dev/null +++ b/doc/article/en-US/business-advantages.html @@ -0,0 +1,46 @@ + + + Business Advantages + + + + + + + + ## Commerically Backed + + * One of the only two main-stream, open-source SPA frameworks with official commercial backing (Ember is the other). + * The only SPA framework with commercial support options available. + * Custom contracts available for enterprises. + * Internally “dogfooded†by Durandal Inc. in its own business-critical products. + + Many technologists make incorrect assumptions in this space. You may hear about "Google's Polymer" (or Angular) or "Facebook's React". However, these libraries aren't official products of their repsective companies. React team members have stated publicly that Facebook is not committed to the React library. Google developers have stated publicly that Polymer is not a Google product and developers are not considered customers. Angular and Polymer are two out of six UI libraries built by Google employees, all competative with one another, and none officially recognized by the company. There is much marketing and brand recognition around these libraries but no guarantee and little hope of long-term stability. We encourage you to try to see past the marketing, brands and hype and into the core capabilities and benefits of the technology itself. If you do, we think you'll realize that Aurelia is the best option available. + + + + ## Commercial Products and Services + + * Official on-site or virtual training. + * Consulting, advisory and code-review services. + * Aurelia Interface (In Development) - Cross-platform, mobile UI components. + * Aurelia Data Controls (In Development) - Data-oriented and LOB components. + * Much more coming... + + + + ## Strategic Partnerships + + * Partnerships with both large and boutique consulting organizations in order to provide scale-out of developer resources as needed by businesses adopting Aurelia. + * Official training partners around the world to deliver training anywhere and anytime. + + + + ## Broad Customer Reach + + * Applications developed in virtually every space: healthcare, insurance, finance, entertainment, technology, developer tools, LOB, gaming, etc. + * Used internally at serveral, well-known enterprises. + * Adoption among large, international organizations. + + + diff --git a/doc/article/en-US/cheat-sheet.html b/doc/article/en-US/cheat-sheet.html new file mode 100644 index 00000000..23d53c9d --- /dev/null +++ b/doc/article/en-US/cheat-sheet.html @@ -0,0 +1,1885 @@ + + + Cheat Sheet + + + + + + + + ## Configuration and Startup + + + + + + + + + + + + + export function configure(aurelia) { + aurelia.use + .standardConfiguration() + .developmentLogging(); + + aurelia.start().then(() => aurelia.setRoot()); + } + + + import {Aurelia} from 'aurelia-framework'; + + export function configure(aurelia: Aurelia): void { + aurelia.use + .standardConfiguration() + .developmentLogging(); + + aurelia.start().then(() => aurelia.setRoot()); + } + + + + + + import {LogManager} from 'aurelia-framework'; + import {ConsoleAppender} from 'aurelia-logging-console'; + + LogManager.addAppender(new ConsoleAppender()); + LogManager.setLevel(LogManager.logLevel.debug); + + export function configure(aurelia) { + aurelia.use + .defaultBindingLanguage() + .defaultResources() + .history() + .router() + .eventAggregator(); + + aurelia.start().then(() => aurelia.setRoot('app', document.body)); + } + + + import {LogManager, Aurelia} from 'aurelia-framework'; + import {ConsoleAppender} from 'aurelia-logging-console'; + + LogManager.addAppender(new ConsoleAppender()); + LogManager.setLevel(LogManager.logLevel.debug); + + export function configure(aurelia: Aurelia): void { + aurelia.use + .defaultBindingLanguage() + .defaultResources() + .history() + .router() + .eventAggregator(); + + aurelia.start().then(() => aurelia.setRoot('app', document.body)); + } + + + + + + export function configure(aurelia) { + aurelia.use + .standardConfiguration() + .developmentLogging() + .feature('feature-name', featureConfiguration); + + aurelia.start().then(() => aurelia.setRoot()); + } + + + import {Aurelia} from 'aurelia-framework'; + + export function configure(aurelia: Aurelia): void { + aurelia.use + .standardConfiguration() + .developmentLogging() + .feature('feature-name', featureConfiguration); + + aurelia.start().then(() => aurelia.setRoot()); + } + + + + + + export function configure(aurelia) { + aurelia.use + .standardConfiguration() + .developmentLogging() + .plugin('plugin-name', pluginConfiguration); + + aurelia.start().then(() => aurelia.setRoot()); + } + + + import {Aurelia} from 'aurelia-framework'; + + export function configure(aurelia: Aurelia): void { + aurelia.use + .standardConfiguration() + .developmentLogging() + .plugin('plugin-name', pluginConfiguration); + + aurelia.start().then(() => aurelia.setRoot()); + } + + + + + ## Creating Components + + UI components consist of two parts: a view-model and a view. Simply create each part in its own file. Use the same file name but different file extensions for the two parts. For example: _hello.js_ and _hello.html_. + + + + + import {useView, decorators} from 'aurelia-framework'; + + export let Hello = decorators(useView('./hello.html')).on(class { + ... + }); + + + import {useView} from 'aurelia-framework'; + + @useView('./hello.html') + export class Hello { + ... + } + + + import {useView} from 'aurelia-framework'; + + @useView('./hello.html') + export class Hello { + ... + } + + + + + #### The Component Lifecycle + + Components have a well-defined lifecycle: + + 1. `constructor()` - The view-model's constructor is called first. + 2. `created(owningView: View, myView: View)` - If the view-model implements the `created` callback it is invoked next. At this point in time, the view has also been created and both the view-model and the view are connected to their controller. The created callback will recieve the instance of the "owningView". This is the view that the compoment is declared inside of. If the component itself has a view, this will be passed second. + 3. `bind(bindingContext: Object, overrideContext: Object)` - Databinding is then activated on the view and view-model. If the view-model has a `bind` callback, it will be invoked at this time. The "binding context" to which the component is being boudn will be passed first. An "override context" will be passed second. The override context contains information used to travers the parent hierarchy and can also be used to add any contextual properties that the component wants to add. + 4. `attached()` - Next, the component is attached to the DOM (in document). If the view-model has an `attached` callback, it will be invoked at this time. + 5. `detached()` - At some point in the future, the component may be removed from the DOM. If/When this happens, and if the view-model has a `detached` callback, this is when it will be invoked. + 6. `unbind()` - After a component is detached, it's usually unbound. If your view-model has the `unbind` callback, it will be invoked during this process. + + + + ## Dependency Injection + + + + + import {inject} from 'aurelia-framework'; + import {Dep1} from 'dep1'; + import {Dep2} from 'dep2'; + + @inject(Dep1, Dep2) + export class CustomerDetail { + constructor(dep1, dep2) { + this.dep1 = dep1; + this.dep2 = dep2; + } + } + + + import {Dep1} from 'dep1'; + import {Dep2} from 'dep2'; + + export class CustomerDetail { + static inject() { return [Dep1, Dep2]; } + + constructor(dep1, dep2) { + this.dep1 = dep1; + this.dep2 = dep2; + } + } + + + import {autoinject} from 'aurelia-framework'; + import {Dep1} from 'dep1'; + import {Dep2} from 'dep2'; + + @autoinject + export class CustomerDetail { + constructor(private dep1: Dep1, private dep2: Dep2){ + this.dep1 = dep1; + this.dep2 = dep2; + } + } + + + + + + import {Lazy, inject} from 'aurelia-framework'; + import {HttpClient} from 'aurelia-fetch-client'; + + @inject(Lazy.of(HttpClient)) + export class CustomerDetail { + constructor(getHTTP){ + this.getHTTP = getHTTP; + } + } + + + import {Lazy} from 'aurelia-framework'; + import {HttpClient} from 'aurelia-fetch-client'; + + export class CustomerDetail { + static inject() { return [Lazy.of(HttpClient)]; } + + constructor(getHTTP){ + this.getHTTP = getHTTP; + } + } + + + import {Lazy, inject} from 'aurelia-framework'; + import {HttpClient} from 'aurelia-fetch-client'; + + @inject(Lazy.of(HttpClient)) + export class CustomerDetail { + constructor(private getHTTP: () => HttpClient){ + this.getHTTP = getHTTP; + } + } + + + + + #### Available Resolvers + + * `Lazy` - Injects a function for lazily evaluating the dependency. + * ex. `Lazy.of(HttpClient)` + * `All` - Injects an array of all services registered with the provided key. + * ex. `All.of(Plugin)` + * `Optional` - Injects an instance of a class only if it already exists in the container; null otherwise. + * ex. `Optional.of(LoggedInUser)` + + + + + import {transient, inject} from 'aurelia-framework'; + import {HttpClient} from 'aurelia-fetch-client'; + + @transient() + @inject(HttpClient) + export class CustomerDetail { + constructor(http) { + this.http = http; + } + } + + + import {transient, inject} from 'aurelia-framework'; + import {HttpClient} from 'aurelia-fetch-client'; + + export let CustomDetail = decorators( + transient() + inject(HttpClient) + ).on(class { + constructor(http) { + this.http = http; + } + }); + + + import {transient, autoinject} from 'aurelia-framework'; + import {HttpClient} from 'aurelia-fetch-client'; + + @transient() + @autoinject + export class CustomerDetail { + constructor(private http: HttpClient) { + this.http = http; + } + } + + + + + ## Templating Basics + + + + + + + + + + + + + + + + + + + + + + + + + + + + +