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

Update to React 18 #8048

Merged
merged 28 commits into from
Sep 11, 2024
Merged

Update to React 18 #8048

merged 28 commits into from
Sep 11, 2024

Conversation

hotzenklotz
Copy link
Member

@hotzenklotz hotzenklotz commented Sep 2, 2024

Update React to v18 and bump other libs as needed.

Dependency upgrades:

react

react-router-dom

redux & react-redux

  • Upgraded react-redux from 7.1.x --> 8.0.x.
    • Changelog list v8+ as React 18 compatible
    • "Our performance benchmarks show parity with React-Redux v7.2.5 for both connect and useSelector, so we do not anticipate any meaningful performance regressions."
    • complete rewrite in Typescript
  • upgraded redux from 3.6.0 to 4.1.2
    • react-redux v8 requires requires redux 4.x
    • 4.0.0 Changelog mentions very little issues: "If you're a React user, this is going to be a lot like going from 15 to 16. Not a lot of user-facing changes, but some interesting improvements under the hood."
    • 4.1.0 Changelog mentions mostly smaller bundle sizes
    • version 4.2. starts deprecating "regular" redux in favor for redux-toolkit and in preparation for version 5.

antd

  • upgraded from 5.16.x to 5.17.4
  • 5.17.4 mentions several compatibility fixes for the depreacted React findDomNode API in Changelog

react-virtualized

  • replaced react-virtualized by react-virtualized-auto-sizer from the same author
  • the lib is a newer standalone, smaller, TS-version of <AutoSizer> component

react-sortable-hoc / dnd-kit

  • replace deprecated, incompatible react-sortable-hoc with dnd-kit

react-debounce-render

  • No update available. left unchanged.
  • Lib has not updated peer dependencies yet. Open, stale Issue for React 18 support
  • Only used mappings_settings.tsx component, so not very critical if we want to refactor

@tanstack/query

  • upgraded from 4.14.1 to 4.36.1, latest v4-version before v5

flexlayout-react

  • upgrade from 0.5.5 to 0.7.15(latest)
  • Changelog indicates that version 0.7.x brings React 18 support

react-json-tree

  • upgraded from 0.17.0 --> 0.19.0
  • while already compatible with React 18, React reported several deprecation warnings, e.g. Support for defaultProps will be removed. According to Changelog these were fixed in version 0.18 and 0.19

URL of deployed dev instance (used for testing):

Steps to test:

  • Try out dev deployment
  • Run Typecheck

TODOs:

  • Try react-redux v8.1.x
  • Try redux v4.1

Issues:


(Please delete unneeded items, merge only when none are left open)

@hotzenklotz hotzenklotz added frontend dependencies Pull requests that update a dependency file labels Sep 2, 2024
@hotzenklotz hotzenklotz self-assigned this Sep 2, 2024
@hotzenklotz
Copy link
Member Author

Screenshot 2024-09-04 at 17 26 38

There is still a React API deprecation warning for ReactDom.findDomNode which is caused by antd, more specially resize-observer & rc-component/util. The issues there have been open for quite some time now :-/
Not sure what to do.

See react-component/resize-observer#208

@hotzenklotz hotzenklotz changed the title WIP: Update to React 18 Update to React 18 Sep 5, 2024
@hotzenklotz hotzenklotz marked this pull request as ready for review September 6, 2024 10:59
Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

Looks great 👍

I only found one thing during testing:

  • the drag marker is not visible in dark mode

image

frontend/javascripts/components/pricing_enforcers.tsx Outdated Show resolved Hide resolved
@philippotto
Copy link
Member

There is still a React API deprecation warning for ReactDom.findDomNode which is caused by antd, more specially resize-observer & rc-component/util. The issues there have been open for quite some time now :-/

I think, going ahead with this PR and hoping for a fix in the future is acceptable.

@hotzenklotz
Copy link
Member Author

hotzenklotz commented Sep 10, 2024

Looks great 👍

I only found one thing during testing: the drag marker is not visible in dark mode

Great find. This is already the case on master 😶‍🌫️ I included a fix.

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

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

upgrade

@hotzenklotz hotzenklotz merged commit 6036cdc into master Sep 11, 2024
2 checks passed
@hotzenklotz hotzenklotz deleted the react-18 branch September 11, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file frontend
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update React to v18
2 participants