mirror of
https://github.com/cloudflare/vinext.git
synced 2026-05-09 08:25:34 +02:00
[GH-ISSUE #437] perf: cache startup filesystem scans, optimize base64 and path normalization #94
Labels
No labels
enhancement
enhancement
good first issue
help wanted
nextjs-tracking
nextjs-tracking
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vinext#94
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Divkix on GitHub (Mar 11, 2026).
Original GitHub issue: https://github.com/cloudflare/vinext/issues/437
Problem
Several hot paths in vinext perform redundant work:
hasMdxFiles()recursively walksapp/andpages/viafs.readdirSync()on everyconfig()hook invocation (fires 3+ times per Vite environment: RSC/SSR/Client)resolvePostcssStringPlugins()probes 17 PostCSS config file candidates withfs.existsSync()on everyconfig()hook invocation, with no cachingString.fromCharCode/charCodeAtloops for base64 encode/decode instead ofBufferAPIsSolution
hasMdxFiles()andresolvePostcssStringPlugins()results per root directoryBuffer.from().toString("base64")/Buffer.from(str, "base64")nodeToWebRequest()so the RSC handler hits the fast pathPR
#436