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

Use React version 18.2 #2254

Open
klar-C opened this issue Sep 30, 2022 · 7 comments
Open

Use React version 18.2 #2254

klar-C opened this issue Sep 30, 2022 · 7 comments
Assignees
Labels
dash-3.0 Going in dash-3.0 release. feature something new P3 not needed for current cycle

Comments

@klar-C
Copy link

klar-C commented Sep 30, 2022

Hi,

I posted this initially on the plotly forums but I imagine this might be a better place for it.

Is there any way to force Dash to use a newer version of React? Or is there any time-line as to update Dash to run with 18.2?

The main reason I’m asking is that e.g. Aggrid (and some other libraries) seem to have worse render performance for large tables under 16.4 versus 18.2.

As a test I created a component (through cookiecutter) and updated the react version.

When running it through the react testing server (using 18.2) I can scroll very smoothly.
When running it through the react testing server (using 16.4) then scrolling is clearly lagging. I can see the cells being drawn.
When running it through Dash as a component (Dash forces 16.4) then scrolling is again lagging.

I understand that this is a non-Dash library specific problem, however I can imagine that updating to a more recent React version (or indicating how it could be hacked) is something that has come up?

@alexcjohnson
Copy link
Collaborator

alexcjohnson commented Oct 6, 2022

Thanks @klar-C - here's the process I outlined in your original community post:

  • Add v18 as an experimental option, likely dash._dash_renderer._set_react_version("18.2.0")
  • See if anything breaks in the Dash core, and fix it. Add a flavor of all the dash/dcc/table tests using v18
  • Alert maintainers of 3rd-party component packages to the v18 option and encourage them to try it and make any necessary adjustments
  • Do the same with all the other (non-core) Plotly-maintained component packages
  • Once we have sufficient confidence the component ecosystem can handle it, we’ll make v18 the default, but keep v16 around for a while as a backup for anyone who still needs a component (or version of a component) that can’t use v18

I've opened #2260 to address the first two pieces. If that goes well, once we've merged and released it we can move on to testing with other components

@MrTeale
Copy link
Contributor

MrTeale commented Oct 10, 2022

@alexcjohnson - I'd love to get involved in moving Dash across to React 18 if there's anything left to do.

I noticed a few failing tests in the CircleCI but can't replicate these issues on my local machine. Are these just flakey tests on CircleCI or an actual issue?

@alexcjohnson
Copy link
Collaborator

Did you run the tests with the REACT_VERSION=“18.2.0” environment variable? I haven’t managed to dig in fully, but the first couple of the failing tests I tried do fail for me locally as well, so I don’t think it’s just CI flakiness. Seemed like some details of how React sequences things must have changed and we need to be more careful. If you do manage to reproduce the failures I’d welcome any help you can give to sort them out!

@PSoltes
Copy link

PSoltes commented Feb 28, 2024

is there any ETA on this React 18 move? Most react libs moved to it now and Dash not using it blocks using our own components created in React.

@Coding-with-Adam
Copy link

Hi @PSoltes
Thanks for following up.
We're considering setting React 18 in Dash 2.17. But we're reaching out to the community to see if they expect any issues.

Any issues you might expect with this move?

@ndrezn
Copy link
Member

ndrezn commented Apr 29, 2024

Hey folks, we're looking to implement this upgrade once we close #2517, which is currently WIP. You can expect React 18.2 to become the default for Dash with the upcoming 2.17 or 2.18 release. cc @emilykl

@gvwilson gvwilson added P3 not needed for current cycle feature something new labels Aug 13, 2024
@T4rk1n T4rk1n added the dash-3.0 Going in dash-3.0 release. label Sep 4, 2024
@T4rk1n
Copy link
Contributor

T4rk1n commented Sep 4, 2024

Switching to default react 18 will be part of the dash 3.0 release once #2919 is resolved.

@T4rk1n T4rk1n assigned T4rk1n and unassigned emilykl Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dash-3.0 Going in dash-3.0 release. feature something new P3 not needed for current cycle
Projects
None yet
Development

No branches or pull requests

9 participants