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

[v9] fix: remove useUpdate #3262

Merged
merged 5 commits into from May 22, 2024
Merged

[v9] fix: remove useUpdate #3262

merged 5 commits into from May 22, 2024

Conversation

krispya
Copy link
Member

@krispya krispya commented May 10, 2024

Removes the deprecated API for useUpdate. Only issue I saw is that rafz gives a warning when Drei is imported. I am unfamiliar with rafz, an internal library of react-spring, so I couldn't debug it further. It has something to do with global effects, which we intend to deprecate anyways.

Copy link

codesandbox-ci bot commented May 10, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit c49e02a:

Sandbox Source
example Configuration

packages/fiber/src/core/loop.ts Outdated Show resolved Hide resolved
packages/fiber/src/core/store.ts Outdated Show resolved Hide resolved
packages/fiber/src/core/store.ts Outdated Show resolved Hide resolved
@joshuaellis
Copy link
Member

At the moment r3f drives react spring when used In the context of three because there are instances where you might run frameloop = demand, and the springs would still run. We use a global effect to do this, but to be honest it causes issues between mixing web & three springs.

So I could just remove that and if you run your three app in demand mode, you should run your springs also in demand mode and manage that all yourself, it's relatively easy... would solve a long standing bug...

krispya and others added 3 commits May 11, 2024 10:21
Co-authored-by: Cody Bennett <hi@codyb.co>
Co-authored-by: Cody Bennett <hi@codyb.co>
Co-authored-by: Cody Bennett <hi@codyb.co>
@krispya
Copy link
Member Author

krispya commented May 11, 2024

At the moment r3f drives react spring when used In the context of three because there are instances where you might run frameloop = demand, and the springs would still run. We use a global effect to do this, but to be honest it causes issues between mixing web & three springs.

So I could just remove that and if you run your three app in demand mode, you should run your springs also in demand mode and manage that all yourself, it's relatively easy... would solve a long standing bug...

In v10 we will be replacing the loop with a proper scheduler that will have all the flexibility for controlling third party systems. I think it will solve the problem react-spring is having. In the meantime, v9 isn't making any API changes even though we made updates to the internals, so I wanted to make sure the loop works as expected.

On the Animation example I am getting this error loop.ts:40 Cannot call the manual advancement of rafz whilst frameLoop is not set as demand even though the frameloop is set to always. This looks unexpected, but I'm not sure why it is happening.

But note react-spring isn't working with React 19 in v9 right now.

@CodyJasonBennett
Copy link
Member

Maybe due to #3228 instead.

@krispya
Copy link
Member Author

krispya commented May 11, 2024

Maybe due to #3228 instead.

I'm thinking we can merge this PR and put the issue aside until react-spring gets an update.

@krispya krispya merged commit 9ba7697 into v9 May 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants