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

auto_route fragment support #1980

Closed
TekExplorer opened this issue Jun 18, 2024 · 5 comments
Closed

auto_route fragment support #1980

TekExplorer opened this issue Jun 18, 2024 · 5 comments

Comments

@TekExplorer
Copy link

I want to have certain routes use fragments to represent the current location, such as the current file being edited

I also use it for filters in some places, though I recognize that those could be query parameters.

Its also used for my login route, where a url needs to be inputted and then an api key on the next page. That Uri needs to be in the path, but urlEncoding it looks honestly terrible. Plus, its not a great api for the sake of deep links.

I dont really see fragments used at all, so i'm a little concerned.

If its not supported, what would it take to support it?

@TekExplorer
Copy link
Author

It really doesn't look like it does support fragments...
This is despite PageRouteInfo having the field already, so... I'm confused. Why is the field there if it isn't being used?

@Milad-Akarie
Copy link
Owner

@TekExplorer are you you saying you can't read #fragment from a url?

@TekExplorer
Copy link
Author

TekExplorer commented Jun 25, 2024

@TekExplorer are you you saying you can't read #fragment from a url?

I'm saying I can't use it as a parameter In my route. This is important to me as the fragment is sometimes required, or otherwise has important semantic meaning.

Go router builder has the same issue if just not addressing the fragment at all, despite being otherwise trivial to implement.

@TekExplorer
Copy link
Author

@Milad-Akarie What are your thoughts on the matter? Do you intend to properly support fragments for routes?

@TekExplorer TekExplorer changed the title Question: Does auto_route support fragments? auto_route fragment support Jul 10, 2024
@Milad-Akarie
Copy link
Owner

@TekExplorer fragment support is added in the latest version of auto_route, make sure you update the generator as well.

use the @urlFragment annotation the same way you'd use @QueryParam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants