Skip to content

Commit c1b994b

Browse files
authored
refactor!: remove deprecated notifyResize methods (#4939)
1 parent d4d0a53 commit c1b994b

9 files changed

Lines changed: 0 additions & 93 deletions

File tree

‎packages/component-base/src/resize-mixin.js‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,5 @@ export const ResizeMixin = dedupingMixin(
8686
_onResize(_contentRect) {
8787
// To be implemented.
8888
}
89-
90-
/**
91-
* @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
92-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
93-
*/
94-
notifyResize() {
95-
console.warn(
96-
`WARNING: Since Vaadin 23, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`,
97-
);
98-
}
9989
},
10090
);

‎packages/component-base/test/resize-mixin.test.js‎

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,22 +71,6 @@ describe('resize-mixin', () => {
7171
expect(spy.called).to.be.false;
7272
});
7373

74-
describe('console warnings', () => {
75-
beforeEach(() => {
76-
sinon.stub(console, 'warn');
77-
});
78-
79-
afterEach(() => {
80-
console.warn.restore();
81-
});
82-
83-
it('should warn when calling deprecated notifyResize()', () => {
84-
element.notifyResize();
85-
expect(console.warn.calledOnce).to.be.true;
86-
expect(console.warn.args[0][0]).to.include('WARNING: Since Vaadin 23, notifyResize() is deprecated.');
87-
});
88-
});
89-
9074
describe('observe parent', () => {
9175
let parent;
9276

‎packages/grid/src/vaadin-grid.d.ts‎

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -367,17 +367,6 @@ declare class Grid<TItem = GridDefaultItem> extends HTMLElement {
367367
*/
368368
requestContentUpdate(): void;
369369

370-
/**
371-
* Updates the computed metrics and positioning of internal grid parts
372-
* (row/details cell positioning etc). Needs to be invoked whenever the sizing of grid
373-
* content changes asynchronously to ensure consistent appearance (e.g. when a
374-
* contained image whose bounds aren't known beforehand finishes loading).
375-
*
376-
* @deprecated Since Vaadin 22, `notifyResize()` is deprecated. The component uses a
377-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
378-
*/
379-
notifyResize(): void;
380-
381370
addEventListener<K extends keyof GridEventMap<TItem>>(
382371
type: K,
383372
listener: (this: Grid<TItem>, ev: GridEventMap<TItem>[K]) => void,

‎packages/grid/src/vaadin-grid.js‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,21 +1088,6 @@ class Grid extends ElementMixin(
10881088
this.__virtualizer.update(start, end);
10891089
}
10901090
}
1091-
1092-
/**
1093-
* Updates the computed metrics and positioning of internal grid parts
1094-
* (row/details cell positioning etc). Needs to be invoked whenever the sizing of grid
1095-
* content changes asynchronously to ensure consistent appearance (e.g. when a
1096-
* contained image whose bounds aren't known beforehand finishes loading).
1097-
*
1098-
* @deprecated Since Vaadin 22, `notifyResize()` is deprecated. The component uses a
1099-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
1100-
*/
1101-
notifyResize() {
1102-
console.warn(
1103-
`WARNING: Since Vaadin 22, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`,
1104-
);
1105-
}
11061091
}
11071092

11081093
customElements.define(Grid.is, Grid);

‎packages/grid/test/resizing.test.js‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { expect } from '@esm-bundle/chai';
22
import { aTimeout, fixtureSync, nextFrame, oneEvent } from '@vaadin/testing-helpers';
3-
import sinon from 'sinon';
43
import '@vaadin/polymer-legacy-adapter/template-renderer.js';
54
import '../vaadin-grid.js';
65
import '../vaadin-grid-column-group.js';
@@ -53,15 +52,6 @@ describe('resizing', () => {
5352
flushGrid(grid);
5453
});
5554

56-
it('should warn when calling deprecated notifyResize()', () => {
57-
const stub = sinon.stub(console, 'warn');
58-
grid.notifyResize();
59-
stub.restore();
60-
61-
expect(stub.calledOnce).to.be.true;
62-
expect(stub.args[0][0]).to.include('WARNING: Since Vaadin 22, notifyResize() is deprecated.');
63-
});
64-
6555
it('should align rows correctly', () => {
6656
const rows = getRows(grid.$.items);
6757
expect(rows[0].getBoundingClientRect().bottom).to.be.closeTo(rows[1].getBoundingClientRect().top, 1);

‎packages/menu-bar/src/vaadin-menu-bar-interactions-mixin.d.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,4 @@ export declare class InteractionsMixinClass {
2222
* @attr {boolean} open-on-hover
2323
*/
2424
openOnHover: boolean | null | undefined;
25-
26-
/**
27-
* @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
28-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
29-
*/
30-
notifyResize(): void;
3125
}

‎packages/split-layout/src/vaadin-split-layout.d.ts‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ declare class SplitLayout extends ElementMixin(ThemableMixin(HTMLElement)) {
156156
*/
157157
orientation: 'horizontal' | 'vertical';
158158

159-
/**
160-
* @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
161-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
162-
*/
163-
notifyResize(): void;
164-
165159
addEventListener<K extends keyof SplitLayoutEventMap>(
166160
type: K,
167161
listener: (this: SplitLayout, ev: SplitLayoutEventMap[K]) => void,

‎packages/split-layout/src/vaadin-split-layout.js‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -332,16 +332,6 @@ class SplitLayout extends ElementMixin(ThemableMixin(PolymerElement)) {
332332
}
333333
}
334334

335-
/**
336-
* @deprecated Since Vaadin 23, `notifyResize()` is deprecated. The component uses a
337-
* ResizeObserver internally and doesn't need to be explicitly notified of resizes.
338-
*/
339-
notifyResize() {
340-
console.warn(
341-
`WARNING: Since Vaadin 23, notifyResize() is deprecated. The component uses a ResizeObserver internally and doesn't need to be explicitly notified of resizes.`,
342-
);
343-
}
344-
345335
/**
346336
* Fired after dragging the splitter have ended.
347337
*

‎packages/split-layout/test/split-layout.test.js‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,6 @@ describe('split layout', () => {
7575
expect(getComputedStyle(second).pointerEvents).to.equal('visible');
7676
});
7777
});
78-
79-
it('should warn when calling deprecated notifyResize()', () => {
80-
const stub = sinon.stub(console, 'warn');
81-
splitLayout.notifyResize();
82-
stub.restore();
83-
84-
expect(stub.calledOnce).to.be.true;
85-
expect(stub.args[0][0]).to.include('WARNING: Since Vaadin 23, notifyResize() is deprecated.');
86-
});
8778
});
8879

8980
function testDimensions(isVertical) {

0 commit comments

Comments
 (0)