paoloricciuti / sveltekit-search-params

The easiest way to read and WRITE from query parameters in sveltekit.
https://sveltekit-search-params.netlify.app
MIT License
478 stars 13 forks source link

breaking: remove double navigation, debounce navigate after timeout #60

Closed paoloricciuti closed 8 months ago

paoloricciuti commented 8 months ago

Also feat: add showDefaults option to avoid redirecting in case the search param is not present

Summary by CodeRabbit

changeset-bot[bot] commented 8 months ago

🦋 Changeset detected

Latest commit: 9af4ffb5007f3f558c5bc876a34f37ee1a0f6014

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------------- | ----- | | sveltekit-search-params | Major |

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

coderabbitai[bot] commented 8 months ago

Walkthrough

The project introduced a showDefaults option to manage the visibility of default query parameters in URLs. It also enhanced the handling of query parameters with debouncing in the Svelte playground, refining user interactions. The sveltekit-search-params library saw updates to support these features, including new types and store functionality. Tests were expanded to cover the new features, ensuring default values are correctly handled and URL updates occur as expected.

Changes

File Path Change Summary
README.md Added showDefaults option for controlling the display of default URL values.
.../debounce/+page.svelte
.../default/+page.svelte
Introduced debouncing for query parameter changes and modified query parameter display with additional parameters.
src/lib/sveltekit-search-params.ts Added showDefaults to StoreOptions, new Overrides<T> type, and updated functions for new features.
tests/index.test.ts Updated and added tests for showDefaults behavior, URL update timing, and query parameter functionality.

🐇✨
A little rabbit hopped along,
Tweaking URLs, making them strong.
With a debounce in its step,
Defaults hide, or show with pep! 🎉

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 ?


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - You can reply to a review comment made by CodeRabbit. - You can tag CodeRabbit on specific lines of code or files in the PR by tagging `@coderabbitai` in a comment. - You can tag `@coderabbitai` in a PR comment and ask one-off questions about the PR and the codebase. Use quoted replies to pass the context for follow-up questions. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Additionally, you can add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`
netlify[bot] commented 8 months ago

Deploy Preview for sveltekit-search-params ready!

Name Link
Latest commit 9af4ffb5007f3f558c5bc876a34f37ee1a0f6014
Latest deploy log https://app.netlify.com/sites/sveltekit-search-params/deploys/6581518cca656500087446a1
Deploy Preview https://deploy-preview-60--sveltekit-search-params.netlify.app/
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.