Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 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
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
- 'source/src/**'
- 'examples/src/**/*.spec.ts'
- 'examples/src/**/*.page.tsx'
- 'examples/src/**/*.ts'

concurrency:
group: ${{ github.workflow }}
Expand Down
110 changes: 97 additions & 13 deletions examples/perf-baselines.ci.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,107 @@
{
"tests/table/perf/default:horizontal-scrolling": {
"scriptingTime": 111.42,
"renderingTime": 26.61,
"paintingTime": 8.89,
"totalTime": 714.34,
"tests/table/perf/default:horizontal-scrolling with tracing": {
"scriptingTime": 135.73,
"renderingTime": 23.92,
"paintingTime": 8.11,
"totalTime": 628.45,
"threshold": 10
},
"tests/table/perf/flashing/default:perf should be fine when single click": {
"scriptingTime": 22.01,
"renderingTime": 0.48,
"paintingTime": 0.07,
"totalTime": 155.95,
"threshold": 10
},
"tests/table/perf/flashing/default:should be able to collapse and expand nodes with no error": {
"scriptingTime": 163.94,
"renderingTime": 81.91,
"paintingTime": 5.63,
"totalTime": 451.16,
"threshold": 10
},
"tests/table/perf/flashing/default:perf should remain stable for 50 clicks": {
"scriptingTime": 847.02,
"renderingTime": 35.58,
"paintingTime": 28.71,
"totalTime": 3126.17,
"threshold": 10
},
"tests/table/props/column/column-change:works correctly": {
"scriptingTime": 39.5,
"renderingTime": 4.08,
"paintingTime": 0.88,
"totalTime": 251.63,
"threshold": 10
},
"tests/table/props/column-pinning/virtualization:should work correctly": {
"scriptingTime": 162.82,
"renderingTime": 8.74,
"paintingTime": 0.9,
"totalTime": 230.74,
"threshold": 10
},
"tests/table/props/data/basic-add-data:insert data": {
"scriptingTime": 198.43,
"renderingTime": 4.35,
"paintingTime": 1.37,
"totalTime": 301.11,
"threshold": 10
},
"tests/table/props/data/basic-update:via API should not rerender header": {
"scriptingTime": 23.61,
"renderingTime": 2.46,
"paintingTime": 0.97,
"totalTime": 221.55,
"threshold": 10
},
"tests/table/props/data/editing/column-editor:should use custom editor when configured": {
"scriptingTime": 118.99,
"renderingTime": 32.66,
"paintingTime": 5.04,
"totalTime": 628.58,
"threshold": 10
},
"tests/table/props/data/editing/persistEdit:should not persist changes to the id column": {
"scriptingTime": 56.02,
"renderingTime": 11.96,
"paintingTime": 1.26,
"totalTime": 294.24,
"threshold": 10
},
"tests/table/props/data/editing/persistEdit:should call and wait for async persistEdit correctly": {
"scriptingTime": 81.64,
"renderingTime": 20.67,
"paintingTime": 2.25,
"totalTime": 575.84,
"threshold": 10
},
"tests/table/props/data/edit-with-delay:on string column": {
"scriptingTime": 322.51,
"renderingTime": 24.6,
"paintingTime": 17.67,
"totalTime": 4084.08,
"threshold": 10
},
"tests/table/props/filtering/filter-value/client-side:Filters correctly": {
"scriptingTime": 254.35,
"renderingTime": 29.37,
"paintingTime": 7.81,
"totalTime": 455.72,
"threshold": 10
},
"tests/table/props/data/scrolling:scrolls the table with performance tracing": {
"scriptingTime": 304.86,
"renderingTime": 94.59,
"paintingTime": 49.87,
"totalTime": 652.31,
"scriptingTime": 473.23,
"renderingTime": 141,
"paintingTime": 57.1,
"totalTime": 906.55,
"threshold": 10
},
"tests/table/props/data/update:clicks update button 30 times with performance tracing": {
"scriptingTime": 579.33,
"renderingTime": 36.93,
"paintingTime": 51.26,
"totalTime": 3089.28,
"scriptingTime": 642.03,
"renderingTime": 43.1,
"paintingTime": 45.53,
"totalTime": 3284.21,
"threshold": 10
}
}
127 changes: 116 additions & 11 deletions examples/perf-baselines.radubrehar.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
{
"tests/table/props/data/update:clicks update button 30 times with performance tracing": {
"scriptingTime": 1464.83,
"renderingTime": 23.22,
"paintingTime": 13.42,
"totalTime": 3736.29,
"threshold": 10
},
"tests/table/props/data/scrolling:clicks update button 30 times with performance tracing": {
"scriptingTime": 1919.15,
"renderingTime": 24.01,
Expand All @@ -14,10 +7,122 @@
"threshold": 10
},
"tests/table/props/data/scrolling:scrolls the table with performance tracing": {
"scriptingTime": 546.06,
"renderingTime": 33.65,
"paintingTime": 17.5,
"totalTime": 679.69,
"scriptingTime": 256.07,
"renderingTime": 33.59,
"paintingTime": 7.53,
"totalTime": 407.22,
"threshold": 10
},
"tests/table/perf/default:horizontal-scrolling": {
"scriptingTime": 133.1,
"renderingTime": 11.79,
"paintingTime": 3.78,
"totalTime": 638.69,
"threshold": 10
},
"tests/table/props/data/basic-update:via API should not rerender header": {
"scriptingTime": 64.32,
"renderingTime": 1.21,
"paintingTime": 0.2,
"totalTime": 114.46,
"threshold": 10
},
"tests/table/props/column-pinning/virtualization:should work correctly": {
"scriptingTime": 13.21,
"renderingTime": 2.95,
"paintingTime": 0.31,
"totalTime": 93.6,
"threshold": 10
},
"tests/table/props/column/column-change:works correctly": {
"scriptingTime": 81.79,
"renderingTime": 2.38,
"paintingTime": 0.52,
"totalTime": 195.19,
"threshold": 10
},
"tests/table/props/data/editing/column-editor:should use custom editor when configured": {
"scriptingTime": 126.92,
"renderingTime": 11.75,
"paintingTime": 1.58,
"totalTime": 515.07,
"threshold": 10
},
"tests/table/props/data/editing/persistEdit:should call and wait for async persistEdit correctly": {
"scriptingTime": 124.13,
"renderingTime": 7.72,
"paintingTime": 0.84,
"totalTime": 433.35,
"threshold": 10
},
"tests/table/props/data/editing/persistEdit:should not persist changes to the id column": {
"scriptingTime": 111.24,
"renderingTime": 6.03,
"paintingTime": 0.96,
"totalTime": 221.65,
"threshold": 10
},
"tests/table/props/data/basic-add-data:insert data": {
"scriptingTime": 85.44,
"renderingTime": 1.87,
"paintingTime": 0.71,
"totalTime": 136.82,
"threshold": 10
},
"tests/table/props/data/edit-with-delay:on string column": {
"scriptingTime": 117.09,
"renderingTime": 9.03,
"paintingTime": 1.78,
"totalTime": 3834.25,
"threshold": 10
},
"tests/table/props/filtering/filter-value/client-side:Filters correctly": {
"scriptingTime": 109.36,
"renderingTime": 8.93,
"paintingTime": 2.03,
"totalTime": 265.19,
"threshold": 10
},
"tests/table/perf/flashing/default:perf should be fine when single click": {
"scriptingTime": 202.74,
"renderingTime": 0.76,
"paintingTime": 0.34,
"totalTime": 234.22,
"threshold": 10
},
"tests/table/perf/flashing/default:should be able to collapse and expand nodes with no error": {
"scriptingTime": 439.85,
"renderingTime": 25.64,
"paintingTime": 2.89,
"totalTime": 545.17,
"threshold": 10
},
"tests/table/perf/flashing/default:perf should remain stable for 50 clicks": {
"scriptingTime": 1705.11,
"renderingTime": 31.73,
"paintingTime": 25.01,
"totalTime": 4403.5,
"threshold": 10
},
"tests/table/props/data/update:clicks update button 30 times with performance tracing": {
"scriptingTime": 1021.06,
"renderingTime": 20.84,
"paintingTime": 12.36,
"totalTime": 3216.48,
"threshold": 10
},
"tests/table/perf/default:horizontal-scrolling.": {
"scriptingTime": 293.15,
"renderingTime": 10.42,
"paintingTime": 2.43,
"totalTime": 734.17,
"threshold": 10
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicate baseline entry with trailing dot typo

Low Severity

The baselines file contains "tests/table/perf/default:horizontal-scrolling." (with a trailing dot) which doesn't match any test name. The file already has the correct entry "tests/table/perf/default:horizontal-scrolling" (without trailing dot) and "...horizontal-scrolling with tracing". This orphaned entry will never be matched and may cause confusion about expected baselines.

Fix in Cursor Fix in Web

"tests/table/perf/default:horizontal-scrolling with tracing": {
"scriptingTime": 290.12,
"renderingTime": 10.42,
"paintingTime": 2.46,
"totalTime": 797.07,
"threshold": 10
}
}
13 changes: 10 additions & 3 deletions examples/src/pages/components/datasource/index.page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as React from 'react';

import { DataSource, useDataSourceState } from '@infinite-table/infinite-react';
import {
DataSource,
useDataSourceSelector,
} from '@infinite-table/infinite-react';

interface Person {
name: string;
Expand All @@ -13,9 +16,13 @@ const persons: Person[] = [
];

const Cmp = () => {
const ds = useDataSourceState<Person>();
const { dataArray, loading } = useDataSourceSelector((ctx) => {
return {
dataArray: ctx.dataSourceState.dataArray,
loading: ctx.dataSourceState.loading,
};
});

const { dataArray, loading } = ds;
return (
<div>
{loading ? 'loading' : null}
Expand Down
14 changes: 10 additions & 4 deletions examples/src/pages/tests/datasource/default.page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import * as React from 'react';

import { DataSource, useDataSourceState } from '@infinite-table/infinite-react';
import {
DataSource,
useDataSourceSelector,
} from '@infinite-table/infinite-react';

interface Person {
name: string;
Expand All @@ -14,9 +17,12 @@ const persons: Person[] = [
];

const Cmp = () => {
const ds = useDataSourceState<Person>();

const { dataArray, loading } = ds;
const { dataArray, loading } = useDataSourceSelector((ctx) => {
return {
dataArray: ctx.dataSourceState.dataArray,
loading: ctx.dataSourceState.loading,
};
});

return (
<div aria-label="container" style={{ color: 'tomato' }}>
Expand Down
11 changes: 7 additions & 4 deletions examples/src/pages/tests/datasource/grouped-ssr.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,16 @@ import * as React from 'react';
import {
DataSource,
DataSourceData,
useDataSourceState,
useDataSourceSelector,
} from '@infinite-table/infinite-react';

const Cmp = () => {
const ds = useDataSourceState<Developer>();

const { dataArray, loading } = ds;
const { dataArray, loading } = useDataSourceSelector((ctx) => {
return {
dataArray: ctx.dataSourceState.dataArray,
loading: ctx.dataSourceState.loading,
};
});

return (
<div>
Expand Down
11 changes: 7 additions & 4 deletions examples/src/pages/tests/datasource/sortinfo-controlled.page.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import {
DataSource,
DataSourceSortInfo,
useDataSourceState,
useDataSourceSelector,
} from '@infinite-table/infinite-react';
import * as React from 'react';

import { Person, persons } from './sortPersons';
const Cmp = () => {
const ds = useDataSourceState<Person>();

const { dataArray, loading } = ds;
const { dataArray, loading } = useDataSourceSelector((ctx) => {
return {
dataArray: ctx.dataSourceState.dataArray,
loading: ctx.dataSourceState.loading,
};
});

return (
<div>
Expand Down
8 changes: 6 additions & 2 deletions examples/src/pages/tests/table/custom-structure.page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
InfiniteTableColumn,
DataSourceGroupBy,
components,
useDataSourceState,
useDataSourceSelector,
} from '@infinite-table/infinite-react';
import * as React from 'react';

Expand Down Expand Up @@ -98,7 +98,11 @@ export default function App() {
}

function AppGrid() {
const { dataArray } = useDataSourceState();
const { dataArray } = useDataSourceSelector((ctx) => {
return {
dataArray: ctx.dataSourceState.dataArray,
};
});
return (
<div
style={{
Expand Down
Loading