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

Warn on unused data #12458

Open
Rich-Harris opened this issue Jul 10, 2024 · 1 comment
Open

Warn on unused data #12458

Rich-Harris opened this issue Jul 10, 2024 · 1 comment
Labels
feature request New feature or request

Comments

@Rich-Harris
Copy link
Member

Describe the problem

It's too easy to accidentally send more data from the server than you need. It would be nice if there was an easy way to see what's not being used.

Describe the proposed solution

An approach that would work in 95% of cases is to wrap data in a proxy that tracks which things get accessed during (server or client) render. The other 5% involves non-POJOs and data that's needed after the initial render. For this reason it probably can't be a loud obnoxious warning. I'm not exactly sure where the best place to surface this information would be.

Some years ago I wrote a library called object-cull that does a lot of the heavy lifting. It probably needs a spruce up but could be useful here.

Importance

nice to have

@Rich-Harris
Copy link
Member Author

whoops wrong repo

@Rich-Harris Rich-Harris transferred this issue from sveltejs/svelte Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant