-
Notifications
You must be signed in to change notification settings - Fork 23
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
Upgrade React to v18 and R3F to v8 #1119
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
3105d9f
to
ebf8547
Compare
8de544e
to
68618cc
Compare
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
389741d
to
c24f283
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
8e75c19
to
1e40fd4
Compare
1e40fd4
to
10352c7
Compare
Attn @PeterC-DLS: I've just rebased this branch on v7. From now on, I'll try to rebase it only after stable releases. I'm just doing a basic sanity check locally with |
db66ef4
to
2204322
Compare
e63636e
to
dc7c275
Compare
I've rebased and fixed a few things, but I had to skip a couple of tests for the CI to pass. I'll see if upgrading Testing Library helps and investigate a bit more. The plan is to merge this and release a new major asap. |
/approve |
c895b68
to
157f7da
Compare
157f7da
to
f26cd79
Compare
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 all right to me.
Congrats for soldiering on through the timer issues. It should not have been easy.
f26cd79
to
cd4e6c5
Compare
The big change with React 18, obviously, is the
createRoot
API that replacesReactDOM.render
. In terms of code, this affects the demo but most importantly theHtml
component (I think the new API makes the code clearer, actually). In terms of performance, this means we can now opt-in to concurrent rendering features (see below). That being said, there should already be some performance improvements under the hood, especially since R3F already makes use of such features internally.In R3F v8, the breaking change that affects our codebase is the
sourceEvent
key in event objects being renamed tonativeEvent
.Obviously there's a lot more to these major releases that we can benefit from or should watch out for (I will put this list in a discussion thread once merged):
useTransition
to improve the way we useSuspense
(e.g. by not hiding the current slice while the next one is loading)useDeferredValue
to improve performance on a case-by-case basis by deferring heavy, low-priority state updateswe're currently blocked at v0.135 due to a breaking changeUpdate three.js to r141 #1170), thanks to a change in Three 0,139, we no longer have to set thelinear
prop on R3F'sCanvas
. I think we end up with fewer conversions of colours under the hood.attach
API for declaring buffer attributessuspend-react
, a lower-level library forSuspense
thanreact-suspense-fetch
; it's developed by the R3F team and used internally in R3F itself