Closed frederfred closed 1 year ago
Path patterns use normal regular expressions, so we won't be modifying how regex's are evaluated. However, maybe this is helpful? https://github.com/hotwired/turbo-android/pull/178
Thanks, and sorry for keeping the issue open for long. I forgot about it 🙃
Right now, I'm ignoring any query string in the pattern by doing this:
"patterns": [
"^/some-path(\\?.*)?$",
],
"properties": {}
I haven't really figured out what "query_string_presentation": "replace"
does, but are you saying that this configuration would produce the same result, ignoring any query string in the path?
"patterns": [
"^/some-path",
],
"properties": {
"query_string_presentation": "replace"
}
If you have "query_string_presentation": "replace"
configured for your path, it will allow all /some-path*
visits (with or without a query string) to act as "replace"
visits — meaning that each subsequent /some-path*
visit will not push a new destination onto the backstack.
Where we find this helpful at 37signals is when a page contains a content-filter feature, like a drop-down <select>
menu. Selecting a new option updates the url with a new query string filter and the current destination is reloaded without adding a new destination onto the backstack.
Ah, thanks for clarifying that. Then I believe I have to live with "^/some-path(\\?.*)?$"
patterns because this used for specifying what fragment I would like to end up on.
Hi,
I'm wondering if there is a possibility for patterns set in the path configuration config to ignore query strings?
Our use case is that we have one start location for a tab, e.g.
/some-path?initial_visit=true
, that we then replace with another location for any further visits (just using/some-path
). Right now our config looks something like this, which works, but feels a little bit awkward:Maybe adding an option like
"ignore_query_string": true
in theproperties
object could be an idea?Many thanks for providing this framework :)