Skip to content

Commit

Permalink
chore(all): prepare release 0.13.4
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jul 14, 2015
1 parent 5e023a5 commit 87507ec
Show file tree
Hide file tree
Showing 15 changed files with 348 additions and 197 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aurelia-templating",
"version": "0.13.3",
"version": "0.13.4",
"description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.",
"keywords": [
"aurelia",
Expand Down
12 changes: 3 additions & 9 deletions build/tasks/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@ gulp.task('test', function (done) {
karma.start({
configFile: __dirname + '/../../karma.conf.js',
singleRun: true
}, function(e) {
done();
});
}, done);
});

/**
Expand All @@ -19,9 +17,7 @@ gulp.task('test', function (done) {
gulp.task('tdd', function (done) {
karma.start({
configFile: __dirname + '/../../karma.conf.js'
}, function(e) {
done();
});
}, done);
});

/**
Expand All @@ -40,7 +36,5 @@ gulp.task('cover', function (done) {
type: 'html',
dir: 'build/reports/coverage'
}
}, function (e) {
done();
});
}, done);
});
22 changes: 13 additions & 9 deletions dist/amd/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,20 +99,20 @@ declare module 'aurelia-templating' {
}
export class UseViewStrategy extends ViewStrategy {
constructor(path: any);
loadViewFactory(viewEngine: any, options: any): any;
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
makeRelativeTo(file: any): any;
}
export class ConventionalViewStrategy extends ViewStrategy {
constructor(moduleId: any);
loadViewFactory(viewEngine: any, options: any): any;
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
static convertModuleIdToViewUrl(moduleId: any): any;
}
export class NoViewStrategy extends ViewStrategy {
loadViewFactory(): any;
}
export class TemplateRegistryViewStrategy extends ViewStrategy {
constructor(moduleId: any, registryEntry: any);
loadViewFactory(viewEngine: any, options: any): any;
loadViewFactory(viewEngine: any, options: any, loadContext: any): any;
}
export class BindingLanguage {
inspectAttribute(resources: any, attrName: any, attrValue: any): any;
Expand Down Expand Up @@ -196,13 +196,17 @@ declare module 'aurelia-templating' {
compileSurrogate(node: any, resources: any): any;
compileElement(node: any, resources: any, instructions: any, parentNode: any, parentInjectorId: any, targetLightDOM: any): any;
}
class ProxyViewFactory {
constructor(promise: any);
absorb(factory: any): any;
}
export class ViewEngine {
static inject(): any;
constructor(loader: any, container: any, viewCompiler: any, moduleAnalyzer: any, appResources: any);
loadViewFactory(urlOrRegistryEntry: any, compileOptions: any, associatedModuleId: any): any;
loadTemplateResources(viewRegistryEntry: any, associatedModuleId: any): any;
loadViewFactory(urlOrRegistryEntry: any, compileOptions: any, associatedModuleId: any, loadContext: any): any;
loadTemplateResources(viewRegistryEntry: any, associatedModuleId: any, loadContext: any): any;
importViewModelResource(moduleImport: any, moduleMember: any): any;
importViewResources(moduleIds: any, names: any, resources: any, associatedModuleId: any): any;
importViewResources(moduleIds: any, names: any, resources: any, associatedModuleId: any, loadContext: any): any;
}
export class BehaviorInstance {
constructor(behavior: any, executionContext: any, instruction: any);
Expand Down Expand Up @@ -234,7 +238,7 @@ declare module 'aurelia-templating' {
static convention(name: any, existing: any): any;
addChildBinding(behavior: any): any;
analyze(container: any, target: any): any;
load(container: any, target: any, viewStrategy: any, transientView: any): any;
load(container: any, target: any, viewStrategy: any, transientView: any, loadContext: any): any;
register(registry: any, name: any): any;
compile(compiler: any, resources: any, node: any, instruction: any, parentNode: any): any;
create(container: any, instruction?: any, element?: any, bindings?: any): any;
Expand All @@ -244,13 +248,13 @@ declare module 'aurelia-templating' {
constructor(moduleId: any);
analyze(container: any): any;
register(registry: any, name: any): any;
load(container: any): any;
load(container: any, loadContext: any): any;
}
export class ResourceDescription {
constructor(key: any, exportedValue: any, resourceTypeMeta: any);
analyze(container: any): any;
register(registry: any, name: any): any;
load(container: any): any;
load(container: any, loadContext: any): any;
static get(resource: any, key?: any): any;
}
export class ModuleAnalyzer {
Expand Down
95 changes: 62 additions & 33 deletions dist/amd/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,12 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen

_inherits(UseViewStrategy, _ViewStrategy);

UseViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options) {
UseViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options, loadContext) {
if (!this.absolutePath && this.moduleId) {
this.absolutePath = _aureliaPath.relativeToFile(this.path, this.moduleId);
}

return viewEngine.loadViewFactory(this.absolutePath || this.path, options, this.moduleId);
return viewEngine.loadViewFactory(this.absolutePath || this.path, options, this.moduleId, loadContext);
};

UseViewStrategy.prototype.makeRelativeTo = function makeRelativeTo(file) {
Expand All @@ -219,8 +219,8 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen

_inherits(ConventionalViewStrategy, _ViewStrategy2);

ConventionalViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options) {
return viewEngine.loadViewFactory(this.viewUrl, options, this.moduleId);
ConventionalViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options, loadContext) {
return viewEngine.loadViewFactory(this.viewUrl, options, this.moduleId, loadContext);
};

ConventionalViewStrategy.convertModuleIdToViewUrl = function convertModuleIdToViewUrl(moduleId) {
Expand Down Expand Up @@ -262,12 +262,12 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen

_inherits(TemplateRegistryViewStrategy, _ViewStrategy4);

TemplateRegistryViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options) {
TemplateRegistryViewStrategy.prototype.loadViewFactory = function loadViewFactory(viewEngine, options, loadContext) {
if (this.registryEntry.isReady) {
return Promise.resolve(this.registryEntry.factory);
}

return viewEngine.loadViewFactory(this.registryEntry, options, this.moduleId);
return viewEngine.loadViewFactory(this.registryEntry, options, this.moduleId, loadContext);
};

return TemplateRegistryViewStrategy;
Expand Down Expand Up @@ -1710,6 +1710,24 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
return loader.loadTemplate(urlOrRegistryEntry);
}

var ProxyViewFactory = (function () {
function ProxyViewFactory(promise) {
var _this4 = this;

_classCallCheck(this, ProxyViewFactory);

promise.then(function (x) {
return _this4.absorb(x);
});
}

ProxyViewFactory.prototype.absorb = function absorb(factory) {
this.create = factory.create.bind(factory);
};

return ProxyViewFactory;
})();

var ViewEngine = (function () {
function ViewEngine(loader, container, viewCompiler, moduleAnalyzer, appResources) {
_classCallCheck(this, ViewEngine);
Expand All @@ -1725,24 +1743,33 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
return [_aureliaLoader.Loader, _aureliaDependencyInjection.Container, ViewCompiler, ModuleAnalyzer, ResourceRegistry];
};

ViewEngine.prototype.loadViewFactory = function loadViewFactory(urlOrRegistryEntry, compileOptions, associatedModuleId) {
var _this4 = this;
ViewEngine.prototype.loadViewFactory = function loadViewFactory(urlOrRegistryEntry, compileOptions, associatedModuleId, loadContext) {
var _this5 = this;

loadContext = loadContext || [];

return ensureRegistryEntry(this.loader, urlOrRegistryEntry).then(function (viewRegistryEntry) {
if (viewRegistryEntry.onReady) {
return viewRegistryEntry.onReady;
if (loadContext.indexOf(urlOrRegistryEntry) === -1) {
loadContext.push(urlOrRegistryEntry);
return viewRegistryEntry.onReady;
}

return Promise.resolve(new ProxyViewFactory(viewRegistryEntry.onReady));
}

return viewRegistryEntry.onReady = _this4.loadTemplateResources(viewRegistryEntry, associatedModuleId).then(function (resources) {
loadContext.push(urlOrRegistryEntry);

return viewRegistryEntry.onReady = _this5.loadTemplateResources(viewRegistryEntry, associatedModuleId, loadContext).then(function (resources) {
viewRegistryEntry.setResources(resources);
var viewFactory = _this4.viewCompiler.compile(viewRegistryEntry.template, resources, compileOptions);
var viewFactory = _this5.viewCompiler.compile(viewRegistryEntry.template, resources, compileOptions);
viewRegistryEntry.setFactory(viewFactory);
return viewFactory;
});
});
};

ViewEngine.prototype.loadTemplateResources = function loadTemplateResources(viewRegistryEntry, associatedModuleId) {
ViewEngine.prototype.loadTemplateResources = function loadTemplateResources(viewRegistryEntry, associatedModuleId, loadContext) {
var resources = new ViewResources(this.appResources, viewRegistryEntry.id),
dependencies = viewRegistryEntry.dependencies,
importIds,
Expand All @@ -1760,28 +1787,30 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
});
logger.debug('importing resources for ' + viewRegistryEntry.id, importIds);

return this.importViewResources(importIds, names, resources, associatedModuleId);
return this.importViewResources(importIds, names, resources, associatedModuleId, loadContext);
};

ViewEngine.prototype.importViewModelResource = function importViewModelResource(moduleImport, moduleMember) {
var _this5 = this;
var _this6 = this;

return this.loader.loadModule(moduleImport).then(function (viewModelModule) {
var normalizedId = _aureliaMetadata.Origin.get(viewModelModule).moduleId,
resourceModule = _this5.moduleAnalyzer.analyze(normalizedId, viewModelModule, moduleMember);
resourceModule = _this6.moduleAnalyzer.analyze(normalizedId, viewModelModule, moduleMember);

if (!resourceModule.mainResource) {
throw new Error('No view model found in module "' + moduleImport + '".');
}

resourceModule.analyze(_this5.container);
resourceModule.analyze(_this6.container);

return resourceModule.mainResource;
});
};

ViewEngine.prototype.importViewResources = function importViewResources(moduleIds, names, resources, associatedModuleId) {
var _this6 = this;
ViewEngine.prototype.importViewResources = function importViewResources(moduleIds, names, resources, associatedModuleId, loadContext) {
var _this7 = this;

loadContext = loadContext || [];

return this.loader.loadAllModules(moduleIds).then(function (imports) {
var i,
Expand All @@ -1790,8 +1819,8 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
normalizedId,
current,
associatedModule,
container = _this6.container,
moduleAnalyzer = _this6.moduleAnalyzer,
container = _this7.container,
moduleAnalyzer = _this7.moduleAnalyzer,
allAnalysis = new Array(imports.length);

for (i = 0, ii = imports.length; i < ii; ++i) {
Expand All @@ -1814,7 +1843,7 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
}

for (i = 0, ii = allAnalysis.length; i < ii; ++i) {
allAnalysis[i] = allAnalysis[i].load(container);
allAnalysis[i] = allAnalysis[i].load(container, loadContext);
}

return Promise.all(allAnalysis).then(function () {
Expand Down Expand Up @@ -2342,8 +2371,8 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
}
};

HtmlBehaviorResource.prototype.load = function load(container, target, viewStrategy, transientView) {
var _this7 = this;
HtmlBehaviorResource.prototype.load = function load(container, target, viewStrategy, transientView, loadContext) {
var _this8 = this;

var options;

Expand All @@ -2358,9 +2387,9 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
viewStrategy.moduleId = _aureliaMetadata.Origin.get(target).moduleId;
}

return viewStrategy.loadViewFactory(container.get(ViewEngine), options).then(function (viewFactory) {
if (!transientView || !_this7.viewFactory) {
_this7.viewFactory = viewFactory;
return viewStrategy.loadViewFactory(container.get(ViewEngine), options, loadContext).then(function (viewFactory) {
if (!transientView || !_this8.viewFactory) {
_this8.viewFactory = viewFactory;
}

return viewFactory;
Expand Down Expand Up @@ -2619,7 +2648,7 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
}
};

ResourceModule.prototype.load = function load(container) {
ResourceModule.prototype.load = function load(container, loadContext) {
if (this.onLoaded) {
return this.onLoaded;
}
Expand All @@ -2631,11 +2660,11 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
loads = [];

if (current) {
loads.push(current.load(container));
loads.push(current.load(container, loadContext));
}

for (i = 0, ii = resources.length; i < ii; ++i) {
loads.push(resources[i].load(container));
loads.push(resources[i].load(container, loadContext));
}

this.onLoaded = Promise.all(loads);
Expand Down Expand Up @@ -2690,12 +2719,12 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
this.metadata.register(registry, name);
};

ResourceDescription.prototype.load = function load(container) {
ResourceDescription.prototype.load = function load(container, loadContext) {
var metadata = this.metadata,
value = this.value;

if ('load' in metadata) {
return metadata.load(container, value);
return metadata.load(container, value, null, null, loadContext);
}
};

Expand Down Expand Up @@ -3053,15 +3082,15 @@ define(['exports', 'core-js', 'aurelia-metadata', 'aurelia-path', 'aurelia-depen
};

CompositionEngine.prototype.compose = function compose(instruction) {
var _this8 = this;
var _this9 = this;

instruction.childContainer = instruction.childContainer || instruction.container.createChild();
instruction.view = ViewStrategy.normalize(instruction.view);

if (instruction.viewModel) {
if (typeof instruction.viewModel === 'string') {
return this.createViewModel(instruction).then(function (instruction) {
return _this8.createBehaviorAndSwap(instruction);
return _this9.createBehaviorAndSwap(instruction);
});
} else {
return this.createBehaviorAndSwap(instruction);
Expand Down
Loading

0 comments on commit 87507ec

Please sign in to comment.