Skip to content
This repository has been archived by the owner on Jul 30, 2018. It is now read-only.

Commit

Permalink
remove depracated warnings (#693)
Browse files Browse the repository at this point in the history
  • Loading branch information
agubler committed Sep 21, 2017
1 parent 3363e7b commit 3a6dd00
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 29 deletions.
11 changes: 0 additions & 11 deletions src/WidgetBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ export class WidgetBase<P = WidgetProperties, C extends DNode = DNode> extends E
this._boundInvalidate = this.invalidate.bind(this);

this.own(this._registry.on('invalidate', this._boundInvalidate));
this._checkOnElementUsage();
}

protected meta<T extends WidgetMetaBase>(MetaType: WidgetMetaConstructor<T>): T {
Expand Down Expand Up @@ -750,16 +749,6 @@ export class WidgetBase<P = WidgetProperties, C extends DNode = DNode> extends E
this._cachedChildrenMap.set(key, filteredCacheChildren);
});
}

private _checkOnElementUsage() {
const name = (<any> this).constructor.name || 'unknown';
if (this.onElementCreated !== WidgetBase.prototype.onElementCreated) {
console.warn(`Usage of 'onElementCreated' has been deprecated and will be removed in a future version, see https://github.com/dojo/widget-core/issues/559 for details (${name})`);
}
if (this.onElementUpdated !== WidgetBase.prototype.onElementUpdated) {
console.warn(`Usage of 'onElementUpdated' has been deprecated and will be removed in a future version, see https://github.com/dojo/widget-core/issues/559 for details (${name})`);
}
}
}

export default WidgetBase;
18 changes: 0 additions & 18 deletions tests/unit/WidgetBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,24 +40,6 @@ registerSuite({
assert(widgetBase);
assert.isFunction(widgetBase.__render__);
},
'deprecated api warning'() {
class TestWidgetOne extends WidgetBase<any> {
onElementUpdated(element: Element, key: string) {

}
onElementCreated(element: Element, key: string) {

}
}
class TestWidgetTwo extends WidgetBase<any> {}

const name = (<any> TestWidgetOne).name || 'unknown';
new TestWidgetOne();
new TestWidgetTwo();
assert.isTrue(consoleStub.calledTwice);
assert.isTrue(consoleStub.firstCall.calledWith(`Usage of 'onElementCreated' has been deprecated and will be removed in a future version, see https://github.com/dojo/widget-core/issues/559 for details (${name})`));
assert.isTrue(consoleStub.secondCall.calledWith(`Usage of 'onElementUpdated' has been deprecated and will be removed in a future version, see https://github.com/dojo/widget-core/issues/559 for details (${name})`));
},
children() {
const expectedChild = v('div');
const widget = new WidgetBase();
Expand Down

0 comments on commit 3a6dd00

Please sign in to comment.