next.js
7a801959 - Update routes generation for build-complete (#85017)

Commit
90 days ago
Update routes generation for build-complete (#85017) ## Summary - Adds comprehensive route generation and normalization for build-complete adapter hooks - Enhances adapter output types with additional metadata fields (`sourcePage`, `wasmAssets`, `pprChain`, `parentFallbackMode`) - Improves middleware matcher handling and revalidation bypass logic - Adds proper tracing for shared node dependencies across pages and app router modules - Includes `buildId` in adapter context for build identification ## Changes ### Route Generation - Generates complete route manifests with processed regex patterns for headers, redirects, rewrites, and dynamic routes - Converts routes using `@vercel/routing-utils` for consistent formatting - Handles RSC routes (`.rsc` suffix) for app router pages - Supports i18n locale-specific routes and data routes (`/_next/data/[buildId]/...`) - Properly handles static pages with mixed app/pages router setups ### Adapter Output Enhancements - Added `sourcePage` field to all route outputs for tracking original source files - Added `wasmAssets` support for bundled WebAssembly files - Added `pprChain` and `parentFallbackMode` to prerender outputs for PPR support - Enhanced middleware matchers to include processed source and regex patterns - Improved traced assets handling with separate tracking for pages vs app router modules ### Middleware & Revalidation - Standardized middleware matcher format with `source`, `sourceRegex`, `has`, and `missing` fields - Automatically adds `x-prerender-revalidate` header bypass to middleware matchers - Fixed middleware pathname to always be `/_middleware` for consistency ### Asset Tracing - Traces shared node dependencies for bootstrapping (node-environment, require-hook, etc.) - Separate tracing for pages router and app router module contexts - Improved trace ignores for unnecessary files (dev builds, webpack internals, etc.) - Better handling of instrumentation hook assets ### Bug Fixes - Fixed RSC fallback handling for mixed app/pages router builds - Improved 404/500 static page detection with locale support - Better basePath normalization with trailing slash handling - Fixed data route generation for getServerSideProps pages with i18n
Author
Parents
Loading