Skip to content

Commit

Permalink
chore(all): prepare release 1.0.0-beta.3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
EisenbergEffect committed Jun 14, 2016
1 parent 09f719c commit 56ffffa
Show file tree
Hide file tree
Showing 10 changed files with 327 additions and 206 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": "1.0.0-beta.3.0.0",
"version": "1.0.0-beta.3.0.1",
"description": "An extensible HTML templating engine supporting databinding, custom elements, attached behaviors and more.",
"keywords": [
"aurelia",
Expand Down
83 changes: 50 additions & 33 deletions dist/amd/aurelia-templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TemplatingEngine = exports.ElementConfigResource = exports.CompositionEngine = exports.HtmlBehaviorResource = exports.BindableProperty = exports.BehaviorPropertyObserver = exports.Controller = exports.ViewEngine = exports.ModuleAnalyzer = exports.ResourceDescription = exports.ResourceModule = exports.ViewCompiler = exports.ViewFactory = exports.BoundViewFactory = exports.ViewSlot = exports.View = exports.ViewResources = exports.ShadowDOM = exports.ShadowSlot = exports.PassThroughSlot = exports.SlotCustomAttribute = exports.BindingLanguage = exports.ViewLocator = exports.InlineViewStrategy = exports.TemplateRegistryViewStrategy = exports.NoViewStrategy = exports.ConventionalViewStrategy = exports.RelativeViewStrategy = exports.viewStrategy = exports.TargetInstruction = exports.BehaviorInstruction = exports.ViewCompileInstruction = exports.ResourceLoadContext = exports.ElementEvents = exports.CompositionTransaction = exports.Animator = exports.animationEvent = undefined;
exports.TemplatingEngine = exports.ElementConfigResource = exports.CompositionEngine = exports.HtmlBehaviorResource = exports.BindableProperty = exports.BehaviorPropertyObserver = exports.Controller = exports.ViewEngine = exports.ModuleAnalyzer = exports.ResourceDescription = exports.ResourceModule = exports.ViewCompiler = exports.ViewFactory = exports.BoundViewFactory = exports.ViewSlot = exports.View = exports.ViewResources = exports.ShadowDOM = exports.ShadowSlot = exports.PassThroughSlot = exports.SlotCustomAttribute = exports.BindingLanguage = exports.ViewLocator = exports.InlineViewStrategy = exports.TemplateRegistryViewStrategy = exports.NoViewStrategy = exports.ConventionalViewStrategy = exports.RelativeViewStrategy = exports.viewStrategy = exports.TargetInstruction = exports.BehaviorInstruction = exports.ViewCompileInstruction = exports.ResourceLoadContext = exports.ElementEvents = exports.CompositionTransaction = exports.CompositionTransactionOwnershipToken = exports.CompositionTransactionNotifier = exports.Animator = exports.animationEvent = undefined;
exports._hyphenate = _hyphenate;
exports._isAllWhitespace = _isAllWhitespace;
exports.children = children;
Expand Down Expand Up @@ -141,6 +141,51 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli
return Animator;
}();

var CompositionTransactionNotifier = exports.CompositionTransactionNotifier = function () {
function CompositionTransactionNotifier(owner) {


this.owner = owner;
that.owner._compositionCount++;
}

CompositionTransactionNotifier.prototype.done = function done() {
this.owner._compositionCount--;
this.owner._tryCompleteTransaction();
};

return CompositionTransactionNotifier;
}();

var CompositionTransactionOwnershipToken = exports.CompositionTransactionOwnershipToken = function () {
function CompositionTransactionOwnershipToken(owner) {


this.owner = owner;
this.owner._ownershipToken = this;
this.thenable = this._createThenable();
}

CompositionTransactionOwnershipToken.prototype.waitForCompositionComplete = function waitForCompositionComplete() {
this.owner._tryCompleteTransaction();
return this.thenable;
};

CompositionTransactionOwnershipToken.prototype.resolve = function resolve() {
this._resolveCallback();
};

CompositionTransactionOwnershipToken.prototype._createThenable = function _createThenable() {
var _this = this;

return new Promise(function (resolve, reject) {
_this._resolveCallback = resolve;
});
};

return CompositionTransactionOwnershipToken;
}();

