-
Notifications
You must be signed in to change notification settings - Fork 5
Bump react and types 1959 #2033
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
Conversation
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react). These dependencies needed to be updated together. Updates `react` from 18.3.1 to 19.0.0 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react) Updates `@types/react` from 18.3.14 to 19.0.7 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: react dependency-type: direct:production update-type: version-update:semver-major - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…ackage was removed due to incompatibility with React 19.1.0, and a custom component was added instead.
There was a problem hiding this 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 bumps React and its types and refactors various components to align with updated APIs and stricter type annotations.
- Replace legacy ReactDOM.render with the new createRoot API in src/index.tsx.
- Refactor SimulationCardGrid header and footer props to use JSX syntax and update related type annotations.
- Adjust ref and worker type annotations for improved type safety in several components.
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/index.tsx | Updated React root rendering using the createRoot API. |
| src/WrapperApp/components/Simulation/SimulationCardGrid.tsx | Refactored header/footer rendering to use explicit JSX structure and updated type signatures. |
| src/WrapperApp/components/Results/Results3D.tsx | Changed Clipboard import to a local custom implementation. |
| src/WrapperApp/components/CopyToCliboard/CopyToCliboard.jsx | Added a new custom CopyToClipboard component. |
| src/ThreeEditor/components/ZoneManagerPanel/ZoneManagerPanel.tsx | Improved useRef type safety by allowing null. |
| src/ThreeEditor/components/Sidebar/SidebarTree/SidebarTreeItem.tsx | Updated ref callback to correctly manage objectRefs with addition and deletion. |
| src/ThreeEditor/components/Editor/SceneEditor.tsx | Adjusted ref types and cast to HTMLElement for keyboard controls. |
| src/PythonConverter/PythonConverterService.tsx | Updated workerRef type to account for null values. |
| src/JsRoot/hook/useJsRootCanvas.tsx | Ensured the container ref is cast to the expected HTMLDivElement type. |
Files not reviewed (1)
- package.json: Language not supported
grzanka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but take a look on some typo reported by copilot
There was a problem hiding this 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 modernizes the codebase by upgrading React dependencies, refactoring components for improved type safety, and replacing deprecated libraries with custom implementations.
- Upgrades React and ReactDOM to version 19.1.0 using createRoot for rendering
- Replaces react-copy-to-clipboard with a custom CopyToClipboard component and updates related imports
- Enhances type safety with explicit ref types and ref cleanup in several components
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/index.tsx | Replaces ReactDOM.render with createRoot and adds a conditional container check |
| src/WrapperApp/components/Simulation/SimulationCardGrid.tsx | Refactors header and footer prop usage for simulation grid components |
| src/WrapperApp/components/Results/Results3D.tsx | Updates the import to use the new CopyToClipboard component |
| src/WrapperApp/components/CopyToClipboard/CopyToClipboard.jsx | Introduces a custom, type-safe CopyToClipboard component |
| src/ThreeEditor/components/ZoneManagerPanel/ZoneManagerPanel.tsx | Improves type safety for zoneRef by explicitly allowing null values |
| src/ThreeEditor/components/Sidebar/SidebarTree/SidebarTreeItem.tsx | Implements proper ref cleanup in the SidebarTreeItem component |
| src/ThreeEditor/components/Editor/SceneEditor.tsx | Updates ref types and casts for improved type safety in SceneEditor |
| src/PythonConverter/PythonConverterService.tsx | Allows null values for workerRef to improve type safety |
| src/JsRoot/hook/useJsRootCanvas.tsx | Casts containerEl to the appropriate RefObject for use with ResizeObserver |
Files not reviewed (1)
- package.json: Language not supported
* build(deps): bump react and @types/react Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) and [@types/react](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/react). These dependencies needed to be updated together. Updates `react` from 18.3.1 to 19.0.0 - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v19.0.0/packages/react) Updates `@types/react` from 18.3.14 to 19.0.7 - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/react) --- updated-dependencies: - dependency-name: react dependency-type: direct:production update-type: version-update:semver-major - dependency-name: "@types/react" dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> * React was bumped from 18.3.1 to 19.1.0. The react-copy-to-clipboard package was removed due to incompatibility with React 19.1.0, and a custom component was added instead. * TypoFixed --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This pull request includes several updates to dependencies, refactors for improved type safety, and code modernization. Key changes include upgrading React and related libraries, replacing
react-copy-to-clipboardwith a customCopyToClipboardcomponent, and updating ReactDOM usage to align with React 18+ standards.Dependency Updates:
reactandreact-domto version19.1.0and updated@types/reactto match the new version. Removedreact-copy-to-clipboardand its type definitions, replacing it with thecopy-to-clipboardlibrary. [1] [2]copy-to-clipboardas a new dependency inpackage.json.Type Safety Improvements:
useReftypes across multiple components to explicitly allownullwhere necessary, improving type safety and preventing potential runtime errors. Examples includeworkerRefinPythonConverterService.tsx,zoneRefinZoneManagerPanel.tsx, andwrapperElementRefinSceneEditor.tsx. [1] [2] [3]SidebarTreeItemto handlerefcleanup properly by deleting entries fromobjectRefswhen therefbecomesnull.Code Modernization:
ReactDOM.renderwithcreateRootfromreact-dom/clientto align with React 18+ standards.SimulationCardGridcomponents to use functional props forheaderandfooter, simplifying their usage and improving code readability. [1] [2] [3]Component Refactoring:
CopyToClipboardcomponent to replace the removedreact-copy-to-clipboardlibrary. This component is implemented as a reusable, type-safe React class component. [1] [2]Minor Adjustments:
RefObjectto imports inSceneEditor.tsxto support updated type annotations.