Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/vinext/src/server/app-browser-action-result.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ACTION_REVALIDATED_HEADER } from "./headers.js";
import { VINEXT_RSC_CONTENT_TYPE } from "./app-rsc-cache-busting.js";
import { ServerActionResultFactsV0 } from "./navigation-planner.js";
import { ServerActionResultFacts } from "./navigation-planner.js";

export type AppBrowserServerActionResult<TRoot> = {
root?: TRoot;
Expand Down Expand Up @@ -124,7 +124,7 @@ export type ServerActionResultResponseFactsInput = {
*/
export function createServerActionResultFacts(
input: ServerActionResultResponseFactsInput,
): ServerActionResultFactsV0 {
): ServerActionResultFacts {
return {
actionRedirectHref: input.actionRedirectHref,
actionRedirectType: input.actionRedirectType === "push" ? "push" : "replace",
Expand Down
12 changes: 6 additions & 6 deletions packages/vinext/src/server/app-browser-entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,8 @@ import {
import { removeStylesheetLinksCoveredByInlineCss } from "./app-inline-css-client.js";
import {
navigationPlanner,
type NavigationReuseFactsV0,
type VisitedResponseCacheCandidateFactsV0,
type NavigationReuseFacts,
type VisitedResponseCacheCandidateFacts,
} from "./navigation-planner.js";

type SearchParamInput = ConstructorParameters<typeof URLSearchParams>[0];
Expand Down Expand Up @@ -714,12 +714,12 @@ type VisitedResponseCacheCandidate =
| {
cacheKey: string;
entry: VisitedResponseCacheEntry;
facts: Extract<VisitedResponseCacheCandidateFactsV0, { candidate: "present" }>;
facts: Extract<VisitedResponseCacheCandidateFacts, { candidate: "present" }>;
}
| {
cacheKey: string;
entry: null;
facts: Extract<VisitedResponseCacheCandidateFactsV0, { candidate: "missing" }>;
facts: Extract<VisitedResponseCacheCandidateFacts, { candidate: "missing" }>;
};

function readVisitedResponseCacheCandidate(
Expand Down Expand Up @@ -1791,7 +1791,7 @@ function bootstrapHydration(rscStream: ReadableStream<Uint8Array>): void {
facts: {
candidate: "missing",
navigationKind,
} satisfies Extract<VisitedResponseCacheCandidateFactsV0, { candidate: "missing" }>,
} satisfies Extract<VisitedResponseCacheCandidateFacts, { candidate: "missing" }>,
}
: readVisitedResponseCacheCandidate(
rscUrl,
Expand All @@ -1806,7 +1806,7 @@ function bootstrapHydration(rscStream: ReadableStream<Uint8Array>): void {
visitedResponseCandidate,
visitedResponseDecision,
);
const visitedResponse: NavigationReuseFactsV0["visitedResponse"] =
const visitedResponse: NavigationReuseFacts["visitedResponse"] =
cachedRoute === null ? { status: "unavailable" } : { status: "available" };
const prefetchProbeDecision = navigationPlanner.classifyNavigationPrefetchProbe({
bypassNavigationCache: shouldBypassNavigationCache,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { ServerActionResultDecisionV0 } from "./navigation-planner.js";
import type { ServerActionResultDecision } from "./navigation-planner.js";

// Dispatches the executor effects implied by a ServerActionResultDecisionV0.
// Dispatches the executor effects implied by a ServerActionResultDecision.
// Returns true if a hard-navigation was triggered (the caller should return early);
// false if the decision is "proceed" and normal action processing should continue.
// Both callbacks are injected so this function is testable without browser globals.
export function applyServerActionResultDecision(
decision: ServerActionResultDecisionV0,
decision: ServerActionResultDecision,
clearCaches: () => void,
performHardNavigation: (url: string, historyMode?: "assign" | "replace") => void,
): boolean {
Expand Down
22 changes: 11 additions & 11 deletions packages/vinext/src/server/app-browser-state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ import { createCacheEntryReuseProof, type CacheEntryReuseProof } from "./cache-p
import {
navigationPlanner,
resolveDefaultOrUnmatchedSlotPersistenceForLayouts,
type MountedParallelSlotSnapshotV0,
type NavigationDecisionV0,
type MountedParallelSlotSnapshot,
type NavigationDecision,
type OperationLane,
type OperationToken,
type RouteSnapshotV0,
type RouteSnapshot,
} from "./navigation-planner.js";
import {
createSnapshotPathAndSearch,
Expand Down Expand Up @@ -569,8 +569,8 @@ function createPendingNavigationTraceFields(options: {

function createMountedParallelSlotSnapshots(
elements: AppElements,
): readonly MountedParallelSlotSnapshotV0[] {
const snapshots: MountedParallelSlotSnapshotV0[] = [];
): readonly MountedParallelSlotSnapshot[] {
const snapshots: MountedParallelSlotSnapshot[] = [];
for (const slotId of getMountedSlotIds(elements)) {
const parsed = AppElementsWire.parseElementKey(slotId);
if (parsed?.kind !== "slot") continue;
Expand All @@ -582,7 +582,7 @@ function createMountedParallelSlotSnapshots(
return snapshots;
}

function createVisibleRouteSnapshot(state: AppRouterState): RouteSnapshotV0 {
function createVisibleRouteSnapshot(state: AppRouterState): RouteSnapshot {
const displayUrl = createSnapshotPathAndSearch(state.navigationSnapshot);
const matchedUrl = normalizeNavigationSnapshotMatchedUrl(state.navigationSnapshot.pathname);
return {
Expand All @@ -605,7 +605,7 @@ function createVisibleRouteSnapshot(state: AppRouterState): RouteSnapshotV0 {
};
}

function createPendingRouteSnapshot(pending: PendingNavigationCommit): RouteSnapshotV0 {
function createPendingRouteSnapshot(pending: PendingNavigationCommit): RouteSnapshot {
const displayUrl = createSnapshotPathAndSearch(pending.action.navigationSnapshot);
const matchedUrl = normalizeNavigationSnapshotMatchedUrl(
pending.action.navigationSnapshot.pathname,
Expand All @@ -631,7 +631,7 @@ function createPendingRouteSnapshot(pending: PendingNavigationCommit): RouteSnap
function createPendingNavigationOperationToken(options: {
pending: PendingNavigationCommit;
routeManifest: RouteManifest | null;
targetSnapshot: RouteSnapshotV0;
targetSnapshot: RouteSnapshot;
}): OperationToken {
return {
baseVisibleCommitVersion: options.pending.action.operation.startedVisibleCommitVersion,
Expand All @@ -643,7 +643,7 @@ function createPendingNavigationOperationToken(options: {
};
}

function createRootBoundarySnapshotFingerprint(snapshot: RouteSnapshotV0): string {
function createRootBoundarySnapshotFingerprint(snapshot: RouteSnapshot): string {
return `${snapshot.routeId}|root:${snapshot.rootBoundaryId ?? "unknown"}`;
}

Expand All @@ -653,7 +653,7 @@ function planPendingRootBoundaryFlightResponse(options: {
routeManifest: RouteManifest | null;
targetHref?: string;
traceFields: NavigationTraceFields;
}): NavigationDecisionV0 {
}): NavigationDecision {
const targetSnapshot = createPendingRouteSnapshot(options.pending);
const token = createPendingNavigationOperationToken({
pending: options.pending,
Expand Down Expand Up @@ -691,7 +691,7 @@ function planPendingRootBoundaryFlightResponse(options: {
}

function mapNavigationDecisionToPendingDisposition(
decision: NavigationDecisionV0,
decision: NavigationDecision,
): PendingNavigationCommitDispositionDecision {
switch (decision.kind) {
case "proposeCommit":
Expand Down
Loading
Loading