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
2 changes: 1 addition & 1 deletion .github/workflows/perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ jobs:
done

- name: Setup Vite+
uses: voidzero-dev/setup-vp@250f29ce396baf5e8f24498e17c0dfdebabc26eb # v1
uses: voidzero-dev/setup-vp@35171c92dd08b67d5a9d3f2a4327800e58396f2a # v1
with:
node-version: "24"
cache: true
Expand Down
14 changes: 7 additions & 7 deletions packages/vinext/src/routing/app-route-graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1197,7 +1197,7 @@ function discoverSlotSubRoutes(

const subPages = findSlotSubPages(slotDir, matcher);
for (const { relativePath, pagePath } of subPages) {
const subSegments = relativePath.split(path.sep);
const subSegments = relativePath.split("/");
const convertedSubRoute = convertSegmentsToRouteParts(subSegments);
if (!convertedSubRoute) continue;

Expand Down Expand Up @@ -1485,7 +1485,7 @@ function findSlotSubPages(slotDir: string, matcher: ValidFileMatcher): SlotSubPa
const subDir = path.join(dir, entry.name);
const page = findFile(subDir, "page", matcher);
if (page) {
const relativePath = path.relative(slotDir, subDir);
const relativePath = normalizePathSeparators(path.relative(slotDir, subDir));
results.push({ relativePath, pagePath: page });
}
// Continue scanning deeper for nested sub-pages
Expand Down Expand Up @@ -1520,8 +1520,8 @@ function findSlotConfigLayoutTreePositions(
layoutPaths: readonly string[],
): number[] {
return layoutPaths.map((layoutPath) => {
const relativeDir = path.relative(slotDir, path.dirname(layoutPath));
return relativeDir ? relativeDir.split(path.sep).filter(Boolean).length : 0;
const relativeDir = normalizePathSeparators(path.relative(slotDir, path.dirname(layoutPath)));
return relativeDir ? relativeDir.split("/").filter(Boolean).length : 0;
});
}

Expand Down Expand Up @@ -1796,9 +1796,9 @@ function computeLayoutTreePositions(appDir: string, layouts: string[]): number[]
const layoutDir = path.dirname(layoutPath);
// path.relative tolerates mixed separators and win32 case differences,
// so an empty result is the separator-agnostic "layout at app root" test.
const relative = path.relative(appDir, layoutDir);
const relative = normalizePathSeparators(path.relative(appDir, layoutDir));
if (relative === "") return 0;
return relative.split(path.sep).length;
return relative.split("/").length;
});
}

Expand Down Expand Up @@ -2130,7 +2130,7 @@ function findMirroredSlotPage(
};
let best: Candidate | null = null;
for (const { relativePath, pagePath } of findSlotSubPages(slotDir, matcher)) {
const slotSegments = relativePath.split(path.sep);
const slotSegments = relativePath.split("/");
const slotUrl = convertSegmentsToRouteParts(slotSegments);
if (!slotUrl) continue;
if (!patternsCompatible(slotUrl.urlSegments, routeUrl.urlSegments)) continue;
Expand Down