-
Notifications
You must be signed in to change notification settings - Fork 17
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
fix(deps): update dependency use-query-params to v2 #915
Open
renovate
wants to merge
1
commit into
main
Choose a base branch
from
renovate/use-query-params-2.x
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
Projektor reports
|
7b4c265
to
0c0515a
Compare
0c0515a
to
5e4d012
Compare
5e4d012
to
47a28ec
Compare
47a28ec
to
a55a681
Compare
a55a681
to
c8c2615
Compare
c8c2615
to
a2cf6d3
Compare
a2cf6d3
to
101151e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
None yet
0 participants
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.
This PR contains the following updates:
1.2.3
->2.2.1
Release Notes
pbeshai/use-query-params (use-query-params)
v2.2.1
: v2.2.1Compare Source
use-query-params v2.2.1 (March 24, 2023)
v2.2.0
: v2.2.0Compare Source
v2.1.2
Compare Source
v2.1.1
: v2.1.1Compare Source
v2.1.0
: v2.1.0Compare Source
use-query-params v2.1.0 (August 31, 2022)
skipUpdateWhenNoChange
defaults to true (set to false for previous behavior)v2.0.1
: v2.0.1Compare Source
use-query-params v2.0.1 (August 31, 2022)
v2.0.0
: v2.0.0Compare Source
use-query-params v2.0.0
Breaking
null
. You can continue using query-string by specifying thesearchStringToObject
andobjectToSearchString
options as parse and stringify respectively.New Features
Deep imports for React-Router 5 and 6 adapters
Supports registering params in the QueryParamProvider to have them available to any downstream hooks.
Additional function signatures have been added, but greater care must be taken to get proper types out of the response.
useQueryParam(’myparam’)
← param type is inherited from the params registered in the QueryParamProvideruseQueryParam(’myparam’, StringParam, options)
useQueryParams()
← gets all params from the QueryParamProvideruseQueryParams([’myparam1’, ‘myparam2’])
← gets just myparam1 and myparam2 from those registered in the QueryParamProvider.useQueryParams({ myparam: StringParam }, options)
useQueryParams({ myparam: ‘inherit’ }, options)
←inherit myparam param name from QueryParamProviderNew
options
prop to QueryParamProvider and argument to useQueryParam(s)enableBatching
option (i.e., multiple consecutive calls to setQueryParams in a row only result in a single update to the URL). This seems to work but would require updating the way all the tests are written to verify for sure, so marking as experimental for now.removeDefaultsFromUrl
(default: false). This happens on updates only, not on initial load. Requires the use of thedefault
attribute on a parameter to function (note serialize-query-params v2 withDefault now populates this).includeKnownParams
- in addition to those specified, also include all preconfigured parameters from the QueryParamProviderincludeAllParams
(default: false) - in addition to those specified, include all other parameters found in the current URLupdateType
(default “pushIn”) - the default update type when set is called.searchStringToObject, objectToSearchString
(default uses URLSearchParams) - equivalent ofparse
andstringify
from query-string.Parameters now can include
urlName
to automatically convert to a different name in the URL (e.g. { encode, decode, urlName })Caches decoded values across multiple hook calls from different components
Fixes
Stops reading from refs in render to prepare for future versions of React where this is not allowed.
Simplifies the way locations are updated by only passing in the search string as the new location.
v2.0.0-rc.1 Fix CJS imports of adapters (#224)
v2.0.0-rc.1 Be more defensive about reading updateType
Migrating from v1
There are two things you need to adjust to update from v1:
searchStringToObject
andobjectToSearchString
.Here's an example of the changes to complete both for React Router 5:
If you're using react-router-6, you'd import that adapter instead:
Note the
options
above are optional, but will retain the behavior you're used to from v1, which used query-string internally. If you want to switch to using URLSearchParams and not use query-string, you would do:Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.