-
Notifications
You must be signed in to change notification settings - Fork 63
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 v18, mobx-react v9 #3502
Conversation
326627e
to
15719ce
Compare
Codecov Report
@@ Coverage Diff @@
## main #3502 +/- ##
==========================================
- Coverage 64.50% 64.36% -0.15%
==========================================
Files 1004 1004
Lines 29811 29868 +57
Branches 7147 7158 +11
==========================================
- Hits 19231 19225 -6
- Misses 10415 10478 +63
Partials 165 165
... and 7 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
7f48aab
to
2e3593c
Compare
40bc531
to
0cdf343
Compare
73f94c1
to
a59b7fb
Compare
this branch updates to @mui/x-data-grid v6 now also. it has some props renamed, but is otherwise pretty similar in behavior |
I updated this this PR again, motivated by increasing amounts of flaky test failures which are mentioned in #3624 My understanding is that react 18/updated testing-library can help with this. I additionally added a method that can be used for conditionally rendering with react 18 react-dom/client::hydrateRoot, or fallback to the old way, by checking for a property called hydrateFn on the root model. this allows consumers of embedded components e.g. @jbrowse/react-linear-genome-view to add a "hydrateFn" paramter to supply the hydrateRoot function to createModel, and upgrade themselves to react 18. If this hydrateFn function exists on the root model, then it is used by the rpc functions. This way, @jbrowse/core can stay agnostic to react version, and doesn't require a major version bump/require every client consumer of the library to update to react 18 |
note that for a long time we have probably ignored a console.warn (in many current existing versions) in the LGV something to the effect of
I think this is related to Overlay rect of the selected feature. In this branch though, instead of a small console.warn, it is an error overlay. |
that error overlay would be dev mode only...and could be fixed separately. otherwise I think this PR is probably ready |
Fixup testid and add more timeout update react 18 server side rendering attempt based on https://stackoverflow.com/questions/73459382/react-18-async-way-to-unmount-root Bump lock Misc Misc Add a useMemo Updates Update snaps Misc test fixes Bump mobx-react peer dep Update snaps Misc Update snaps
might give this a merge. if it is problematic it can be partially or fully reverted, but i think it will hopefully help with intermittent test fails, and keeps us up to date with deps |
note that this also enabled |
This could be a major version bump to the jbrowse codebase, similar to how the update to jbrowse 2 was based on dependencies.
A major reason for a major bump due to this would be using hydrateRoot to hydrate the RPC rendered stuff, this would fail if a user had less than react 18 installed
We could just use react-dom "hydrate" and "render" in react 18 instead of hydrateRoot/createRoot but this spams the console with lots of warnings