react-three-fiber
react-three-fiber copied to clipboard
RFC: v9 goals
Let's discuss some v9 goals here. These are all tentative right now.
Completed
- [x] Add stage-based lifecycle, deprecate
useFrame
foruseUpdate
https://github.com/pmndrs/react-three-fiber/pull/2279 - [x] Remove
onUpdate
prop https://github.com/pmndrs/react-three-fiber/pull/2480 - [x] Remove
updateStyle
fromSize
https://github.com/pmndrs/react-three-fiber/pull/2489 - [x]
act
types for testing https://github.com/pmndrs/react-three-fiber/pull/2492 - [x] Instance descriptors, refactor JSX types & extend https://github.com/pmndrs/react-three-fiber/pull/2465
- [x] prefer named functions, for loops in hot paths https://github.com/pmndrs/react-three-fiber/pull/2540 (backported in
v8.8.7
) - [x] upgrade Zustand to v4 #2558
- [x] export all public types #2559, #2583
- [x] respect
React.StrictMode
across renderers #2547 - [x] anonymous
extend
overload for libraries #2785 - [x] https://github.com/pmndrs/react-three-fiber/issues/2250
TODO
- [ ] New caching model, update
useLoader
forReact.use
: https://github.com/pmndrs/react-three-fiber/pull/3245 - [ ] https://github.com/pmndrs/react-three-fiber/issues/3204
- [ ] https://github.com/pmndrs/react-three-fiber/issues/2725
- [x] https://github.com/pmndrs/react-three-fiber/issues/3222
- [ ] https://github.com/pmndrs/react-three-fiber/issues/2299
Pending
- [ ] New scheduler
- [ ] Refactor internal state
I'd also like to discuss making renderer.physicallyCorrectLights = true
by default. See: https://github.com/pmndrs/react-three-fiber/issues/2127
I don't think we can change defaults for lighting OOTB, problems are detailed in the linked issue. That might be a consideration for #2299 but the issue of decay
not respecting physicallyCorrectLights
remains. I think this is something to be considered in threejs itself.
I don't think we can change defaults for lighting OOTB, problems are detailed in the linked issue. That might be a consideration for #2299 but the issue of
decay
not respectingphysicallyCorrectLights
remains. I think this is something to be considered in threejs itself.
Agreed.
After a conversation with Paul, I'm making sure a pass on the frameloop modes is also on the to-do list. In particular demand
needs to be updated so that it skips the render loop but still tracks delta so starting and stopping render doesn't destroy delta based animations.
What are your thoughts on updating to zustand v4?
I'm in favor, the typing is hugely improved and so is compatibility with context. But it isn't a trivial update. Is it something you would be interested in spearheading? I can contribute.
Yeah, I think so. When upgrading to r3f v8 I erroneously update zustand to v4. I had to revert back of course but not until I had some fair share of migration experience (we use it too)
That would be great. If you start a branch, I can do review and assist.
Just did this with react-ogl
in https://github.com/pmndrs/react-ogl/pull/75, giving it a try here in https://github.com/pmndrs/react-three-fiber/pull/2558.
Thanks so much for all your hard work Cody. I wanted to add here some type exports for the different r3f props which were previously exported as Vector3
, Color
, etc.
Hello! Whats the status of V9? I'm looking to use the lifecycle stages in useUpdate
but it looks like its not officially ready yet.
Hello! Whats the status of V9? I'm looking to use the lifecycle stages in
useUpdate
but it looks like its not officially ready yet.
Hey! So we have been working on projects in parallel to this one and trying out some of the v9 updates internally as we go along. For example, I am exploring alternatives to useUpdate
that are more robust for video game style apps right now. It may be a little bit longer before there is a stable version available.