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

fix: store effects cleanup & projection siblings serialization #7228

Merged
merged 3 commits into from
Jan 8, 2025

Conversation

Varixo
Copy link
Member

@Varixo Varixo commented Jan 6, 2025

  • Cleanup store effects on VNode destory etc.
  • Serialize all projection siblings. Previously we only added the SERIALIZE flag, which is a bug, because we did not serialize component props that were siblings of the projection
  • Run resource functions within invoke context

@Varixo Varixo self-assigned this Jan 6, 2025
@Varixo Varixo requested a review from a team as a code owner January 6, 2025 12:37
Copy link

changeset-bot bot commented Jan 6, 2025

🦋 Changeset detected

Latest commit: 19584fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@qwik.dev/core Patch
eslint-plugin-qwik Patch
@qwik.dev/react Patch
@qwik.dev/router Patch
create-qwik Patch

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

@Varixo Varixo force-pushed the v2-store-effects-cleanup branch from 3a95d94 to dae54f6 Compare January 6, 2025 12:44
@Varixo Varixo marked this pull request as draft January 6, 2025 13:00
@Varixo Varixo force-pushed the v2-store-effects-cleanup branch from dae54f6 to 0403889 Compare January 6, 2025 13:08
@Varixo Varixo force-pushed the v2-store-effects-cleanup branch from a599e06 to a6492f8 Compare January 7, 2025 15:25
@Varixo Varixo marked this pull request as ready for review January 7, 2025 15:36
Copy link

pkg-pr-new bot commented Jan 7, 2025

Open in Stackblitz

npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/core@7228
npm i https://pkg.pr.new/QwikDev/qwik/@qwik.dev/router@7228
npm i https://pkg.pr.new/QwikDev/qwik/eslint-plugin-qwik@7228
npm i https://pkg.pr.new/QwikDev/qwik/create-qwik@7228

commit: 19584fb

Copy link
Contributor

github-actions bot commented Jan 7, 2025

built with Refined Cloudflare Pages Action

⚡ Cloudflare Pages Deployment

Name Status Preview Last Commit
qwik-docs ✅ Ready (View Log) Visit Preview 19584fb

Copy link
Member

@wmertens wmertens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but see comments

packages/qwik/src/core/shared/shared-serialization.ts Outdated Show resolved Hide resolved
clearEffects(subscriber, value, value.$effectDependencies$, i, container);
}

if (value.$effectDependencies$.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it isn't better to take out the whole effects array, replace with null or an empty array (removes a bunch of guards), and process all the effects without splicing.

That way the new effects will register in a separate array and we don't need to do array manipulation the whole time.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we can't just remove all effects. I don't understand how we can do that without modifying the array

@Varixo Varixo force-pushed the v2-store-effects-cleanup branch from a6492f8 to 19584fb Compare January 8, 2025 15:37
@Varixo Varixo merged commit d6c274e into build/v2 Jan 8, 2025
19 checks passed
@Varixo Varixo deleted the v2-store-effects-cleanup branch January 8, 2025 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants