-
Notifications
You must be signed in to change notification settings - Fork 39
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
fix: flush pending hooks effects in rerender #32
Conversation
Call preact/test-utils act which manages the same setupRerender behavior implemented previously in preact-testing-library, but also flushes any pending hook effects
I'm experiencing this issue as well, and likewise this fix seems to work well for me. Thanks @aduth! Maintainers: any update on this? |
Is there any update on this? I am running in to this issue as well. |
@nickmccurdy Hello, I just wanted to ask if this pr is planned to be merged / released any time soon? |
we're running into this issue as well - is there any additional verification we can do to help push this through? |
There are no active maintainers on this project. If anyone's willing to step up as an official committed maintainer and can present some trustworthy credentials (good OSS behavior in the past) then I'd be willing to give maintainer rights. Until then, I'm afraid there's just no bandwidth for maintaining this project. |
Hey @kentcdodds I don't mind taking over some of the maintenance on this project if you don't mind |
Thanks @JoviDeCroock! I'll get you added to the team right away. |
@kentcdodds is there something wrong or does the CI need explicit approval in travis? We could bypass this by enabling #44 but that would require access to protected branches as the travis check is mandated |
Eek, I didn't realize this was on Travis. I'm afraid I don't think I have access to the travis stuff for this project. It may be that we first need to update the CI pipeline... I'm going to remove the required TravisCI check for now. |
I should add @JoviDeCroock that you don't need my permission or anything for this project at all. If you want to change the setup or whatever that's totally up to you. Like I said, I don't have the bandwidth to work on this project at the moment so feel free to take complete ownership over it. I appreciate you giving it some of your time and attention! |
@kentcdodds sorry to bother you but one last request could someone do a manual request of the git tag for 3.0.0 as we dropped node 10 support, however the semantic release was bugged. Fixed that in #54 |
Happy to help. I don't understand what you're asking me to do though. Could you elaborate? |
This run created a tag on github but the publish failed https://github.com/testing-library/preact-testing-library/runs/6494824522?check_suite_focus=true - the fix however happens in a later commit so I can't just rerun it. This is a manual publish I assume |
Dang it. I always hate when semantic-release falls off the rails. I never know how to get it back going again. I'll look into it. |
Based on the error message from the latest build, it's not a manual publish we need:
|
I fixed that error in #54 |
Ok, so you're saying that if I do a manual publish of the package this should fix itself? Do you know what version I need to publish? (Sorry, I just don't have too much time to look into it). |
First and foremost sorry for the spam on your PR 😅 this tag should be ready to publish so going to that tag and running the build and then publish with the version set to 3.0.0 |
Actually, you should have publish rights anyway, so I added you to the npm org 👍 |
Let's goooo!!! |
🎉 This PR is included in version 3.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Glad to see this shipped! Thank you @kentcdodds and @JoviDeCroock for helping to keep this project maintained 🙂 |
What:
Call preact/test-utils act which manages the same setupRerender behavior implemented previously in preact-testing-library, but also flushes any pending hook effects.
Why:
I had encountered an issue in one of my own projects using
@testing-library/preact-hooks
where calling hook'ssetState
would not trigger a render, in a case where the state setter may be called asynchronously.How:
This follows and defers to the internal implementation of
preact/test-utils
'sact
function, which also callssetupRerender
's resulting rerender function, but only after handling flushing behavior. The changes here effectively incorporate that behavior.See also: preactjs/preact#1437
Checklist: