Repository navigation
Conversation
🦋 Changeset detectedLatest commit: c91cfd6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Fixes #746.
With
hashHistory(),<a href="#/">and<a href="#/applications">are both marked current at the root, and neither is marked on Applications. A display string passed touseLinkStatealso disagrees with the equivalent paths node. The documented anchor/hook rule should compare logical routes.Pass claimed hrefs through the history adapter before matching, and decode
#/display routes inuseLinkState. Fragment-only strings such as#detailsretain route-relative resolution, including during SSR without browser globals. Keep logical paths, query-aware matching, eligibility rules, and browser-history behavior unchanged. Includes a patch changeset.Reproduction: run the two-route app linked in #746 with router 2.0.1, open
/#/, click Applications, then reload. With this fix, only the current page's link is marked on each step; browser-history behavior is unchanged.Regression:
pnpm exec vitest run test/link-state.spec.ts— four cases fail with the old sources and pass with the fix, covering anchor targets, href reclaim, hook strings, queries, fragments and a router base.Server regression:
pnpm exec vitest run --config vitest.config.server.ts test/server/ssr-link-state.spec.tsxchecks fragment-only inputs and display routes, including query matching, withoutwindow.Checks:
pnpm test(766 client tests, 118 server tests, and types),pnpm build, andpnpx @arethetypeswrong/cli --pack . --profile esm-onlypass.Prepared by an automated contribution pipeline that I build and operate (https://github.com/clean99/software-factory); the tests and evidence above were produced by it.