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

yew-router: Dynamic basename. #3725

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

finnbear
Copy link
Contributor

@finnbear finnbear commented Sep 6, 2024

Description

  1. Currently, if basename changes, the URL isn't updated and the old basename is persisted until the next navigation. With this PR, basename changes take effect immediately.
  2. Currently, if basename is initially Some, the URL may lack the basename until the next nagvigation. With this PR, the basename is immediately added to the URL.

Motivation

In my application, base path is used for something resembling a workspace while route is used for something resembling a page id with parameters. The base path may not exist (the default 'workspace') or may change (when moving between 'workspaces').

Checklist

  • I have reviewed my own code
  • I have tested my changes in my app
  • I have added tests modified existing test to test all new functionality

@finnbear finnbear marked this pull request as draft September 11, 2024 19:22
@finnbear finnbear changed the title yew-router: Allow basename to change. yew-router: Dynamic basename. Sep 12, 2024
@finnbear finnbear marked this pull request as ready for review September 12, 2024 21:24
@finnbear finnbear mentioned this pull request Sep 13, 2024
1 task
packages/yew-router/src/router.rs Outdated Show resolved Hide resolved
packages/yew-router/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the change. I have just one more concern here. Other than that, it looks good.

packages/yew-router/src/router.rs Outdated Show resolved Hide resolved
Copy link
Member

@ranile ranile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

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.

2 participants