-
Notifications
You must be signed in to change notification settings - Fork 1.4k
fix: execute cleanup cb for all component tree while calling dispose.cleanup method returned by render fn #8164
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
Conversation
🦋 Changeset detectedLatest commit: 36d4b7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…render-fn-cleanup
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
wmertens
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
@sashkashishka very nice! Can you check if this problem also exists in v2? |
| @@ -0,0 +1,9 @@ | |||
| --- | |||
| 'eslint-plugin-qwik': patch | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your help @sashkashishka
Some packages are not affected by this change though. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only eslint? looks like these one are using qwik as dependency. I'll open a new PR with fix
'create-qwik': patch
'@builder.io/qwik-react': patch
'@builder.io/qwik-city': patch
'@builder.io/qwik': patch
sure, but at the end of the week |

What is it?
Description
We have a use case when we render a qwik container client side only (while SPA navigation). We faced with the problem, when leaving the page and calling dispose function, previously rendered components don't call cleanup function in useTasks at all. After some investigation we found that it only affects child components rendered in a Slot. So everything above the slot calls cleanup, but below it doesn't.
Here is an example:
So when we dispose the component, it will only call 1 and 2 cleanup function, but not 3.
But actually, it should call all three cleanups.
Checklist
pnpm changeBesided, on my local machine I faced with the failing e2e tests (it turned out that my laptop is too fast and test assertions was conducted before the js manages to render the content). Please, check out if the provided fixes works for you. if not, I'll revert them. Also, found some bugs with rerender test cases and fixed them (there were assertions to check whether the counter was incremented, but it hasn't managed to do that and the assertion looked like
expect(0).toBe(0)instead of checking whether the increment has workedexpect(1).toBe(1). you can find it here