-
Notifications
You must be signed in to change notification settings - Fork 124
Add warning for preload on on-demand collections #871
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
Add warning for preload on on-demand collections #871
Conversation
Calling .preload() on a collection with syncMode "on-demand" is a no-op since data is only loaded when queries request it. This change adds a warning to help users understand this behavior and suggests creating a live query instead. The warning includes a link to the Query-Driven Sync blog post for additional context and guidance.
🦋 Changeset detectedLatest commit: b679eda The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 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 |
|
"no-op" might be a bit strong — but generally speaking it's correct as .preload() isn't going to get their data loaded |
More templates
@tanstack/angular-db
@tanstack/db
@tanstack/db-ivm
@tanstack/electric-db-collection
@tanstack/offline-transactions
@tanstack/powersync-db-collection
@tanstack/query-db-collection
@tanstack/react-db
@tanstack/rxdb-db-collection
@tanstack/solid-db
@tanstack/svelte-db
@tanstack/trailbase-db-collection
@tanstack/vue-db
commit: |
|
Size Change: +174 B (+0.2%) Total Size: 85.9 kB
ℹ️ View Unchanged
|
|
Size Change: 0 B Total Size: 3.34 kB ℹ️ View Unchanged
|
samwillis
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.
Great addition!
Calling .preload() on a collection with syncMode "on-demand" is a no-op since data is only loaded when queries request it. This change adds a warning to help users understand this behavior and suggests creating a live query instead.
The warning includes a link to the Query-Driven Sync blog post for additional context and guidance.
🎯 Changes
✅ Checklist
pnpm test:pr.🚀 Release Impact