Skip to content
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
4 changes: 4 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ jobs:
name: build-${{ matrix.react }}
path: packages

# TODO: remove once Cypress properly installs the binary via postinstall
- name: Install Cypress binary
run: npx cypress install

- name: Cypress run
uses: cypress-io/github-action@783cb3f07983868532cabaedaa1e6c00ff4786a8 # v7.1.9
with:
Expand Down
4 changes: 0 additions & 4 deletions .storybook/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ export function useFakeStream(initialValue = '', typingDelay = 10, startingDelay
const [isTyping, setIsTyping] = useState(false); // actively typing characters
const intervalRef = useRef<ReturnType<typeof setInterval> | null>(null);
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const isProcessingRef = useRef(isProcessing);
const isTypingRef = useRef(isTyping);
isProcessingRef.current = isProcessing;
isTypingRef.current = isTyping;

const startStream = ({ text, onComplete, onProcessingComplete }: StartStreamOptions) => {
// Stop previous stream and timeout
Expand Down
576 changes: 288 additions & 288 deletions .yarn/releases/yarn-4.13.0.cjs → .yarn/releases/yarn-4.14.1.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.13.0.cjs
yarnPath: .yarn/releases/yarn-4.14.1.cjs
16 changes: 0 additions & 16 deletions cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
import codeCoverageTask from '@cypress/code-coverage/task';
import { defineConfig } from 'cypress';

//todo: remove once officially supported by Cypress: https://github.com/cypress-io/cypress/issues/33078
const stripLegacyCypressOptimizeDepsPlugin = () => ({
name: 'cypress-vite8-compat',
config(config) {
if (config?.optimizeDeps?.esbuildOptions) {
delete config.optimizeDeps.esbuildOptions;
}
},
});

export default defineConfig({
env: {
codeCoverage: {
Expand All @@ -37,12 +27,6 @@ export default defineConfig({
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: {
// passing `viteConfig` as an object makes Cypress set `configFile: false` internally
configFile: 'vite.config.ts',
// plugins from both configs are merged by Vite's `mergeConfig`
plugins: [stripLegacyCypressOptimizeDepsPlugin()],
},
},
experimentalRunAllSpecs: true,
excludeSpecPattern: ['**/e2e/**', ...(process.env.CI ? ['**/SelectDialog/**'] : [])],
Expand Down
16 changes: 0 additions & 16 deletions examples/vite-ts/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { defineConfig } from 'cypress';

//todo: remove once officially supported by Cypress: https://github.com/cypress-io/cypress/issues/33078
const stripLegacyCypressOptimizeDepsPlugin = () => ({
name: 'cypress-vite8-compat',
config(config) {
if (config?.optimizeDeps?.esbuildOptions) {
delete config.optimizeDeps.esbuildOptions;
}
},
});

export default defineConfig({
includeShadowDom: true,
viewportWidth: 1920,
Expand All @@ -18,12 +8,6 @@ export default defineConfig({
devServer: {
framework: 'react',
bundler: 'vite',
viteConfig: {
// passing `viteConfig` as an object makes Cypress set `configFile: false` internally
configFile: 'vite.config.ts',
// plugins from both configs are merged by Vite's `mergeConfig`
plugins: [stripLegacyCypressOptimizeDepsPlugin()],
},
},
},

Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@
"@types/react-dom": "19.2.3",
"@ui5/webcomponents-tools": "2.21.1",
"@vitejs/plugin-react": "6.0.1",
"chromatic": "16.2.0",
"chromatic": "16.3.0",
"cssnano": "7.1.5",
"cypress": "15.13.1",
"cypress": "15.14.0",
"cypress-real-events": "1.15.0",
"dedent": "1.7.2",
"documentation": "14.0.3",
Expand All @@ -89,10 +89,10 @@
"eslint-plugin-no-only-tests": "3.3.0",
"eslint-plugin-prettier": "5.5.5",
"eslint-plugin-react": "7.37.5",
"eslint-plugin-react-hooks": "7.0.1",
"eslint-plugin-react-hooks": "7.1.0",
"eslint-plugin-storybook": "10.3.5",
"glob": "13.0.6",
"globals": "17.4.0",
"globals": "17.5.0",
"husky": "9.1.7",
"lerna": "9.0.7",
"lint-staged": "16.4.0",
Expand Down Expand Up @@ -132,5 +132,5 @@
"lcov"
]
},
"packageManager": "yarn@4.13.0"
"packageManager": "yarn@4.14.1"
}
2 changes: 2 additions & 0 deletions packages/base/src/internal/hooks/useSyncRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ export function useSyncRef<RefType = never>(
const localRef = useRef<RefType | null>(null);

const componentRef = useCallback(
// callback ref forwards to external ref
// eslint-disable-next-line react-hooks/immutability
(node) => {
if (ref) {
if (typeof ref === 'function') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ describe('withWebComponent', () => {
</Button>
<Popover
open={open}
// eslint-disable-next-line react-hooks/refs
opener={btnRef.current}
onClose={() => {
setOpen(false);
Expand Down
4 changes: 2 additions & 2 deletions packages/charts/src/components/BarChart/BarChart.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { complexDataSet } from '../../resources/DemoProps.js';
import { BarChart } from './index.js';
import {
cypressPassThroughTestsFactory,
testChartLegendConfig,
testChartZoomingTool,
testStackAggregateTotals,
} from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { BarChart } from './index.js';

const dimensions = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { complexDataSet } from '../../resources/DemoProps.js';
import { BulletChart } from './index.js';
import {
cypressPassThroughTestsFactory,
testChartLegendConfig,
testChartZoomingTool,
} from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { BulletChart } from './index.js';

const dimensions = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { complexDataSet } from '../../resources/DemoProps.js';
import { ColumnChart } from './index.js';
import {
cypressPassThroughTestsFactory,
testChartLegendConfig,
testChartZoomingTool,
testStackAggregateTotals,
} from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { ColumnChart } from './index.js';

const dimensions = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { complexDataSet } from '../../resources/DemoProps.js';
import { ColumnChartWithTrend } from './index.js';
import {
cypressPassThroughTestsFactory,
testChartLegendConfig,
testChartZoomingTool,
} from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { ColumnChartWithTrend } from './index.js';

const dimensions = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { complexDataSet } from '../../resources/DemoProps.js';
import { ComposedChart } from './index.js';
import {
cypressPassThroughTestsFactory,
testChartLegendConfig,
testChartZoomingTool,
testStackAggregateTotals,
} from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { ComposedChart } from './index.js';

const dimensions = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';
import { complexDataSet, simpleDataSet } from '../../resources/DemoProps.js';
import { DonutChart } from './index.js';
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';

const dimension = {
accessor: 'name',
Expand Down
4 changes: 2 additions & 2 deletions packages/charts/src/components/LineChart/LineChart.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { complexDataSet } from '../../resources/DemoProps.js';
import { LineChart } from './index.js';
import {
cypressPassThroughTestsFactory,
testChartLegendConfig,
testChartZoomingTool,
} from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { LineChart } from './index.js';

const dimensions = [
{
Expand Down
2 changes: 1 addition & 1 deletion packages/charts/src/components/PieChart/PieChart.cy.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Text as RechartsText } from 'recharts';
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';
import { complexDataSet, simpleDataSet } from '../../resources/DemoProps.js';
import { PieChart } from './index.js';
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';

const dimension = {
accessor: 'name',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';
import { complexDataSet } from '../../resources/DemoProps.js';
import { RadarChart } from './index.js';
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';

const dimensions = [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { RadialChart } from './index.js';
import { cypressPassThroughTestsFactory } from '../../../../../cypress/support/utils';
import { RadialChart } from './index.js';

describe('RadialChart', () => {
it('Basic', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';
import { complexDataSet, scatterComplexDataSet } from '../../resources/DemoProps.js';
import { ScatterChart } from './index.js';
import { cypressPassThroughTestsFactory, testChartLegendConfig } from '../../../../../cypress/support/utils';

const measures = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export const OverflowPopover: FC<OverflowPopoverProps> = (props: OverflowPopover

const [canRenderPortal, setCanRenderPortal] = useState(false);
useEffect(() => {
// SSR guard
// eslint-disable-next-line react-hooks/set-state-in-effect
setCanRenderPortal(true);
}, []);

Expand Down Expand Up @@ -164,7 +166,6 @@ export const OverflowPopover: FC<OverflowPopoverProps> = (props: OverflowPopover
return (
<OverflowPopoverContextProvider value={{ inPopover: true }}>
{overflowButton ? (
// eslint-disable-next-line react-hooks/refs
cloneElement(overflowButton, { onClick: clonedOverflowButtonClick })
) : (
<ToggleButton
Expand Down
3 changes: 1 addition & 2 deletions packages/compat/src/components/Toolbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,10 @@ const Toolbar = forwardRef<HTMLDivElement, ToolbarPropTypes>((props, ref) => {
}, [children]);

const childrenWithRef = useMemo(() => {
// eslint-disable-next-line react-hooks/refs
controlMetaData.current = [];

let hasOnlySpacersOrSeparators = true;
// eslint-disable-next-line react-hooks/refs

const enrichedChildren = flatChildren.map((item, index) => {
const itemRef: RefObject<HTMLDivElement> = createRef();
// @ts-expect-error: if type is not defined, it's not a spacer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4129,7 +4129,6 @@ describe('AnalyticalTable', () => {
// transform data to the pattern which is accepted by the tree table
// NOTES: this algorithm is less likely related to the bug, because in our reality project there is a different algorithm to generate the tree table and the bug still occurs.
const data = useMemo(() => {
// eslint-disable-next-line react-hooks/refs
raw.forEach((item) => {
const newItem = { ...item };
rowById.current[newItem.nodeId] = {
Expand All @@ -4153,7 +4152,7 @@ describe('AnalyticalTable', () => {
rowById.current[newItem.parentId].subRows.push(rowById.current[newItem.nodeId]);
}
});
// eslint-disable-next-line react-hooks/refs

return Object.values(rowById.current).filter((row) => !row.parentId);
}, [raw]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const VirtualTableBodyContainer = (props: VirtualTableBodyContainerProps)
useIsomorphicLayoutEffect(() => {
if (parentRef.current) {
// Run before paint so rows appear with the body container (avoids empty-body flash).
// eslint-disable-next-line react-hooks/set-state-in-effect

setIsMounted(true);
}
}, [parentRef]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const useInstance = (instance: TableInstance) => {

const prevSelectedRowIdsRef = useRef(selectedRowIds);

// react-table instance is intentionally mutable
// eslint-disable-next-line react-hooks/immutability
useEffect(() => {
const pendingEvent = instance.pendingSelectEvent;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export function useSyncScroll(
const isProgrammatic = useRef(false);
const [isMounted, setIsMounted] = useState(false);

// DOM scrollTop manipulation, not React state
// eslint-disable-next-line react-hooks/immutability
useEffect(() => {
if (disabled || !isScrollable) {
return;
Expand All @@ -19,6 +21,8 @@ export function useSyncScroll(
const scrollbar = refScrollbar.current;

if (!content || !scrollbar || !isMounted) {
// Forces a second effect run so refs are populated
// eslint-disable-next-line react-hooks/set-state-in-effect
setIsMounted(true);
return;
}
Expand Down
11 changes: 11 additions & 0 deletions packages/main/src/components/FilterBar/FilterDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,14 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
[children],
);

// orderedChildren syncs from children but also has independent mutations (reorder, restore)
/* eslint-disable react-hooks/set-state-in-effect */
useEffect(() => {
if (children.length) {
setOrderedChildren(visibleChildren());
}
}, [children, visibleChildren]);
/* eslint-enable react-hooks/set-state-in-effect */

const renderChildren = () => {
const searchStringLower = searchString.toLowerCase();
Expand Down Expand Up @@ -299,6 +302,8 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
}
}, [orderedChildren, onReorder]);

// Reorder triggers setOrderedChildren; currentReorderedItem also provides context value
/* eslint-disable react-hooks/set-state-in-effect */
useEffect(() => {
if (currentReorderedItem?.index != null) {
const { index, direction } = currentReorderedItem;
Expand Down Expand Up @@ -342,6 +347,7 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
void currentReorderedItem.target.focus();
}
}, [currentReorderedItem]);
/* eslint-enable react-hooks/set-state-in-effect */

useEffect(() => {
if (updatedIndex != null) {
Expand Down Expand Up @@ -396,6 +402,8 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
}
};

// Two-phase pattern: handler sets forceRequired, effect processes it after render and clears it
/* eslint-disable react-hooks/set-state-in-effect */
useEffect(() => {
if (forceRequired && forceRequired.target) {
const { prevSelected, selectedKeys, selected: _selected, required, target } = forceRequired;
Expand All @@ -414,6 +422,7 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
// `forceRequired` triggers async DOM update; no extra deps needed
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [forceRequired]);
/* eslint-enable react-hooks/set-state-in-effect */

const renderGroups = () => {
const groups = {};
Expand Down Expand Up @@ -455,6 +464,8 @@ export const FilterDialog = (props: FilterDialogPropTypes) => {
});
};

// One-time lazy init, idempotent under Strict Mode
// eslint-disable-next-line react-hooks/refs
if (initialSelected.current === undefined && selected.length) {
initialSelected.current = selectedFilters;
}
Expand Down
Loading
Loading