Repository navigation
[ENHANCEMENT] Upgrade Oxlint and fix React Compiler errors #826
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
Gladorme
merged 9 commits into
perses:main
from
Gladorme:t3code/upgrade-oxlint-oxfmt-fix-react-memo
Oct 7, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
4d1b8ec
[IGNORE] Upgrade Oxlint and fix React Compiler diagnostics
Gladorme c1f24cf
[IGNORE] Upgrade Oxlint and fix React Compiler diagnostics
Gladorme 9746ea2
Fable review
Gladorme 64a0e7d
Replace Perses useId with React useId
Gladorme 8b6cbfd
[IGNORE] Enforce no explicit any in TypeScript
Gladorme af92114
Bump version
Gladorme f405863
Fix PieChart
Gladorme ac135fa
[IGNORE] Fix review feedback on React Compiler changes
Gladorme 4e1216f
Fix issues 1, 4, 7, 8, 11, 13
Gladorme File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import { fireEvent, render, screen } from '@testing-library/react'; | ||
| import type { ReactElement } from 'react'; | ||
| import { useCallback, useState } from 'react'; | ||
|
|
||
| import type { BaseColumnDefinition } from './ColumnsEditor'; | ||
| import { ColumnsEditor } from './ColumnsEditor'; | ||
|
|
||
| const SORT_MODES = { alphabetical: 'Alphabetical' }; | ||
| const INITIAL_COLUMNS = [{ name: 'first' }, { name: 'second' }]; | ||
| const getName = (column: BaseColumnDefinition): string => column.name; | ||
| const renderName = (column: BaseColumnDefinition): ReactElement => ( | ||
| <input aria-label="Column name" defaultValue={column.name} /> | ||
| ); | ||
| const onUpdate = vi.fn(); | ||
|
|
||
| function Editor(): ReactElement { | ||
| const [columns, setColumns] = useState(INITIAL_COLUMNS); | ||
| const onAdd = useCallback((): void => setColumns((previous) => [...previous, { name: 'added' }]), []); | ||
| const onRemove = useCallback( | ||
| (index: number): void => setColumns((previous) => previous.filter((_, i) => i !== index)), | ||
| [], | ||
| ); | ||
| const move = useCallback((index: number, offset: number): void => { | ||
| setColumns((previous) => { | ||
| const next = [...previous]; | ||
| const [column] = next.splice(index, 1); | ||
| if (column) next.splice(index + offset, 0, column); | ||
| return next; | ||
| }); | ||
| }, []); | ||
| const onMoveUp = useCallback((index: number): void => move(index, -1), [move]); | ||
| const onMoveDown = useCallback((index: number): void => move(index, 1), [move]); | ||
|
|
||
| return ( | ||
| <ColumnsEditor | ||
| columns={columns} | ||
| description="Columns" | ||
| sortModeLabels={SORT_MODES} | ||
| defaultSortMode="alphabetical" | ||
| getDisplayName={getName} | ||
| getHeaderPlaceholder={getName} | ||
| onAdd={onAdd} | ||
| onRemove={onRemove} | ||
| onUpdate={onUpdate} | ||
| onMoveUp={onMoveUp} | ||
| onMoveDown={onMoveDown} | ||
| renderNameField={renderName} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| describe('ColumnsEditor', () => { | ||
| it('keeps local edits with their column when moving, removing, and adding columns', () => { | ||
| render(<Editor />); | ||
| const firstInput = screen.getAllByRole('textbox', { name: 'Column name' })[0]!; | ||
| fireEvent.change(firstInput, { target: { value: 'draft' } }); | ||
|
|
||
| fireEvent.click(screen.getAllByRole('button', { name: 'Move column down' })[0]!); | ||
| expect(screen.getAllByRole('textbox', { name: 'Column name' })[1]).toBe(firstInput); | ||
| expect(firstInput).toHaveValue('draft'); | ||
|
|
||
| fireEvent.click(screen.getAllByRole('button', { name: 'Move column up' })[1]!); | ||
| expect(screen.getAllByRole('textbox', { name: 'Column name' })[0]).toBe(firstInput); | ||
|
|
||
| fireEvent.click(screen.getAllByRole('button', { name: 'Remove column' })[1]!); | ||
| fireEvent.click(screen.getByRole('button', { name: 'Add column' })); | ||
| expect(screen.getAllByRole('textbox', { name: 'Column name' })[0]).toBe(firstInput); | ||
| expect(firstInput).toHaveValue('draft'); | ||
| expect(screen.getAllByRole('textbox', { name: 'Column name' })[1]).toHaveValue('added'); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| // Copyright The Perses Authors | ||
| // Licensed under the Apache License, Version 2.0 (the "License"); | ||
| // you may not use this file except in compliance with the License. | ||
| // You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, software | ||
| // distributed under the License is distributed on an "AS IS" BASIS, | ||
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| // See the License for the specific language governing permissions and | ||
| // limitations under the License. | ||
|
|
||
| import { fireEvent, render, screen } from '@testing-library/react'; | ||
|
|
||
| import { LazyTextField } from './LazyTextField'; | ||
|
|
||
| describe('LazyTextField', () => { | ||
| it('preserves an uncommitted draft across renders and commits it on blur', () => { | ||
| const onCommit = vi.fn(); | ||
| const { rerender } = render(<LazyTextField label="Matcher" value="initial" onCommit={onCommit} />); | ||
| fireEvent.change(screen.getByRole('textbox'), { target: { value: 'draft' } }); | ||
| rerender(<LazyTextField label="Matcher" value="initial" onCommit={onCommit} />); | ||
|
|
||
| expect(screen.getByRole('textbox')).toHaveValue('draft'); | ||
| expect(onCommit).not.toHaveBeenCalled(); | ||
| fireEvent.blur(screen.getByRole('textbox')); | ||
| expect(onCommit).toHaveBeenCalledWith('draft'); | ||
| }); | ||
|
|
||
| it('resets a draft when the committed value changes or is cleared', () => { | ||
| const onCommit = vi.fn(); | ||
| const { rerender } = render(<LazyTextField label="Matcher" value="initial" onCommit={onCommit} />); | ||
| fireEvent.change(screen.getByRole('textbox'), { target: { value: 'draft' } }); | ||
| rerender(<LazyTextField label="Matcher" value="updated" onCommit={onCommit} />); | ||
| expect(screen.getByRole('textbox')).toHaveValue('updated'); | ||
|
|
||
| rerender(<LazyTextField label="Matcher" onCommit={onCommit} />); | ||
| expect(screen.getByRole('textbox')).toHaveValue(''); | ||
| expect(onCommit).not.toHaveBeenCalled(); | ||
| }); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.