telerik / kendo-ui-core

An HTML5, jQuery-based widget library for building modern web apps.
http://www.telerik.com/kendo-ui
Other
2.54k stars 1.91k forks source link

Official support for jQuery 3.x #2250

Closed tsvetomir closed 7 years ago

tsvetomir commented 8 years ago

We're validating our components for operation with jQuery 3 and fixing issues as they're discovered. Some work already has been done in as part of #1877

tsvetomir commented 8 years ago

Moving this issue to the Q1 milestone as it'll likely require breaking changes in the components API

vladimirivanoviliev commented 8 years ago

Additional info regarding the then / done methods :

vladimirivanoviliev commented 8 years ago

Upgrade guide for then method calls

Here is the way to migrate existing then method usages to be compatible with both jQuery 3 & existing versions:

1) then method is called with single argument. In this case the widget code should be untouched and only the tests should be updated. The tests can be upgraded by:

Before:

test("sync calls change after destroy", function() {
    var model = dataSource.get(1),
        wasCalled = false;

    dataSource.remove(model);
    dataSource.bind("change", function() {
        wasCalled = true;
    });
    dataSource.sync();

    ok(wasCalled);
});

After:

test("sync calls change after destroy", function() {
    var model = dataSource.get(1),
        wasCalled = false;

    dataSource.remove(model);
    dataSource.bind("change", function() {
        wasCalled = true;
    });
    dataSource.sync();

    jasmine.clock().tick();

    ok(wasCalled);
});

2) then method is called with two arguments. In this case we can replace the function call with done and fail methods to maintain compatibility. The tests will not require updates.

Before:

return this[method]({ id: model.id }).then(
                proxy(this._modelLoaded, this, model.id),
                proxy(this._modelError, this, model.id)
            );

After:

return this[method]({ id: model.id })
                .done(proxy(this._modelLoaded, this, model.id))
                .fail(proxy(this._modelError, this, model.id));
tsvetomir commented 7 years ago

No breaking changes were necessary in the end. The fixes will be included in releases 2016.3.1116 and later.