Closed paoloricciuti closed 8 months ago
Latest commit: eb5fa7ba9a72e97439a19f85ce7176d07c78b1f1
The changes in this PR will be included in the next version bump.
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
The changes address the implementation of query parameters handling within a Svelte component, particularly focusing on default values and their application during client-side navigation. The updates involve importing new utilities from a library, initializing variables with default values, and reflecting these values in the DOM. Additionally, the underlying library code has been refactored to change how default values are managed, and tests have been added to ensure the correct behavior of these defaults during server-side rendering and client-side navigation.
File Path | Change Summary |
---|---|
.../src/routes/default/+page.svelte |
Added handling of query parameters with default values and updated DOM to display them. |
src/lib/sveltekit-search-params.ts |
Refactored logic for handling default values, removed defaultedParams . |
tests/index.test.ts |
Added tests for default value behavior during SSR and client-side navigation. |
Objective | Addressed | Explanation |
---|---|---|
#41: Default value not applied in a second client-side navigation | ✅ | The changes in the Svelte component and the library code suggest that the handling of default values has been revised to ensure they are applied consistently during client-side navigation. |
In the code where queries abound,
A rabbit hopped and defaults found.
With each click and page anew,
Defaults apply, as they rightly do. 🐇💻✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on X ?
Name | Link |
---|---|
Latest commit | eb5fa7ba9a72e97439a19f85ce7176d07c78b1f1 |
Latest deploy log | https://app.netlify.com/sites/sveltekit-search-params/deploys/657ec24e9d06920008b0e452 |
Deploy Preview | https://deploy-preview-58--sveltekit-search-params.netlify.app/ |
Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site configuration.
This should close #41 and #49
I changed a bit how defaults works...there's still a navigation happenning if possible but the default value is still set as the value of the store. This helps with SSR and i removed the weird set of defaulted params which i guess is what was causing #41
Summary by CodeRabbit
New Features
Bug Fixes
Tests