Skip to content

Conversation

sedghi
Copy link
Member

@sedghi sedghi commented Jul 29, 2025

to get ready for react compiler

Copy link

netlify bot commented Jul 29, 2025

Deploy Preview for ohif-dev ready!

Name Link
🔨 Latest commit 9b8ca35
🔍 Latest deploy log https://app.netlify.com/projects/ohif-dev/deploys/688bb34f6903db00086c7402
😎 Deploy Preview https://deploy-preview-5277--ohif-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@sedghi sedghi changed the title react compiler react 19 draft Jul 29, 2025
@sedghi sedghi marked this pull request as draft July 29, 2025 23:23
Copy link

cypress bot commented Jul 29, 2025

Viewers    Run #5466

Run Properties:  status check passed Passed #5466  •  git commit 9b8ca35e88: add stuff
Project Viewers
Branch Review react-compiler
Run status status check passed Passed #5466
Run duration 02m 26s
Commit git commit 9b8ca35e88: add stuff
Committer Ibrahim
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 37
View all changes introduced in this branch ↗︎

@IbrahimCSAE IbrahimCSAE requested review from Copilot and IbrahimCSAE and removed request for Copilot July 30, 2025 08:08
@IbrahimCSAE IbrahimCSAE self-assigned this Jul 30, 2025
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR migrates the OHIF codebase from PropTypes to TypeScript interfaces, removing prop-types dependencies in preparation for React 19 compatibility. The migration replaces PropTypes validation with TypeScript type definitions for better type safety and modern React development practices.

  • Removed PropTypes imports and validation from React components
  • Added TypeScript interfaces to replace PropTypes definitions
  • Updated React DOM rendering methods from legacy ReactDOM.render to createRoot API
  • Fixed TypeScript typing issues with ref objects and React element types

Reviewed Changes

Copilot reviewed 117 out of 118 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
platform/ui/src/components/ Migrated all UI components from PropTypes to TypeScript interfaces
platform/ui-next/src/components/ Updated UI-next components to use TypeScript interfaces instead of PropTypes
platform/app/src/ Converted app-level components and route handlers to TypeScript interfaces
extensions/ Updated extension components to replace PropTypes with TypeScript types
package.json Updated react-shepherd dependency version

@@ -1,3 +1,4 @@
import { createRoot, createRoot } from "react-dom/client";
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Duplicate import of createRoot - only one import is needed.

Suggested change
import { createRoot, createRoot } from "react-dom/client";
import { createRoot } from "react-dom/client";

Copilot uses AI. Check for mistakes.

if (portalNodes[this.props.group]) {
// Todo: move this to root.unmount
ReactDOM.unmountComponentAtNode(portalNodes[this.props.group].node);
const root = createRoot(portalNodes[this.props.group].node);
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Creating a new root on every unmount will cause memory leaks. The root should be created once and stored, then reused for render calls and properly unmounted.

Copilot uses AI. Check for mistakes.

Comment on lines +141 to +144
interface ViewportGridProviderProps {
children?: any;
service: ViewportGridService;
}
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Duplicate interface definition - ViewportGridProviderProps is defined twice. Remove the duplicate definition.

Suggested change
interface ViewportGridProviderProps {
children?: any;
service: ViewportGridService;
}
// Removed duplicate definition of ViewportGridProviderProps

Copilot uses AI. Check for mistakes.

deduplicationInterval?: number;
}

interface NotificationProviderProps {
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Duplicate interface definition - NotificationProviderProps is defined twice with different properties. Merge into a single interface definition.

Copilot uses AI. Check for mistakes.

children,
label = 'More',
icon = 'tool-more-menu',
isActive
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Parameter isActive is used in the function but not defined in the NestedMenuProps interface.

Copilot uses AI. Check for mistakes.

Comment on lines 52 to 61
interface LayoutSelectorProps {
onSelectionChange?(...args: unknown[]): unknown;
onSelection?(...args: unknown[]): unknown;
onSelectionPreset?(...args: unknown[]): unknown;
children: React.ReactNode;
open?: boolean;
onOpenChange?(...args: unknown[]): unknown;
tooltipDisabled?: boolean;
}

Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Duplicate interface definition - LayoutSelectorProps is defined twice. Remove the duplicate definition and ensure all required properties are in the single interface.

Suggested change
interface LayoutSelectorProps {
onSelectionChange?(...args: unknown[]): unknown;
onSelection?(...args: unknown[]): unknown;
onSelectionPreset?(...args: unknown[]): unknown;
children: React.ReactNode;
open?: boolean;
onOpenChange?(...args: unknown[]): unknown;
tooltipDisabled?: boolean;
}

Copilot uses AI. Check for mistakes.

Comment on lines 38 to 39
import { ShepherdJourneyProvider } from 'react-shepherd';

Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

[nitpick] Import should be grouped with other imports at the top of the file rather than separated by blank lines and other code.

Suggested change
import { ShepherdJourneyProvider } from 'react-shepherd';

Copilot uses AI. Check for mistakes.


function CallbackPage({
userManager,
onRedirectSuccess
Copy link
Preview

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

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

Parameter onRedirectSuccess is used in the function but not defined in the CallbackPageProps interface.

Copilot uses AI. Check for mistakes.

@salimkanoun
Copy link
Contributor

I think you are going to hit an issue with react shephred shipshapecode/shepherd#3102

@IbrahimCSAE
Copy link
Collaborator

I think you are going to hit an issue with react shephred shipshapecode/shepherd#3102

Thanks for the heads up. I just removed it in the last commit, but still in progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants