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

remove deprecated warnings #693

Merged
merged 1 commit into from
Sep 21, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions src/WidgetBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,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 @@ -737,16 +736,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