react-three-fiber icon indicating copy to clipboard operation
react-three-fiber copied to clipboard

RFC: v9 goals

Open krispya opened this issue 2 years ago • 11 comments

Let's discuss some v9 goals here. These are all tentative right now.

Completed

  • [x] Add stage-based lifecycle, deprecate useFrame for useUpdate 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 from Size 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 for React.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

krispya avatar Jun 22 '22 18:06 krispya

I'd also like to discuss making renderer.physicallyCorrectLights = true by default. See: https://github.com/pmndrs/react-three-fiber/issues/2127

krispya avatar Jun 24 '22 16:06 krispya

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.

CodyJasonBennett avatar Sep 03 '22 00:09 CodyJasonBennett

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.

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.

krispya avatar Sep 23 '22 20:09 krispya

What are your thoughts on updating to zustand v4?

saitonakamura avatar Oct 03 '22 14:10 saitonakamura

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.

krispya avatar Oct 04 '22 20:10 krispya

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)

saitonakamura avatar Oct 05 '22 11:10 saitonakamura

That would be great. If you start a branch, I can do review and assist.

krispya avatar Oct 05 '22 18:10 krispya

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.

CodyJasonBennett avatar Oct 10 '22 09:10 CodyJasonBennett

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.

krispya avatar Nov 28 '22 19:11 krispya

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.

aspheris avatar Jun 13 '23 15:06 aspheris

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.

krispya avatar Jun 19 '23 23:06 krispya