-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
fix: spring does not start #2372
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
base: next
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
Do we have a reproduction of this in a sandbox? if i look at the examples in the docs, they all appear to work 🤔 |
@joshuaellis yes,
|
I'll take a look at this properly in a few hours. That line in particular was taken from the stale PR we had for React 19 before mine. I assumed it was fixing a cleanup of the ref. Would be good to test properly without it. Whatever the cause of this bug is - Seeing as the CI tests passed, we should try and enhance the coverage to try and replicate this via CI. If you were able to recreate the bug consistently is there a particular case where it fails? As Josh mentioned, the local tests and the deployed docs worked! Odd! Thoughts? |
I've just had a proper look through - I think we can remove this safely - I don't think the cleanup is necessary as the next runthrough of updates will overwrite any previously parsed updates. So in terms of the logic for removing it, all good on my end. One thing I would like to suggest though is to catch the crashing behaviour in a test (like i mentioned before). I guess this is dependant on what causes the crashing, i.e what error it is. What are you guys' thoughts on that? Worth doing? |
@kierancap agree to add a test on this, but I would first document the internal a bit. It is not easy to grasp for everyone. So, what this business code actually do? PS: the current website is not up to date so it run with the v9 |
Yeah agreed about documenting the internals. Based on my understanding the ref is just handling queuing updates. I think the cleanup line may have come from the thought of needing the clean up an update post process, but based on my glance yesterday it seems like thats unnecessary (I'm also guessing that the ref is used asynchronously in other parts too - hence the crashing) As to the actual design of the code, I'm not totally sure - It's not well documented so I've just tried to peace together what I can based on the code itself. The last updates to that system pre our PR was 5-6 years ago, so I doubt we can get any assistance on that either. If @joshuaellis has any understanding about the spring update system, would be great to enlighten myself and we can write some docs outlining it internally |
Why
This PR fixes a bug where useSpring lead to unmount component (eg. blank page)
Related: #2371
What
The root cause was an instruction which removes the current update during the useIsomorphicLayoutEffect callback.
@kierancap I would like your opinion on this if you have a minute. I don't know exactly the impact of this.
Checklist