mirror of
https://github.com/google/blockly.git
synced 2026-01-07 00:50:27 +01:00
fix: bump neighbours performance regression (#7748)
* fix: move bumping neighbours to the end of rendering * chore: remove scheduleSnapAndBump * chore: remove references to bumpNeighbours * chore: work on fixing tests * fix: bump neighbours event grouping * chore: format * chore: readd deprecation import * fix: move event ordering * chore: undeprecate bumpNeighbours * fix: bumping during drag due to insertion markers * chore: tests * chore: PR feedback * chore: docs * chore: typo
This commit is contained in:
@@ -27,14 +27,12 @@ suite('Inputs', function () {
|
||||
);
|
||||
|
||||
this.renderStub = sinon.stub(this.block, 'queueRender');
|
||||
this.bumpNeighboursStub = sinon.stub(this.block, 'bumpNeighbours');
|
||||
|
||||
this.dummy = this.block.appendDummyInput('DUMMY');
|
||||
this.value = this.block.appendValueInput('VALUE');
|
||||
this.statement = this.block.appendStatementInput('STATEMENT');
|
||||
|
||||
this.renderStub.resetHistory();
|
||||
this.bumpNeighboursStub.resetHistory();
|
||||
});
|
||||
teardown(function () {
|
||||
sharedTestTeardown.call(this);
|
||||
@@ -158,7 +156,6 @@ suite('Inputs', function () {
|
||||
chai.assert.equal(setBlockSpy.getCall(0).args[0], this.block);
|
||||
sinon.assert.calledOnce(initSpy);
|
||||
sinon.assert.calledOnce(this.renderStub);
|
||||
sinon.assert.calledOnce(this.bumpNeighboursStub);
|
||||
|
||||
setBlockSpy.restore();
|
||||
initSpy.restore();
|
||||
@@ -177,7 +174,6 @@ suite('Inputs', function () {
|
||||
chai.assert.equal(setBlockSpy.getCall(0).args[0], this.block);
|
||||
sinon.assert.calledOnce(initModelSpy);
|
||||
sinon.assert.notCalled(this.renderStub);
|
||||
sinon.assert.notCalled(this.bumpNeighboursStub);
|
||||
|
||||
setBlockSpy.restore();
|
||||
initModelSpy.restore();
|
||||
@@ -196,12 +192,10 @@ suite('Inputs', function () {
|
||||
this.dummy.appendField(field, 'FIELD');
|
||||
|
||||
this.renderStub.resetHistory();
|
||||
this.bumpNeighboursStub.resetHistory();
|
||||
|
||||
this.dummy.removeField('FIELD');
|
||||
sinon.assert.calledOnce(disposeSpy);
|
||||
sinon.assert.calledOnce(this.renderStub);
|
||||
sinon.assert.calledOnce(this.bumpNeighboursStub);
|
||||
});
|
||||
test('Headless', function () {
|
||||
const field = new Blockly.FieldLabel('field');
|
||||
@@ -209,14 +203,12 @@ suite('Inputs', function () {
|
||||
this.dummy.appendField(field, 'FIELD');
|
||||
|
||||
this.renderStub.resetHistory();
|
||||
this.bumpNeighboursStub.resetHistory();
|
||||
|
||||
this.block.rendered = false;
|
||||
|
||||
this.dummy.removeField('FIELD');
|
||||
sinon.assert.calledOnce(disposeSpy);
|
||||
sinon.assert.notCalled(this.renderStub);
|
||||
sinon.assert.notCalled(this.bumpNeighboursStub);
|
||||
});
|
||||
});
|
||||
suite('Field Ordering/Manipulation', function () {
|
||||
|
||||
@@ -32,6 +32,7 @@ suite('Render Management', function () {
|
||||
isDisposed: () => false,
|
||||
getRelativeToSurfaceXY: () => ({x: 0, y: 0}),
|
||||
updateComponentLocations: () => {},
|
||||
bumpNeighbours: () => {},
|
||||
workspace: {
|
||||
resizeContents: () => {},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user