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

[🐞] Qwik serializes the entire object even when capturing only a specific object property. #6920

Open
jacrabb opened this issue Sep 27, 2024 · 0 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@jacrabb
Copy link

jacrabb commented Sep 27, 2024

Which component is affected?

Qwik Runtime

Describe the bug

Qwik serializes the entire object even when capturing only a specific object property.

As described in https://qwik.dev/tutorial/understanding/capturing/, Qwik should narrowly serialize a listener's data based on the scope of what that listener closes over. For instance, an onClick$ event closing over a single property of a useStore should not serialize the entire useStore.

You can observe this behavior in v2 as well:
https://qwikdev-build-v2.qwik-8nx.pages.dev/tutorial/understanding/capturing/

Reproduction

https://stackblitz.com/edit/github-s6wkde?file=src%2Fcomponents%2Fstarter%2Fcounter%2Fcounter.tsx

Steps to reproduce

Load stackblitz link, run npm run dev OR npm run preview, and inspect the source of the preview window.
You will find 'PRETEND THIS IS A LARGE DATASET' serialized to the client.

System Info

stackblitz

Additional Information

This was discussed briefly in Discord:
https://discord.com/channels/842438759945601056/1275604997500960778

@jacrabb jacrabb added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Sep 27, 2024
@jacrabb jacrabb changed the title [🐞] [🐞] Qwik serializes the entire object even when capturing only a specific object property. Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant