Skip to content

Commit

Permalink
Remove sync queue from @ember/runloop.
Browse files Browse the repository at this point in the history
Was deprecated `until: '3.5.0'`, should be safe to cleanup now.
  • Loading branch information
rwjblue committed Apr 18, 2019
1 parent 6f3ea5a commit da556a7
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 75 deletions.
1 change: 0 additions & 1 deletion packages/@ember/deprecated-features/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

export const SEND_ACTION = !!'3.4.0';
export const EMBER_EXTEND_PROTOTYPES = !!'3.2.0-beta.5';
export const RUN_SYNC = !!'3.0.0-beta.4';
export const LOGGER = !!'3.2.0-beta.1';
export const MERGE = !!'3.6.0-beta.1';
export const ROUTER_EVENTS = !!'4.0.0';
Expand Down
32 changes: 5 additions & 27 deletions packages/@ember/runloop/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { assert, deprecate } from '@ember/debug';
import { assert } from '@ember/debug';
import { onErrorTarget } from '@ember/-internals/error-handling';
import { beginPropertyChanges, endPropertyChanges } from '@ember/-internals/metal';
import Backburner from 'backburner';
import { RUN_SYNC } from '@ember/deprecated-features';

let currentRunLoop = null;
export function getCurrentRunLoop() {
Expand Down Expand Up @@ -46,24 +44,13 @@ export const queues = [
_rsvpErrorQueue,
];

let backburnerOptions = {
export const backburner = new Backburner(queues, {
defaultQueue: 'actions',
onBegin,
onEnd,
onErrorTarget,
onErrorMethod: 'onerror',
};

if (RUN_SYNC) {
queues.unshift('sync');

backburnerOptions.sync = {
before: beginPropertyChanges,
after: endPropertyChanges,
};
}

export const backburner = new Backburner(queues, backburnerOptions);
});

/**
@module @ember/runloop
Expand Down Expand Up @@ -324,12 +311,7 @@ export function end() {
@return {*} Timer information for use in canceling, see `cancel`.
@public
*/
export function schedule(queue /*, target, method */) {
deprecate(`Scheduling into the '${queue}' run loop queue is deprecated.`, queue !== 'sync', {
id: 'ember-metal.run.sync',
until: '3.5.0',
});

export function schedule(/* queue, target, method */) {
return backburner.schedule(...arguments);
}

Expand Down Expand Up @@ -469,11 +451,7 @@ export function once(...args) {
@return {Object} Timer information for use in canceling, see `cancel`.
@public
*/
export function scheduleOnce(queue /*, target, method*/) {
deprecate(`Scheduling into the '${queue}' run loop queue is deprecated.`, queue !== 'sync', {
id: 'ember-metal.run.sync',
until: '3.5.0',
});
export function scheduleOnce(/* queue, target, method*/) {
return backburner.scheduleOnce(...arguments);
}

Expand Down
26 changes: 11 additions & 15 deletions packages/@ember/runloop/tests/schedule_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,24 @@ moduleFor(
let runLoop = getCurrentRunLoop();
assert.ok(runLoop, 'run loop present');

expectDeprecation(() => {
schedule('sync', () => {
order.push('sync');
assert.equal(runLoop, getCurrentRunLoop(), 'same run loop used');
});
}, `Scheduling into the 'sync' run loop queue is deprecated.`);

schedule('actions', () => {
order.push('actions');
assert.equal(runLoop, getCurrentRunLoop(), 'same run loop used');
});

schedule('afterRender', () => {
order.push('afterRender');
assert.equal(runLoop, getCurrentRunLoop(), 'same run loop used');

schedule('afterRender', () => {
order.push('afterRender');
assert.equal(runLoop, getCurrentRunLoop(), 'same run loop used');
});

schedule('actions', () => {
order.push('actions');
assert.equal(runLoop, getCurrentRunLoop(), 'same run loop used');
});

expectDeprecation(() => {
schedule('sync', () => {
order.push('sync');
assert.equal(runLoop, getCurrentRunLoop(), 'same run loop used');
});
}, `Scheduling into the 'sync' run loop queue is deprecated.`);
});

schedule('destroy', () => {
Expand All @@ -80,7 +76,7 @@ moduleFor(
});
});

assert.deepEqual(order, ['sync', 'actions', 'sync', 'actions', 'destroy']);
assert.deepEqual(order, ['actions', 'afterRender', 'actions', 'afterRender', 'destroy']);
}
}
);
32 changes: 0 additions & 32 deletions packages/@ember/runloop/tests/sync_test.js

This file was deleted.

0 comments on commit da556a7

Please sign in to comment.