Skip to content
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

Yuhsuan/react 18 upgrade #2426

Open
wants to merge 14 commits into
base: dev
Choose a base branch
from
Open

Yuhsuan/react 18 upgrade #2426

wants to merge 14 commits into from

Conversation

YuHsuan-Hwang
Copy link
Collaborator

@YuHsuan-Hwang YuHsuan-Hwang commented Oct 25, 2024

Description

Patches golden-layout and upgrades to react 18.

Also

  • migrates the dialog workaround to react 18
  • migrates blueprint toaster to react 18 (ref)
  • upgrades react type definition
  • removes react-color type def (somehow does not work with react 18 type def)
  • patches react-split-pane type def (ref)
  • upgrades react-konva for react 18 compatibility
  • adds optional children to react component props type (ref)
  • fixes key related warnings
  • upgrades konva and react testing library, which were blocked by react 18 upgrade

Note that there is a warning from react-resize-detector. Investigated if it can be fixed by upgrading the package to v11, but found that the child function pattern <ReactResizeDetector/> is removed from v10. Only the useResizeDetector hook is supported, which can only applied with functional components. This can be solved by creating a wrapper component, but requires additional changes because it adds an extra div element which breaks the current structure. I suggest we work on the upgrade in a separate PR (perhaps the next dev cycle) and focus on golden-layout patching and react 18 upgrade in this branch.

Update: we could consider replacing react-resize-detector with blueprint <ResizeSensor/> + throttling.

Let's close #1974 after this PR is merged.

Checklist

For linked issues (if there are):

  • assignee and label added
  • GitHub Project estimate added

For the pull request:

  • reviewers and assignee added
  • GitHub Project estimate added
  • changelog updated / no changelog update needed
  • unit test added (for functions with no dependenies)
  • API documentation added (for public variables and methods in stores)

For dependencies:

  • e2e test passing / corresponding fix added / new e2e test created
  • protobuf version bumped / no protobuf version bumped needed
  • protobuf updated to the latest dev commit / no protobuf update needed
  • corresponding ICD test fix added (BackendService changed) / no ICD test fix needed (BackendService unchanged)
  • user manual prepared (for large new features)

@YuHsuan-Hwang
Copy link
Collaborator Author

YuHsuan-Hwang commented Nov 4, 2024

Updates:

  • Upgraded konva and react testing library, which were blocked by react 18 upgrade.
  • Investigated if the warning from react-resize-detector can be fixed by upgrading the package to v11, but found that the child function pattern <ReactResizeDetector/> is removed from v10. Only the useResizeDetector hook is supported, which can only applied with functional components. This can be solved by creating a wrapper component, but requires additional changes because it adds an extra div element which breaks the current structure. I suggest we work on the upgrade in a separate PR (perhaps the next dev cycle) and focus on golden-layout patching and react 18 upgrade in this branch.

Update: we could consider replacing react-resize-detector with blueprint <ResizeSensor/> + throttling.

@YuHsuan-Hwang YuHsuan-Hwang marked this pull request as ready for review November 4, 2024 07:21
@YuHsuan-Hwang YuHsuan-Hwang added awaiting code review For pull requests that require code review awaiting testing For pull requests that require testing labels Nov 4, 2024
@veggiesaurus
Copy link
Collaborator

nice work @YuHsuan-Hwang 😎 🚀

@YuHsuan-Hwang
Copy link
Collaborator Author

Note: Let's close #1974 after this PR is merged.

Copy link
Collaborator

@loveluthien loveluthien left a comment

Choose a reason for hiding this comment

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

It looks good on Mac and Ubuntu.

@YuHsuan-Hwang
Copy link
Collaborator Author

Filed #2433 for the react-resize-detector warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting code review For pull requests that require code review awaiting testing For pull requests that require testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package updates for v4
3 participants