You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(examples/solid/{basic,offline}): pass accessors instead of values to query hooks - #11955
createPost in examples/solid/basic and useMovie in examples/solid/offline take the post or movie ID as a plain value, and their components call them with props.postId and props.movieId. Reading a prop outside a tracked scope reads it only once, so the queries wouldn't follow a changed ID. It works today only because the components are re-mounted when the ID changes.
Make createPost take an Accessor<number> and useMovie take an Accessor<string>, and read the ID inside the query options.
Call them with () => props.postId and () => props.movieId.
I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.
🚀 Release Impact
This change affects published code, and I have generated a changeset.
This change is docs/CI/dev-only (no release).
Summary by CodeRabbit
Bug Fixes
Updated the Solid examples to use the current post or movie ID when fetching and updating data, keeping displayed details in sync when the selected ID changes.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Reviewing files that changed from the base of the PR and between 22621e7 and 24480da.
📒 Files selected for processing (3)
examples/solid/basic/src/index.tsx
examples/solid/offline/src/App.tsx
examples/solid/offline/src/movies.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
📝 Walkthrough
Walkthrough
The Solid examples now pass post and movie IDs as accessors. Query and mutation operations read the current ID value when building keys, fetching data, and updating movie cache state.
Changes
Solid reactive IDs
Layer / File(s)
Summary
Reactive post query examples/solid/basic/src/index.tsx
createPost accepts an ID accessor and reads its value for the query key and fetch call. Post passes an accessor for props.postId. The truthy-ID enabled condition is unchanged.
Reactive offline movie queries and mutations examples/solid/offline/src/movies.ts, examples/solid/offline/src/App.tsx
useMovie accepts an ID accessor and reads its value for query and mutation keys, fetching, cache operations, rollback, and invalidation. Detail passes props.movieId through a function.
The reactive ID changes have no identified issue requiring a fix before merge.
Pre-merge checks | 4 | 1
❌ Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name
Status
Explanation
Description check
The description explains the motivation, implementation, testing status, checklist items, and release impact. It follows the repository template and matches the changes.
Title check
The title clearly and concisely describes the main change: passing accessors instead of values to the Solid query hooks in the basic and offline examples.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
createPostinexamples/solid/basicanduseMovieinexamples/solid/offlinetake the post or movie ID as a plain value, and their components call them withprops.postIdandprops.movieId. Reading a prop outside a tracked scope reads it only once, so the queries wouldn't follow a changed ID. It works today only because the components are re-mounted when the ID changes.createPosttake anAccessor<number>anduseMovietake anAccessor<string>, and read the ID inside the query options.() => props.postIdand() => props.movieId.Both examples type-check and build.
✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit