Skip to content

Commit 479e43b

Browse files
ci: apply automated fixes
1 parent 6094277 commit 479e43b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/blog/tanstack-router-navigation-lifetimes.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ The final publish arrow compresses two steps: the private lane selects a result,
110110

111111
### One Loader, Several Leases <!-- "lease" explainer -->
112112

113-
Both the *preload* lane and the *navigation* lane need `/account`'s data. But the `loader` is only invoked once.
113+
Both the _preload_ lane and the _navigation_ lane need `/account`'s data. But the `loader` is only invoked once.
114114

115115
Sharing one invocation raises a question: when is it safe to abort? So the invocation is wrapped in a **flight**: a promise, its abort controller, and a lease count. Every consumer that needs it takes a **lease**.[^flights]
116116

@@ -125,7 +125,7 @@ Acquiring a lease raises the count. Releasing one removes that consumer's claim
125125

126126
Preloads, pending routes, rendered routes, and cache entries all hold leases, and a lease can outlive the promise it covers: the claim is about the lifetime of the resource, not the delivery of a value.
127127

128-
That is why `/account` still reaches the cache. Clicking `/settings` releases the *navigation*'s lease, but the hover's *preload* lease is still there. The count never reaches zero, nothing is aborted, and the result is cached when it finally settles.
128+
That is why `/account` still reaches the cache. Clicking `/settings` releases the _navigation_'s lease, but the hover's _preload_ lease is still there. The count never reaches zero, nothing is aborted, and the result is cached when it finally settles.
129129

130130
### The Navigation Was Replaced. Its Loader Kept Going. <!-- "transaction" explainer -->
131131

@@ -141,6 +141,7 @@ The slot changes hands, so the `/account` lane may never publish. The flight it
141141
Without the transaction, the `/account` lane can no longer publish its matches. It will stop at its next async boundary and release its leases. This in turn may abort the loader flights that have no other leases, but in our example the preload still holds a lease which means the flight continues.
142142

143143
It becomes very easy to enforce that a lane cannot publish if it is not allowed to:
144+
144145
```ts
145146
if (router._tx !== tx) {
146147
finishPending(tx)
@@ -150,6 +151,7 @@ if (router._tx !== tx) {
150151
```
151152

152153
<!-- TODO: this paragraph below is interesting, but it feels less about "transactions" (this section) than about lanes (section below) or leases (section above). -->
154+
153155
Notice what was never shared. The preload and the navigation each did their own matching, built their own context, ran their own `beforeLoad`, and kept their own lane. They shared one loader invocation and its outcome, nothing more. Reusing work must not mean inheriting another consumer's draft of the page.
154156

155157
### The Error Finished First. The Redirect Still Won. <!-- "lane" explainer -->
@@ -166,6 +168,7 @@ Loader outcomes return to the lane. The lane, not the order the promises settled
166168
</figure>
167169

168170
<!-- TODO: the rest of this section is very confusing. We're saying simple things here, it feels like this shouldn't be this hard to explain it. -->
171+
169172
An ordinary failure is held as provisional, because other parallel loaders may still redirect. A redirect is control flow, not something to render: it asks for another navigation. So the redirect replaces the provisional failure, even though the error settled first.
170173

171174
This is not a general ranking where redirects matter more than errors. With no redirect in the branch, the lane still has to select a failure and the boundary that renders it. Our goal is merely that promise timing alone does not decide what reaches the page.

0 commit comments

Comments
 (0)