Repository navigation
v2.0.0-next.35
Pre-releasePatch Changes
-
5da9bb5:
aria-current="page"now requires the query to match as well as the path, ignoring parameter order. On/?filter=active, a link to/?filter=activeis current and a link to/is not; previously every link to/with any query was current.data-activeanddata-pendingstill compare the path only. -
0159537: Respect a path-segment boundary when deciding whether a link is under the router's base path. Under base
/app, a link to/appleor/application/xis no longer claimed for link state (data-active,aria-current,data-pending) or intercepted on click;/app,/app/and/app/...still are. Without a base, behavior is unchanged. -
6919c28: Fix two link-state matching bugs shared by claimed anchors and
useLinkState:- Non-ASCII links now match. Both sides compare in the percent-encoded form
location.pathnameuses, so<a href="/café">is active and current on/café, whether the link spells the path raw or encoded. Encoded reserved characters such as%2Fare never decoded, so they don't match a different path. A stray%in the location (/100%) no longer throws aURIErrorthat halted the app's reactivity. - Under a router
base, the base root link (/app,/app/, oruseLinkState("/")) is exact-only like/is without a base. Before, it was active on every page under the base.
- Non-ASCII links now match. Both sides compare in the percent-encoded form
-
c7a46ce: Claimed anchors and
useLinkStatenow share one matching rule:currentis the same path and query (parameter order and hash aside),activeis the path only, exact or prefix, with the root link exact-only.useLinkState().currentcompares the query likearia-current="page"does, so on/?filter=activea link to/is no longer current.useLinkState("/").active()is no longer true on every page; the root link only matches exactly, as it already did for anchors.- An
aria-currentthe author set (for example"step") is no longer overwritten with"page"when the link matches. The router only writes and removes the attribute where it set it, and still re-applies its own value after a server-component morph strips it.
-
5da9bb5:
aria-currentsurvives a server-component morph. The morph makes a link's attributes match the server's HTML, which never carries link state, and then re-claims the link;data-activeanddata-pendingcame back, butaria-currentstayed stripped because the router only wrote it when its own record said the value had changed. It is now checked against the element on every re-claim. -
1b12229: Settle router actions when their result is on screen (#649). A form's
aria-busy, theonSettledhooks and the submission record now release at the commit of the action's transition, instead of when the action body returns, so a revalidation refetch or redirect that holds the transition no longer clears busy state, runs hooks or renders the submission while the old UI is still showing. A nestedyield call()settles at the outer action's commit. The promise fromuseAction(and the action call) still resolves when the body finishes, so it can come before the settle. The hooks that run are the ones registered when the body finished, the same set as before: a hook owned by a component the commit unmounts (the page a redirect leaves) still runs for that submission.Every exit path settles exactly once: a failure outside the mutation (a throwing
onSubmithook, a response that fails to decode) now releases the form and records the error on the submission, where it previously rejected the form submission unrecorded. A throwingonSettledhook is reported without stopping the hooks after it.Busy state is keyed by the form's
actionURL rather than the element, so a form that a server-component morph strips, or that a re-render replaces mid-flight, getsaria-busyback when it is (re-)claimed. Likearia-current, the router only manages anaria-busyit set: an authored value is never overwritten or removed. A consequence of keying by URL: other forms posting to the same action URL show busy while it is in flight.