Skip to content

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
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.

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!

@ranile ranile merged commit 3c7e3e3 into yewstack:master Oct 12, 2024
geoffjay pushed a commit to geoffjay/yew that referenced this pull request Jan 25, 2025
* yew-router: Dynamic basename.

* Revisions.

* Test location.path and navigator.basename match expectations at each step.

* Better coverage of edge case.
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