Skip to content

Conversation

@mattrunyon
Copy link
Collaborator

@mattrunyon mattrunyon commented Sep 2, 2025

Other than upgrading to React 18, also did the following

  • Removed prop-types almost everywhere. There is 1 exported prop-types we consume in DHE, so not removing fully yet
  • Removed defaultProps on functional components. This is deprecated in 18 and removed completely in 19. We already had defaults with ES6 default params and having the component.defaultProps prints errors to the dev console that are annoying
  • Removed react-test-renderer. This is deprecated in 18 and removed in 19. Mainly had to update Grid and IrisGrid tests, but it was relatively minimal changes, the tests are faster, and better because they test simulated clicks instead of emitting the change events directly
  • Cleaned up all Jest warnings about act or other issues like throwing without suppressing error logs that are expected. The only output now should be about deprecated defaultProps on a react-beautiful-dnd component and findDOMNode being deprecated for transitions
  • Removed StyleGuide.test.tsx. We have e2e tests that are better and this unit test was causing issues with act because it has a bunch of lazy loaded components Jest can't resolve without changing the import map
  • Fixed some types in IrisGrid around props and state that were incorrect
  • Modified some e2e tests to be a bit more robust with the state batching

@mattrunyon mattrunyon requested a review from mofojed September 2, 2025 21:15
@mattrunyon mattrunyon self-assigned this Sep 2, 2025
Comment on lines +39 to +46
Component: React.ComponentType<React.PropsWithoutRef<P>>
): XComponentType<P> {
let forwardedRefComponent: XComponentType<P>;
function XComponent(
props: P,
props: React.PropsWithoutRef<P>,
ref: React.ForwardedRef<ComponentType<P>>
): JSX.Element {
const ReplacementComponent = useXComponent(forwardedRefComponent);
const ReplacementComponent = useXComponent<P>(forwardedRefComponent);
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I should test these types don't break DHE usages of XComponent

Copy link
Member

Choose a reason for hiding this comment

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

Yes

@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 24.76636% with 161 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.90%. Comparing base (f7fe8ad) to head (2bd6343).

Files with missing lines Patch % Lines
...kages/dashboard-core-plugins/src/ConsolePlugin.tsx 6.06% 31 Missing ⚠️
...sidebar/conditional-formatting/ConditionEditor.tsx 0.00% 15 Missing ⚠️
...ris-grid/src/sidebar/aggregations/Aggregations.tsx 28.57% 10 Missing ⚠️
packages/components/src/popper/Popper.tsx 0.00% 8 Missing ⚠️
...ebar/conditional-formatting/ColumnFormatEditor.tsx 0.00% 6 Missing ⚠️
...sidebar/conditional-formatting/RowFormatEditor.tsx 0.00% 6 Missing ⚠️
packages/components/src/CardFlip.tsx 0.00% 5 Missing ⚠️
packages/iris-grid/src/IrisGrid.tsx 0.00% 5 Missing ⚠️
...src/sidebar/conditional-formatting/StyleEditor.tsx 0.00% 5 Missing ⚠️
packages/code-studio/src/index.tsx 0.00% 4 Missing ⚠️
... and 33 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2527      +/-   ##
==========================================
- Coverage   44.95%   43.90%   -1.05%     
==========================================
  Files         765      763       -2     
  Lines       42917    42867      -50     
  Branches    10796    10816      +20     
==========================================
- Hits        19293    18821     -472     
- Misses      23611    24031     +420     
- Partials       13       15       +2     
Flag Coverage Δ
unit 43.90% <24.76%> (-1.05%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

'data-testid': dataTestId,
}: UISwitchProps): JSX.Element {
return (
// eslint-disable-next-line jsx-a11y/control-has-associated-label
Copy link
Member

Choose a reason for hiding this comment

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

Is this actually needed?

Copy link
Collaborator Author

@mattrunyon mattrunyon Sep 5, 2025

Choose a reason for hiding this comment

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

The ignore is. The label is not (or I don't think we have a good label here for accessibility on the switch button). I have no idea why this rule is getting applied when it wasn't before. I'm guessing some minor bump when the package-lock had to be regenerated

Copy link
Member

Choose a reason for hiding this comment

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

Okay. I'd say just mark this UISwitch as deprecated, we should just use the Switch component from Spectrum instead anyway.

Comment on lines +39 to +46
Component: React.ComponentType<React.PropsWithoutRef<P>>
): XComponentType<P> {
let forwardedRefComponent: XComponentType<P>;
function XComponent(
props: P,
props: React.PropsWithoutRef<P>,
ref: React.ForwardedRef<ComponentType<P>>
): JSX.Element {
const ReplacementComponent = useXComponent(forwardedRefComponent);
const ReplacementComponent = useXComponent<P>(forwardedRefComponent);
Copy link
Member

Choose a reason for hiding this comment

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

Yes

log.debug('closeFilePanel', fileMetadata);
const { id: fileId } = fileMetadata;
if (fileId == null) {
log.debug('File ID is null, ignore close event');
Copy link
Member

Choose a reason for hiding this comment

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

Probably want to make this a warn.

Suggested change
log.debug('File ID is null, ignore close event');
log.warn('File ID is null, ignore close event');

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ya we can. Although debug matches the same error in a few other spots like just below this if the file is not open it just debug prints it's ignoring the close

Copy link
Member

Choose a reason for hiding this comment

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

Actually why are we even bothering? Change FileMetadata to require id to be a string - it is never null anywhere that I can see... or just throw an assertNotNull(fileId) here instead of quietly failing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It is null when creating a new notebook or sending text from the history to a new notebook. It looks like we set it to the file name in NotebookPanel#handleSaveSuccess

I don't want to make a change in this PR as it would be a behavior change

@mattrunyon mattrunyon requested a review from mofojed September 16, 2025 22:18
Copy link
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

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

Just a question about the commented out code in table-operations.spec.ts.

@mattrunyon mattrunyon requested a review from mofojed September 30, 2025 21:39
@mattrunyon mattrunyon merged commit b369a51 into deephaven:main Oct 7, 2025
10 of 11 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants