Repository navigation
feat: accept route locations in buildUrl - #3798
Merged
Merged
Conversation
buildUrl now takes everything router.resolve takes, so callers can pass a named route instead of a path. In history mode a query in the resolved route is kept instead of being encoded into the path.
The picker modals, the editor links opened in a new tab and the pathchange event built absolute urls from window.location.origin. That drops the base path in hash mode, and for the pathchange event also in history mode, since fullPath does not include the base.
dschmidt
marked this pull request as ready for review
October 14, 2026 13:48
This was referenced Oct 14, 2026
fix(pastebin): copy the pastebin view link after creating a pastebin
opencloud-eu/web-extensions#629
Merged
JammingBen
approved these changes
Oct 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
buildUrl(router, to)now accepts everythingrouter.resolveaccepts, not only a path string. String calls behave as before.I ran into this in the pastebin app (opencloud-eu/web-extensions#628), which needs an absolute link to its own route. With a route location, the route name stays the single source of truth and the extra lookup goes away.
Also in this PR:
hrefwas assigned toURL.pathname, so a query came out as/app/view%3Fx=1.pathchangeevent built URLs withwindow.location.originby hand and now usebuildUrl. With the default<base href="/">nothing changes. In hash mode they dropped the current path, and thepathchangeURLs missed the#and, under a sub path, the base path.<base href="/">, unit tests had none, sovitest.init.tsnow adds it.Related Issue
How Has This Been Tested?
buildUrlunit tests with a real router: named routes with params and query, hash and history mode, with and without base path; the query cases fail without the fixvue-tscTypes of changes