Repository navigation
fix(vite): keep no-fallthrough public dir base and HEAD in sync with dev app routes - #4737
Conversation
…dev app routes `hasRoute` no longer claims the bare base of a no-fallthrough public dir (same as production) and falls back from HEAD to GET like h3.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (4)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review. 📝 WalkthroughWalkthroughNitroDevApp changes public-asset route registration and method matching. Unit tests cover handler, proxy, and asset route recognition. Vite tests cover public-asset base-path responses and missing assets. The dev-routing documentation updates route and dispatch descriptions. ChangesVite dev-app routing
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to The routing changes and accompanying tests present no identified blocker; merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change adjusts development-server routing without adding handlers, proxy destinations, or privileges. Reviewed paths preserve explicit-route precedence and final missing-asset responses. Remaining uncertainty concerns underlying router semantics that were not independently exercised. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
commit: |
Follow-up to #4736 (#4735), from review findings.
hasRouterecorded no-fallthrough public dirs as<base>/**, which also matches/puband/pub/. Those became a final 404 in Vite dev, while production (and dev before refactor(vite): useNitroDevApproutes to route dev requests before vite #4736) passes them on to the app, e.g. an SSR page at/docsnext to a/docspublic dir. Now recorded as<base>/:path+, so only paths below the dir match. Root public dirs are skipped explicitly.hasRoutenow falls back fromHEADtoGET, matching h3's route lookup, so it agrees with what the dev app actually serves.NitroDevApp.hasRoute(bothbaseURLs: methods, HEAD, proxies, middleware and root catch-all skipping, public dirs). E2E test for/puband/pub/page navigations under bothbaseURLs, and the missing-asset 404 case now also asserts the response isn't HTML. 6 of the new cases fail without the fix..agents/vite-dev.mdupdated forhasRoute.🤖 Generated with AI assistant