var CompositionTransaction = exports.CompositionTransaction = function () {
function CompositionTransaction() {

Expand All @@ -150,53 +195,25 @@ define(['exports', 'aurelia-logging', 'aurelia-pal', 'aurelia-metadata', 'aureli
}

CompositionTransaction.prototype.tryCapture = function tryCapture() {
if (this._ownershipToken !== null) {
return null;
}

return this._ownershipToken = this._createOwnershipToken();
return this._ownershipToken === null ? new CompositionTransactionOwnershipToken(this) : null;
};

CompositionTransaction.prototype.enlist = function enlist() {
var that = this;

that._compositionCount++;

return {
done: function done() {
that._compositionCount--;
that._tryCompleteTransaction();
}
};
return new CompositionTransactionNotifier(this);
};

CompositionTransaction.prototype._tryCompleteTransaction = function _tryCompleteTransaction() {
if (this._compositionCount <= 0) {
this._compositionCount = 0;

if (this._ownershipToken !== null) {
var capture = this._ownershipToken;
var token = this._ownershipToken;
this._ownershipToken = null;
capture._resolve();
token.resolve();
}
}
};

CompositionTransaction.prototype._createOwnershipToken = function _createOwnershipToken() {
var _this = this;

var token = {};

token.waitForCompositionComplete = function () {
_this._tryCompleteTransaction();
return new Promise(function (resolve, reject) {
token._resolve = resolve;
});
};

return token;
};

return CompositionTransaction;
}();

Expand Down
37 changes: 29 additions & 8 deletions dist/aurelia-templating.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ import {
import {
TaskQueue
} from 'aurelia-task-queue';
export declare interface CompositionTransactionOwnershipToken {
waitForCompositionComplete(): Promise<void>;
}
export declare interface CompositionTransactionNotifier {
done(): void;
}
export declare interface EventHandler {
eventName: string;
bubbles: boolean;
Expand Down Expand Up @@ -323,8 +317,36 @@ export declare class Animator {
}

/**
* Enables an initiator of a view composition to track any internal async rendering processes for completion.
* A mechanism by which an enlisted async render operation can notify the owning transaction when its work is done.
*/
export declare class CompositionTransactionNotifier {
constructor(owner?: any);

/**
* Notifies the owning transaction that its work is done.
*/
done(): void;
}

/**
* Referenced by the subsytem which wishes to control a composition transaction.
*/
export declare class CompositionTransactionOwnershipToken {
constructor(owner?: any);

/**
* Allows the transaction owner to wait for the completion of all child compositions.
* @return A promise that resolves when all child compositions are done.
*/
waitForCompositionComplete(): Promise<void>;

/**
* Used internall to resolve the composition complete promise.
*/
resolve(): void;
_createThenable(): any;
}

/**
* Enables an initiator of a view composition to track any internal async rendering processes for completion.
*/
Expand All @@ -347,7 +369,6 @@ export declare class CompositionTransaction {
*/
enlist(): CompositionTransactionNotifier;
_tryCompleteTransaction(): any;
_createOwnershipToken(): CompositionTransactionOwnershipToken;
}
export declare function _hyphenate(name?: any): any;

Expand Down
87 changes: 53 additions & 34 deletions dist/aurelia-templating.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,55 @@ export class Animator {
unregisterEffect(effectName: string): void {}
}

interface CompositionTransactionOwnershipToken {
waitForCompositionComplete(): Promise<void>;
/**
* A mechanism by which an enlisted async render operation can notify the owning transaction when its work is done.
*/
export class CompositionTransactionNotifier {
constructor(owner) {
this.owner = owner;
that.owner._compositionCount++;
}

/**
* Notifies the owning transaction that its work is done.
*/
done(): void {
this.owner._compositionCount--;
this.owner._tryCompleteTransaction();
}
}

interface CompositionTransactionNotifier {
done(): void;
/**
* Referenced by the subsytem which wishes to control a composition transaction.
*/
export class CompositionTransactionOwnershipToken {
constructor(owner) {
this.owner = owner;
this.owner._ownershipToken = this;
this.thenable = this._createThenable();
}

/**
* Allows the transaction owner to wait for the completion of all child compositions.
* @return A promise that resolves when all child compositions are done.
*/
waitForCompositionComplete(): Promise<void> {
this.owner._tryCompleteTransaction();
return this.thenable;
}

/**
* Used internall to resolve the composition complete promise.
*/
resolve(): void {
this._resolveCallback();
}

_createThenable() {
return new Promise((resolve, reject) => {
this._resolveCallback = resolve;
});
}
}

/**
Expand All @@ -144,54 +187,30 @@ export class CompositionTransaction {
* @return An ownership token if successful, otherwise null.
*/
tryCapture(): CompositionTransactionOwnershipToken {
if (this._ownershipToken !== null) {
return null;
}

return (this._ownershipToken = this._createOwnershipToken());
return this._ownershipToken === null
? new CompositionTransactionOwnershipToken(this)
: null;
}

/**
* Enlist an async render operation into the transaction.
* @return A completion notifier.
*/
enlist(): CompositionTransactionNotifier {
let that = this;

that._compositionCount++;

return {
done() {
that._compositionCount--;
that._tryCompleteTransaction();
}
};
return new CompositionTransactionNotifier(this);
}

_tryCompleteTransaction() {
if (this._compositionCount <= 0) {
this._compositionCount = 0;

if (this._ownershipToken !== null) {
let capture = this._ownershipToken;
let token = this._ownershipToken;
this._ownershipToken = null;
capture._resolve();
token.resolve();
}
}
}

_createOwnershipToken(): CompositionTransactionOwnershipToken {
let token = {};

token.waitForCompositionComplete = () => {
this._tryCompleteTransaction();
return new Promise((resolve, reject) => {
token._resolve = resolve;
});
};

return token;
}
}

const capitalMatcher = /([A-Z])/g;
Expand Down
Loading

0 comments on commit 56ffffa

Please sign in to comment.