Skip to content

chore: bump resize observer #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 28, 2025
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
14 changes: 0 additions & 14 deletions now.json

This file was deleted.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
"test": "vitest --watch false",
"coverage": "vitest run --coverage",
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
"prepublishOnly": "npm run compile && rc-np",
"lint": "eslint src/ --ext .tsx,.ts",
"tsc": "tsc -p tsconfig.json --noEmit",
"now-build": "npm run docs:build",
Expand All @@ -56,11 +56,12 @@
"@rc-component/context": "^1.4.0",
"@rc-component/util": "^1.1.0",
"classnames": "^2.2.5",
"rc-resize-observer": "^1.1.0",
"@rc-component/resize-observer": "^1.0.0",
"rc-virtual-list": "^3.14.2"
},
"devDependencies": {
"@rc-component/father-plugin": "^2.0.1",
"@rc-component/np": "^1.0.3",
"@testing-library/jest-dom": "^6.4.0",
"@testing-library/react": "^12.1.5",
"@types/enzyme": "^3.10.5",
Expand Down Expand Up @@ -88,7 +89,6 @@
"jsdom": "^25.0.0",
"less": "^4.1.3",
"lint-staged": "^15.1.0",
"np": "^10.0.1",
"prettier": "^3.1.0",
"rc-animate": "^3.0.0",
"rc-dropdown": "~4.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/Body/MeasureCell.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import ResizeObserver from 'rc-resize-observer';
import ResizeObserver from '@rc-component/resize-observer';

export interface MeasureCellProps {
columnKey: React.Key;
Expand Down
2 changes: 1 addition & 1 deletion src/Body/MeasureRow.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import ResizeObserver from 'rc-resize-observer';
import ResizeObserver from '@rc-component/resize-observer';
import MeasureCell from './MeasureCell';

export interface MeasureCellProps {
Expand Down
2 changes: 1 addition & 1 deletion src/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import type { CompareProps } from '@rc-component/context/lib/Immutable';
import classNames from 'classnames';
import ResizeObserver from 'rc-resize-observer';
import ResizeObserver from '@rc-component/resize-observer';
import isVisible from '@rc-component/util/lib/Dom/isVisible';
import { isStyleSupport } from '@rc-component/util/lib/Dom/styleChecker';
import { getTargetScrollBarSize } from '@rc-component/util/lib/getScrollBarSize';
Expand Down
2 changes: 1 addition & 1 deletion tests/FixedColumn-IE.spec.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { spyElementPrototype } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import { act } from 'react-dom/test-utils';
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import RcResizeObserver from 'rc-resize-observer';
import RcResizeObserver from '@rc-component/resize-observer';
import Table from '../src';

vi.mock('@rc-component/util/lib/Dom/styleChecker', () => {
Expand Down
2 changes: 1 addition & 1 deletion tests/FixedColumn.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { mount } from 'enzyme';
import { render } from '@testing-library/react';
import RcResizeObserver, { _rs } from 'rc-resize-observer';
import RcResizeObserver, { _rs } from '@rc-component/resize-observer';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import { act } from 'react-dom/test-utils';
import Table, { type ColumnsType } from '../src';
Expand Down
2 changes: 1 addition & 1 deletion tests/FixedHeader.spec.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { mount } from 'enzyme';
import RcResizeObserver from 'rc-resize-observer';
import RcResizeObserver from '@rc-component/resize-observer';
import { spyElementPrototype } from '@rc-component/util/lib/test/domHook';
import React from 'react';
import { act } from 'react-dom/test-utils';
Expand Down
4 changes: 2 additions & 2 deletions tests/Virtual.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { act, fireEvent, render } from '@testing-library/react';
import { _rs as onEsResize } from 'rc-resize-observer/es/utils/observerUtil';
import { _rs as onLibResize } from 'rc-resize-observer/lib/utils/observerUtil';
import { _rs as onEsResize } from '@rc-component/resize-observer/es/utils/observerUtil';
import { _rs as onLibResize } from '@rc-component/resize-observer/lib/utils/observerUtil';
import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook';
import { resetWarned } from '@rc-component/util/lib/warning';
import React from 'react';
Expand Down
15 changes: 15 additions & 0 deletions tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ const Enzyme = require('enzyme');
const Adapter = require('enzyme-adapter-react-16');

Enzyme.configure({ adapter: new Adapter() });

// Mock ResizeObserver
global.ResizeObserver = class ResizeObserver implements ResizeObserver {
callback: ResizeObserverCallback;

constructor(callback: ResizeObserverCallback) {
this.callback = callback;
}
observe(ele) {
// Mock trigger first time
this.callback([{ target: ele }] as any, this);
}
unobserve() {}
disconnect() {}
};
Loading