-
Notifications
You must be signed in to change notification settings - Fork 12
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
Keep (Parent Route) Query Parameters #476
Labels
enhancement
New feature or request
Comments
+1! I wanted to make a super useful wrapper around this primitive like
But I wanted these urls to be live, respect like, |
I think what |
I got it working! |
I think the only one that is hard to have a non-tracked version is |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The default behavior of Ember's
<LinkTo>
is to keep the query parameters of parent routes.<Link>
does not auto-append any query parameters to the generated URL. They need to be passed in explicitly via@query
. This is über annoying, when you want to use<Link>
as a substitute for<LinkTo>
in a scenario where a child route links back to a parent route.<Link>
and{{link}}
should offer a@keepQuery
option. It can take these values:none
/ falsy value (default, current behavior): No QPs of the current location are kept.@query
are appended.known
: Only QPs of the current location at the time of invocation that are defined as known QPs in the current route hierarchy are kept.@query
override these QPs individually.null
/undefiend
value in the@query
object will remove a kept QP.all
: All QPs of the current location at the time of invocation are kept.@query
override these QPs individually.null
/undefiend
value in the@query
object will remove a kept QP.tracked-known
: Only QPs that are defined as known QPs in the current route hierarchy are kept.url
will be updated live.@query
override these QPs individually.null
/undefiend
value in the@query
object will remove a kept QP.tracked-all
: All QPs of the current location are kept.url
will be updated live.@query
override these QPs individually.null
/undefiend
value in the@query
object will remove a kept QP.Unresolved Questions
none
is the current behavior. Changing this would be a breaking change IMO, so I'd make it the default, too. Do we want to keep it this way though or switch to a different default?Assuming we want to switch, we could raise a deprecation warning, prompting the user to explicitly chose
none
or a different behavior.Should the default be configurable or should we allow users to opt-in to the new default mode prior to upgrading to the next major version?
Do the names used here make sense?
@keepQuery
,none
,known
,all
,tracked-*
,untracked-*
?Do we need the
tracked-*
variants? Or do we not need the untracked variant? Should the untracked variants also be prefixed withuntracked-*
? Or should thetracked-*
variants instead have no prefix?The text was updated successfully, but these errors were encountered: