Skip to content
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

Support query parameters in routes #130

Closed
Tracked by #120
lukechu10 opened this issue Jun 27, 2021 · 6 comments · Fixed by #752
Closed
Tracked by #120

Support query parameters in routes #130

lukechu10 opened this issue Jun 27, 2021 · 6 comments · Fixed by #752
Labels
A-router Area: router C-enhancement Category: new feature or improvement to existing feature
Milestone

Comments

@lukechu10
Copy link
Member

No description provided.

@lukechu10 lukechu10 mentioned this issue Jun 27, 2021
7 tasks
@lukechu10 lukechu10 added difficulty: some C-enhancement Category: new feature or improvement to existing feature A-router Area: router labels Jun 27, 2021
@Ochism
Copy link
Contributor

Ochism commented Aug 8, 2021

I would be willing to take a look at this.

@lukechu10
Copy link
Member Author

Go ahead!

@davidon-top
Copy link
Contributor

will make a pr

@davidon-top
Copy link
Contributor

@lukechu10 can i rewrite the url segment (parsing, matching) code to work more like proc_macros (tokenstreams, syn/parsing, quote/in this case matching) instead of doing weird string splitting that is hard to get right and has many edge cases

@lukechu10
Copy link
Member Author

@lukechu10 can i rewrite the url segment (parsing, matching) code to work more like proc_macros (tokenstreams, syn/parsing, quote/in this case matching) instead of doing weird string splitting that is hard to get right and has many edge cases

Are you talking about for supporting query parameters? To be honest, I haven’t even really thought about how I would want the API to look. However, I don’t think putting this into the process-macro would be a good idea since in that case you should be using dynamic route paths/segments anyways.

I was thinking of something more along the lines of SolidJS useSearchParams: https://docs.solidjs.com/solid-router/reference/primitives/use-search-params

what do you think?

@davidon-top
Copy link
Contributor

i was starting to work on an implementation that would handle this:

#[to("/existing/<param>?query=val&match=<capture>&every=<all..>#<frag>")]

but simply getting the query and frag from a function in a component would also be fine i guess, it might not be very ssr friendly but once there are first-party server integrations it should be fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-router Area: router C-enhancement Category: new feature or improvement to existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants