@rangojs/router 0.0.0-experimental.40 → 0.0.0-experimental.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1745,7 +1745,7 @@ import { resolve } from "node:path";
1745
1745
  // package.json
1746
1746
  var package_default = {
1747
1747
  name: "@rangojs/router",
1748
- version: "0.0.0-experimental.40",
1748
+ version: "0.0.0-experimental.41",
1749
1749
  description: "Django-inspired RSC router with composable URL patterns",
1750
1750
  keywords: [
1751
1751
  "react",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rangojs/router",
3
- "version": "0.0.0-experimental.40",
3
+ "version": "0.0.0-experimental.41",
4
4
  "description": "Django-inspired RSC router with composable URL patterns",
5
5
  "keywords": [
6
6
  "react",
@@ -188,6 +188,7 @@ export async function resolveInterceptEntry<TEnv>(
188
188
  context,
189
189
  actionContext,
190
190
  stale,
191
+ traceSource: "intercept-loader",
191
192
  });
192
193
 
193
194
  if (!shouldRevalidate) {
@@ -355,6 +356,7 @@ export async function resolveInterceptLoadersOnly<TEnv>(
355
356
  context,
356
357
  actionContext,
357
358
  stale,
359
+ traceSource: "intercept-loader",
358
360
  });
359
361
 
360
362
  if (!shouldRevalidate) {
@@ -12,7 +12,10 @@ export interface RevalidationTraceEntry {
12
12
  | "cache-hit"
13
13
  | "loader"
14
14
  | "parallel"
15
- | "orphan-layout";
15
+ | "orphan-layout"
16
+ | "route-handler"
17
+ | "layout-handler"
18
+ | "intercept-loader";
16
19
  defaultShouldRevalidate: boolean;
17
20
  finalShouldRevalidate: boolean;
18
21
  reason: string;
@@ -168,6 +168,7 @@ export function withSegmentResolution<TEnv>(
168
168
  ctx.interceptResult,
169
169
  ctx.localRouteName,
170
170
  ctx.pathname,
171
+ ctx.stale,
171
172
  ),
172
173
  );
173
174
 
@@ -138,6 +138,7 @@ export interface RouterContext<TEnv = any> {
138
138
  interceptResult: InterceptResult | null,
139
139
  localRouteName: string,
140
140
  pathname: string,
141
+ stale?: boolean,
141
142
  ) => Promise<{ segments: ResolvedSegment[]; matchedIds: string[] }>;
142
143
 
143
144
  // Generator-based segment resolution (for pipeline)
@@ -188,7 +189,10 @@ export interface RouterContext<TEnv = any> {
188
189
  | "cache-hit"
189
190
  | "loader"
190
191
  | "parallel"
191
- | "orphan-layout";
192
+ | "orphan-layout"
193
+ | "route-handler"
194
+ | "layout-handler"
195
+ | "intercept-loader";
192
196
  }) => Promise<boolean>;
193
197
 
194
198
  // Request context
@@ -608,6 +608,8 @@ export async function resolveEntryHandlerWithRevalidation<TEnv>(
608
608
  context,
609
609
  actionContext,
610
610
  stale,
611
+ traceSource:
612
+ entry.type === "route" ? "route-handler" : "layout-handler",
611
613
  });
612
614
  emitRevalidationDecision(
613
615
  entry.shortCode,
@@ -1165,6 +1167,7 @@ export async function resolveAllSegmentsWithRevalidation<TEnv>(
1165
1167
  localRouteName: string,
1166
1168
  pathname: string,
1167
1169
  deps: SegmentResolutionDeps<TEnv>,
1170
+ stale?: boolean,
1168
1171
  ): Promise<{ segments: ResolvedSegment[]; matchedIds: string[] }> {
1169
1172
  const allSegments: ResolvedSegment[] = [];
1170
1173
  const matchedIds: string[] = [];
@@ -1209,7 +1212,7 @@ export async function resolveAllSegmentsWithRevalidation<TEnv>(
1209
1212
  loaderPromises,
1210
1213
  deps,
1211
1214
  actionContext,
1212
- false,
1215
+ stale,
1213
1216
  ),
1214
1217
  (seg) => ({ segments: [seg], matchedIds: [seg.id] }),
1215
1218
  deps,
@@ -204,6 +204,7 @@ export function createSegmentWrappers<TEnv = any>(
204
204
  interceptResult: { intercept: InterceptEntry; entry: EntryData } | null,
205
205
  localRouteName: string,
206
206
  pathname: string,
207
+ stale?: boolean,
207
208
  ): ReturnType<typeof _resolveAllSegmentsWithRevalidation> {
208
209
  return _resolveAllSegmentsWithRevalidation(
209
210
  entries,
@@ -221,6 +222,7 @@ export function createSegmentWrappers<TEnv = any>(
221
222
  localRouteName,
222
223
  pathname,
223
224
  segmentDeps,
225
+ stale,
224
226
  );
225
227
  }
226
228