Skip to content

Commit c2f779b

Browse files
chore(all): prepare release 0.8.0
1 parent b52b1b0 commit c2f779b

File tree

13 files changed

+379
-107
lines changed

13 files changed

+379
-107
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aurelia-framework",
3-
"version": "0.7.0",
3+
"version": "0.8.0",
44
"description": "The aurelia framework brings together all the required core aurelia libraries into a ready-to-go application-building platform.",
55
"keywords": [
66
"aurelia",

dist/amd/aurelia.js

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,9 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
2121
slice = Array.prototype.slice;
2222

2323
function loadResources(container, resourcesToLoad, appResources) {
24-
var resourceCoordinator = container.get(ResourceCoordinator), current;
25-
26-
function next() {
24+
var next = function () {
2725
if (current = resourcesToLoad.shift()) {
28-
return resourceCoordinator.importResources(current).then(function (resources) {
26+
return resourceCoordinator.importResources(current, current.resourceManifestUrl).then(function (resources) {
2927
resources.forEach(function (x) {
3028
return x.register(appResources);
3129
});
@@ -34,7 +32,10 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
3432
}
3533

3634
return Promise.resolve();
37-
}
35+
};
36+
37+
var resourceCoordinator = container.get(ResourceCoordinator),
38+
current;
3839

3940
return next();
4041
}
@@ -45,7 +46,11 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
4546
this.container = container || new Container();
4647
this.resources = resources || new ResourceRegistry();
4748
this.resourcesToLoad = [];
48-
this.plugins = new Plugins(this);
49+
this.use = new Plugins(this);
50+
51+
if (!this.resources.baseResourcePath) {
52+
this.resources.baseResourcePath = System.baseUrl || "";
53+
}
4954

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

5560
_prototypeProperties(Aurelia, null, {
5661
withInstance: {
57-
value: function (type, instance) {
62+
value: function withInstance(type, instance) {
5863
this.container.registerInstance(type, instance);
5964
return this;
6065
},
@@ -63,7 +68,7 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
6368
configurable: true
6469
},
6570
withSingleton: {
66-
value: function (type, implementation) {
71+
value: function withSingleton(type, implementation) {
6772
this.container.registerSingleton(type, implementation);
6873
return this;
6974
},
@@ -72,30 +77,27 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
7277
configurable: true
7378
},
7479
withResources: {
75-
value: function (resources) {
76-
if (Array.isArray(resources)) {
77-
this.resourcesToLoad.push(resources);
78-
} else {
79-
this.resourcesToLoad.push(slice.call(arguments));
80-
}
81-
80+
value: function withResources(resources) {
81+
var toAdd = Array.isArray(resources) ? resources : slice.call(arguments);
82+
toAdd.resourceManifestUrl = this.currentPluginId;
83+
this.resourcesToLoad.push(toAdd);
8284
return this;
8385
},
8486
writable: true,
8587
enumerable: true,
8688
configurable: true
8789
},
8890
start: {
89-
value: function () {
91+
value: function start() {
9092
var _this = this;
9193
if (this.started) {
92-
return;
94+
return Promise.resolve(this);
9395
}
9496

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

98-
return this.plugins.process().then(function () {
100+
return this.use._process().then(function () {
99101
if (!_this.container.hasHandler(BindingLanguage)) {
100102
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
101103
}
@@ -111,9 +113,10 @@ define(["exports", "aurelia-logging", "aurelia-dependency-injection", "aurelia-l
111113
configurable: true
112114
},
113115
setRoot: {
114-
value: function (root, applicationHost) {
116+
value: function setRoot(root, applicationHost) {
115117
var _this2 = this;
116-
var compositionEngine, instruction = {};
118+
var compositionEngine,
119+
instruction = {};
117120

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

127130
compositionEngine = this.container.get(CompositionEngine);
128131
instruction.viewModel = root;
129-
instruction.viewSlot = new ViewSlot(this.host, true);
130132
instruction.container = instruction.childContainer = this.container;
133+
instruction.viewSlot = new ViewSlot(this.host, true);
134+
instruction.viewSlot.transformChildNodesIntoView();
131135

132136
return compositionEngine.compose(instruction).then(function (root) {
133137
_this2.root = root;

dist/amd/plugins.js

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
1+
define(["exports", "aurelia-logging", "aurelia-metadata"], function (exports, _aureliaLogging, _aureliaMetadata) {
22
"use strict";
33

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

99
var LogManager = _aureliaLogging;
10+
var Metadata = _aureliaMetadata.Metadata;
1011

1112

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

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

18+
aurelia.currentPluginId = info.moduleId;
19+
1720
return loader.loadModule(info.moduleId, "").then(function (exportedValue) {
1821
if ("install" in exportedValue) {
1922
var result = exportedValue.install(aurelia, info.config || {});
2023

2124
if (result) {
2225
return result.then(function () {
26+
aurelia.currentPluginId = null;
2327
logger.debug("Installed plugin " + info.moduleId + ".");
2428
});
2529
} else {
@@ -28,37 +32,76 @@ define(["exports", "aurelia-logging"], function (exports, _aureliaLogging) {
2832
} else {
2933
logger.debug("Loaded plugin " + info.moduleId + ".");
3034
}
35+
36+
aurelia.currentPluginId = null;
3137
});
3238
}
3339

3440
var Plugins = (function () {
3541
function Plugins(aurelia) {
3642
this.aurelia = aurelia;
3743
this.info = [];
44+
this.processed = false;
3845
}
3946

4047
_prototypeProperties(Plugins, null, {
41-
install: {
42-
value: function (moduleId, config) {
43-
this.info.push({ moduleId: moduleId, config: config });
48+
plugin: {
49+
value: function plugin(moduleId, config) {
50+
var plugin = { moduleId: moduleId, config: config || {} };
51+
52+
if (this.processed) {
53+
loadPlugin(this.aurelia, this.aurelia.loader, plugin);
54+
} else {
55+
this.info.push(plugin);
56+
}
57+
4458
return this;
4559
},
4660
writable: true,
4761
enumerable: true,
4862
configurable: true
4963
},
50-
process: {
51-
value: function () {
64+
es5: {
65+
value: function es5() {
66+
Function.prototype.computed = function (computedProperties) {
67+
for (var key in computedProperties) {
68+
if (computedProperties.hasOwnProperty(key)) {
69+
Object.defineProperty(this.prototype, key, { get: prop[key], enumerable: true });
70+
}
71+
}
72+
};
73+
},
74+
writable: true,
75+
enumerable: true,
76+
configurable: true
77+
},
78+
atscript: {
79+
value: function atscript() {
80+
this.aurelia.container.supportAtScript();
81+
Metadata.configure.location("annotate");
82+
},
83+
writable: true,
84+
enumerable: true,
85+
configurable: true
86+
},
87+
_process: {
88+
value: function Process() {
89+
var _this = this;
5290
var aurelia = this.aurelia,
5391
loader = aurelia.loader,
5492
info = this.info,
5593
current;
5694

95+
if (this.processed) {
96+
return;
97+
}
98+
5799
var next = function () {
58100
if (current = info.shift()) {
59101
return loadPlugin(aurelia, loader, current).then(next);
60102
}
61103

104+
_this.processed = true;
62105
return Promise.resolve();
63106
};
64107

dist/commonjs/aurelia.js

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ var logger = LogManager.getLogger("aurelia"),
2727
slice = Array.prototype.slice;
2828

2929
function loadResources(container, resourcesToLoad, appResources) {
30-
var resourceCoordinator = container.get(ResourceCoordinator), current;
31-
32-
function next() {
30+
var next = function () {
3331
if (current = resourcesToLoad.shift()) {
34-
return resourceCoordinator.importResources(current).then(function (resources) {
32+
return resourceCoordinator.importResources(current, current.resourceManifestUrl).then(function (resources) {
3533
resources.forEach(function (x) {
3634
return x.register(appResources);
3735
});
@@ -40,7 +38,10 @@ function loadResources(container, resourcesToLoad, appResources) {
4038
}
4139

4240
return Promise.resolve();
43-
}
41+
};
42+
43+
var resourceCoordinator = container.get(ResourceCoordinator),
44+
current;
4445

4546
return next();
4647
}
@@ -51,7 +52,11 @@ var Aurelia = (function () {
5152
this.container = container || new Container();
5253
this.resources = resources || new ResourceRegistry();
5354
this.resourcesToLoad = [];
54-
this.plugins = new Plugins(this);
55+
this.use = new Plugins(this);
56+
57+
if (!this.resources.baseResourcePath) {
58+
this.resources.baseResourcePath = System.baseUrl || "";
59+
}
5560

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

6166
_prototypeProperties(Aurelia, null, {
6267
withInstance: {
63-
value: function (type, instance) {
68+
value: function withInstance(type, instance) {
6469
this.container.registerInstance(type, instance);
6570
return this;
6671
},
@@ -69,7 +74,7 @@ var Aurelia = (function () {
6974
configurable: true
7075
},
7176
withSingleton: {
72-
value: function (type, implementation) {
77+
value: function withSingleton(type, implementation) {
7378
this.container.registerSingleton(type, implementation);
7479
return this;
7580
},
@@ -78,30 +83,27 @@ var Aurelia = (function () {
7883
configurable: true
7984
},
8085
withResources: {
81-
value: function (resources) {
82-
if (Array.isArray(resources)) {
83-
this.resourcesToLoad.push(resources);
84-
} else {
85-
this.resourcesToLoad.push(slice.call(arguments));
86-
}
87-
86+
value: function withResources(resources) {
87+
var toAdd = Array.isArray(resources) ? resources : slice.call(arguments);
88+
toAdd.resourceManifestUrl = this.currentPluginId;
89+
this.resourcesToLoad.push(toAdd);
8890
return this;
8991
},
9092
writable: true,
9193
enumerable: true,
9294
configurable: true
9395
},
9496
start: {
95-
value: function () {
97+
value: function start() {
9698
var _this = this;
9799
if (this.started) {
98-
return;
100+
return Promise.resolve(this);
99101
}
100102

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

104-
return this.plugins.process().then(function () {
106+
return this.use._process().then(function () {
105107
if (!_this.container.hasHandler(BindingLanguage)) {
106108
logger.error("You must configure Aurelia with a BindingLanguage implementation.");
107109
}
@@ -117,9 +119,10 @@ var Aurelia = (function () {
117119
configurable: true
118120
},
119121
setRoot: {
120-
value: function (root, applicationHost) {
122+
value: function setRoot(root, applicationHost) {
121123
var _this2 = this;
122-
var compositionEngine, instruction = {};
124+
var compositionEngine,
125+
instruction = {};
123126

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

133136
compositionEngine = this.container.get(CompositionEngine);
134137
instruction.viewModel = root;
135-
instruction.viewSlot = new ViewSlot(this.host, true);
136138
instruction.container = instruction.childContainer = this.container;
139+
instruction.viewSlot = new ViewSlot(this.host, true);
140+
instruction.viewSlot.transformChildNodesIntoView();
137141

138142
return compositionEngine.compose(instruction).then(function (root) {
139143
_this2.root = root;

0 commit comments

Comments
 (0)