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

fix(core): add hash symbol in uri parse, closes #1943 #1947

Merged
merged 2 commits into from
Jun 4, 2021

Conversation

olegshilov
Copy link
Contributor

What kind of change does this PR introduce? (check at least one)
Described here: #1943

  • Bugfix
  • Feature
  • New Binding Issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change? (check one)

  • Yes. Issue #___
  • No

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's title (e.g. fix: #xxx[,#xxx], where "xxx" is the issue number)
  • A change file is added if any packages will require a version bump due to this PR per the instructions in the readme.

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature (to avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it)

Other information:

@olegshilov olegshilov requested a review from a team June 4, 2021 13:59
@amrbashir
Copy link
Member

amrbashir commented Jun 4, 2021

Since this PR is touching the #, I am a little concerned about hashed routes, will this affect how they behave or not (sry, can't test it atm)?

Ideally two things should be working:

  1. Routing within a SPA by calling the hashed router respective methods, for example: vue-router's router.go(1) or router.push('route-name').

  2. Navigating to a hashed route like tauri://custom-protocol/#/nested/route as if you type it in the address bar of a normal browser. maybe @lucasfernog can have more insight on how we might test this in tauri context

@lucasfernog
Copy link
Member

Since this PR is touching the #, I am a little concerned about hashed routes, will this affect how they behave or not (sry, can't test it atm)?

Ideally two things should be working:

  1. Routing within a SPA by calling the hashed router respective methods, for example: vue-router's router.go(1) or router.push('route-name').
  2. Navigating to a hashed route like tauri://custom-protocol/#/nested/route as if you type it in the address bar of a normal browser. maybe @lucasfernog can have more insight on how we might test this in tauri context

Hash route does not trigger the custom protocol, it is handled by the router framework. Since the hash portion is just an anchor, it doesn't trigger a new page load.

@lucasfernog
Copy link
Member

I'll test this anyway.

@lucasfernog lucasfernog changed the title fix(core): add hash symbol in uri parse fix(core): add hash symbol in uri parse, closes #1943 Jun 4, 2021
@lucasfernog
Copy link
Member

Works like a charm, tested with a Vue router hash mode app (https://github.com/mayank091193/quasar-scrum) and it didn't affect it since the hash URLs doesn't even hit the custom protocol.

@olegshilov olegshilov requested a review from a team as a code owner June 4, 2021 18:01
@amrbashir
Copy link
Member

My bad then, I thought directly navigating to a hashed route would still try to go through custom protocol.

Thanks for the PR @olegshilov

@lucasfernog lucasfernog merged commit 07fd9a9 into tauri-apps:dev Jun 4, 2021
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

Successfully merging this pull request may close these issues.

5 participants