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

RFC: v9 goals #2338

Open
12 of 18 tasks
krispya opened this issue Jun 22, 2022 · 21 comments · May be fixed by #2331
Open
12 of 18 tasks

RFC: v9 goals #2338

krispya opened this issue Jun 22, 2022 · 21 comments · May be fixed by #2331
Labels
request for comments come & have your say

Comments

@krispya
Copy link
Member

krispya commented Jun 22, 2022

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

Completed

TODO

Pending

  • New scheduler
  • Refactor internal state
@CodyJasonBennett CodyJasonBennett added the request for comments come & have your say label Jun 23, 2022
@krispya
Copy link
Member Author

krispya commented Jun 24, 2022

I'd also like to discuss making renderer.physicallyCorrectLights = true by default. See: #2127

@CodyJasonBennett CodyJasonBennett pinned this issue Sep 3, 2022
@CodyJasonBennett
Copy link
Member

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 CodyJasonBennett linked a pull request Sep 3, 2022 that will close this issue
@CodyJasonBennett CodyJasonBennett linked a pull request Sep 3, 2022 that will close this issue
@krispya
Copy link
Member Author

krispya commented Sep 23, 2022

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.

@saitonakamura
Copy link
Contributor

What are your thoughts on updating to zustand v4?

@krispya
Copy link
Member Author

krispya commented Oct 4, 2022

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.

@saitonakamura
Copy link
Contributor

saitonakamura commented Oct 5, 2022

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)

@krispya
Copy link
Member Author

krispya commented Oct 5, 2022

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

@CodyJasonBennett
Copy link
Member

CodyJasonBennett commented Oct 10, 2022

Just did this with react-ogl in pmndrs/react-ogl#75, giving it a try here in #2558.

@krispya
Copy link
Member Author

krispya commented Nov 28, 2022

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.

@aspheris
Copy link

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.

@krispya
Copy link
Member Author

krispya commented Jun 19, 2023

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.

@chrisweb
Copy link

In the 9.0.0-beta.1 the declarations are missing, same as in #3331

Could we please get a new beta that includes the missing types declarations?

@chrisweb
Copy link

I tested a bunch of stuff using the v9 and found that a lot of examples worked well, so thank you for your hard work on preparing for the release of react 19

I found two errors likely caused by changes in the react three fiber v9 beta 1 or react 19, I created a repository with a reproduction for two cases and added some explanations to the README

I used Next.js 15 canary, because Next.js 15 comes with React 19 and because there is a Next.js Conf on Oct 24, 2023 during which they will likely announce the release of the first stable version of Next.js 15, so I assume that soon the amount of bug reports related to React 19 will surge

I have a question though, the second error related to leva seems to be related to a change in React 19 so I assume I post a ticket about it in the leva repository, but for the first error related to the effectcomposer, I'm not sure is this belongs in this repository as it is likely connected to changes in the R3F v9 or should I open a ticket in the react three postprocessing repo?

@maggo
Copy link

maggo commented Oct 21, 2024

next.js 15 has just been released an hour ago https://github.com/vercel/next.js/releases/tag/v15.0.0 and with it comes the react 19 dependency.

I've been trying to do the "happy path" upgrade via their supplied codemods but hitting a couple compile errors after updating r3f to v9 beta:

error TS2305: Module '"@react-three/fiber"' has no exported member 'Canvas'.

error TS2305: Module '"@react-three/fiber"' has no exported member 'GroupProps'.

error TS2339: Property 'group' does not exist on type 'JSX.IntrinsicElements'.

@krispya
Copy link
Member Author

krispya commented Oct 21, 2024

I tested a bunch of stuff using the v9 and found that a lot of examples worked well, so thank you for your hard work on preparing for the release of react 19

I found two errors likely caused by changes in the react three fiber v9 beta 1 or react 19, I created a repository with a reproduction for two cases and added some explanations to the README

I used Next.js 15 canary, because Next.js 15 comes with React 19 and because there is a Next.js Conf on Oct 24, 2023 during which they will likely announce the release of the first stable version of Next.js 15, so I assume that soon the amount of bug reports related to React 19 will surge

I have a question though, the second error related to leva seems to be related to a change in React 19 so I assume I post a ticket about it in the leva repository, but for the first error related to the effectcomposer, I'm not sure is this belongs in this repository as it is likely connected to changes in the R3F v9 or should I open a ticket in the react three postprocessing repo?

Thanks for doing the testing! We haven't touched v9 in a while waiting for React to get a new RC. Well that time has come. The best place to report issues is with the libraries they affect directly. Then the maintainers there can identify if the issues is their code or R3F's.

@chrisweb
Copy link

chrisweb commented Oct 22, 2024

error TS2305: Module '"@react-three/fiber"' has no exported member 'Canvas'.

@maggo this is because in the r3f beta 1 package (in /node_modules) there is a missing types directory, to fix this you need to install another version of r3f (for example 9.0.0-beta.0) in a seperate directory somewhere and then copy over the /node_modules/@react-three/fiber/dist/declarations to the r3f v9 beta 1 directory, if you need more have a look at the README of my r3f v9 tests repository, the basic page in /app has a working demo of nextjs 15 / react 19 and r3f v9, this is of course just a temporary fix, I'm sure the next release of r3f v9 will have fixed types

@iduuck
Copy link

iduuck commented Oct 30, 2024

I have fixed the issue with the typescript errors by just rolling back to alpha.8 instead of beta.1.

@CodyJasonBennett
Copy link
Member

I just released 9.0.0-rc.0 against React's 19.0.0-rc.0 with republished types and improvements from v8. React 19 is back to nightly builds for the meantime, and we'll resume releases once they go back to a scheme which leverages pinning.

@sshmaxime
Copy link

sshmaxime commented Nov 18, 2024

So we can expect 9.x.x to support React 19 ? @CodyJasonBennett
If so do you have an approximative ETA of this new version of ReactThreeFiber ?

Thanks for your work on this amazing library 🙏

@krispya
Copy link
Member Author

krispya commented Nov 19, 2024

It does support React 19 and you can find an RC right here: https://www.npmjs.com/package/@react-three/fiber/v/9.0.0-rc.1

We will keep as close to React's own release schedule as we can.

@sshmaxime
Copy link

sshmaxime commented Nov 19, 2024

Amazing, i wasn't 100% sure ! Thanks 🫡 @krispya

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request for comments come & have your say
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants