Skip to content

chore: upgrade vite-plus to pkg-pr-new #1538#10

Draft
fengmk2 wants to merge 1 commit into
mainfrom
update-vite-plus-1538
Draft

chore: upgrade vite-plus to pkg-pr-new #1538#10
fengmk2 wants to merge 1 commit into
mainfrom
update-vite-plus-1538

Conversation

@fengmk2
Copy link
Copy Markdown
Owner

@fengmk2 fengmk2 commented May 9, 2026

Upgrade vite-plus and related packages to the pkg-pr-new test build from voidzero-dev/vite-plus#1538 (commit f8973e4).

Upstream PR: voidzero-dev/vite-plus#1538

@fengmk2 fengmk2 self-assigned this May 9, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces several significant updates to the vinext framework, focusing on performance, stability, and compatibility with Next.js. Key changes include the implementation of per-render fetch deduplication, the introduction of a deploymentId for deployment-aware caching, and the addition of a new cache proof model. The navigation logic has been refactored to use a more robust commit approval process, including a hard navigation loop guard and better handling of concurrent actions. Prerendering now supports configurable concurrency and extracts RSC payloads directly from rendered HTML to avoid redundant requests. Additionally, cache tags are now canonicalized to ensure consistent invalidation, and React peer dependencies have been updated. Feedback highlights an inconsistency in ISR cache capturing for static pages and a potential instability in fetch cache keys due to unsorted headers.

let expireSeconds = options.expireSeconds;
const shouldCaptureRscForCacheMetadata =
(options.isProduction || options.isPrerender === true) &&
(revalidateSeconds === null || (revalidateSeconds > 0 && revalidateSeconds !== Infinity)) &&
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The check revalidateSeconds !== Infinity prevents static pages (where revalidate = false in Next.js, which resolves to Infinity here) from being captured for the ISR cache during on-demand rendering. This is inconsistent with the change in packages/vinext/src/server/app-page-dispatch.ts at line 210, which now allows reading such pages from the cache. To ensure static pages can be both written to and read from the cache, this exclusion should be removed.

Suggested change
(revalidateSeconds === null || (revalidateSeconds > 0 && revalidateSeconds !== Infinity)) &&
(revalidateSeconds === null || revalidateSeconds > 0) &&

Comment on lines +641 to +643
const filteredHeaders = Array.from(request.headers.entries()).filter(
([key]) => !HEADER_BLOCKLIST.includes(key.toLowerCase()),
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The filteredHeaders array should be sorted by header name before being used in the cache key. request.headers.entries() does not guarantee a stable order, which can lead to different cache keys for identical requests if headers are added in a different sequence.

Suggested change
const filteredHeaders = Array.from(request.headers.entries()).filter(
([key]) => !HEADER_BLOCKLIST.includes(key.toLowerCase()),
);
const filteredHeaders = Array.from(request.headers.entries())
.filter(([key]) => !HEADER_BLOCKLIST.includes(key.toLowerCase()))
.sort(([a], [b]) => a.localeCompare(b));

@fengmk2 fengmk2 closed this May 9, 2026
@fengmk2 fengmk2 reopened this May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant