feat(store): add url query persist#70
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughChangesThe store package adds Query persistence
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant Browser
participant persistQuery
participant Store
participant Router
Browser->>persistQuery: Provide URL search parameters
persistQuery->>Store: Deserialize and hydrate state
Store->>persistQuery: Emit persisted state changes
persistQuery->>Router: Navigate with updated parameters
Router->>persistQuery: Deliver navigation updates
persistQuery->>Store: Apply URL changes without echo navigation
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/store/src/query.ts`:
- Around line 238-240: Update applyFromUrl around the differs check to cancel
any pending debounced write before applying the external URL state: clear timer
and discard the pending state, then proceed with applying = true. Preserve the
early return when the URL state does not differ.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: e4851a24-ef88-4d65-84cf-fc5f737439f1
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (13)
apps/website/package.jsonapps/website/src/pages/(content)/guide/libraries/store.mdxpackages/store/README.mdpackages/store/happydom.tspackages/store/package.jsonpackages/store/src/query.test.tspackages/store/src/query.tspackages/store/tsconfig.jsonpackages/store/tsdown.config.tstemplates/elysia/package.jsontemplates/hono/package.jsontemplates/nitro/package.jsontemplates/vite/package.json
Summary by CodeRabbit
New Features
persistQuery, including initialization from URL params and bidirectional sync with navigation (back/forward, link navigation).Documentation
persistQueryusage and option details.Tests
Chores
./queryexport.