Repository navigation
[pull] canary from vercel:canary - #2100
Merged
Merged
Conversation
## Summary Metadata files such as `app/icon.tsx` export a default handler, rather than HTTP methods. Validating them as ordinary route handlers rejects the documented `size` and `contentType` exports with TS2559 during `next typegen` + `tsc`. Exclude metadata files from ordinary route-handler validation in both validator modes by matching the `route.<extension>` file convention, including custom page extensions. Add an icon fixture with the documented exports and a regression test that checks generated validation, retains an ordinary route-handler control, and runs `tsc`. Correct the existing non-strict invalid-page-props assertion as well. The same failure reproduces on the unchanged base commit: non-strict `AppPageConfig` accepts arbitrary props, so the per-page check emits the invalid-props diagnostic instead. The test still requires a failed build and the specific invalid-props error; strict mode retains its `AppPageConfig` assertion. ## Verification - Reproduced the stale assertion on unchanged base commit `3932a6bd516`: 12/13 tests passed, with only invalid-page-props failing. - Full Webpack validator suite: **14/14 passed** in normal mode and **14/14 passed** with `__NEXT_EXPERIMENTAL_STRICT_ROUTE_TYPES=true`. Both runs include the icon regression and invalid ordinary-handler checks. - Core Next.js build (including types), formatting, and ESLint passed. - Direct before/after checks verified that both generators exclude metadata files while retaining ordinary and custom-extension route handlers. - Tests use `NEXT_SKIP_ISOLATE=1` because the isolated install cannot resolve the configured package registry. Full bootstrap in the temporary worktree hit environment restrictions; the core package build passed. <!-- NEXT_JS_LLM -->
Static metadata files nested under dynamic routes use placeholder paths with empty params. The build treats those routes as missing `generateStaticParams()`, which breaks adapter deployments. This is a temporary hotfix, will follow up with better refactor of the handling
We weren't running the use-cache/resume-data-cache test suites in PPF. some of the tests fail due to the bug that is fixed in #98005 (although interestingly the fetch-cache tests only fail in deploy mode, because in `next start` we heal a bad RDC using outputs from `.next/cache/fetch-cache`). a bunch of refactoring was needed (some tests were producing false negatives, flakily), so i split this into a separate PR to confirm behavior before/after the fix. ### `use-cache.test.ts` - I've refactored the tests to use timestamps and be a bit more debuggable. previously, they'd fail with a hydration error, and it was hard to pinpoint the cause. including a name lets us know which cache was mismatched, and assert that the values of the cache are consistent across the HTML shell / resume. - the tests for exluded caches now include more complete assertions on what content is and isn't included in the HTML shell ### `resume-data-cache.test.ts` This one needed quite a bit of work: - The `use cache` and `fetch cache` tests were not independent. they both used the same page and revalidated the same tag, which means that a revalidation from the first test affected the outcome of the second test. i've split them into two separate pages with two separate tags to make the behavior consistent. - Multiple tests fetched the same URL (with `fetch(..., { cache: 'force-cache' }`), which made them interfere with each other's fetch caches. the URLs are now different so the tests are actually independent - Some cache values are now tagged with a name and timestamp. The name is used for asserting consistency, the timestamp is for improved debuggability (provides ordering) - The action revalidation tests weren't checking what the value from the build-time prerender was actually supposed to be, so they were passing even if the build-time RDC was not used at all - The tests that use `browser()` now assert that there should be no hydration warning, which can happen due to the PPF bug (due to inconsistent cache values across HTML shell/resume) - **the revalidation assertions are very flaky in deploy**, and i've had to disable them to avoid introducing a test that fails often. i'm not sure how they were passing before.
Closes NAR-954 In Partial Prefetching, the embedded runtime stream codepath awas accidentally dropping the RDC. This PR fixes this by prefilling the mutable cache from the RDC. we ungate the failing tests introduced in #99417 and add some more e2e ones. As a drive-by improvement, i've also moved the `cacheReady()` call to happen after the main render runs through all the stages. It's pretty strange to call `cacheReady()` before we've even started the render that might fill any caches. I'm guessing it works because the code in-between runs quickly enough, but it's still a potential race and we shouldn't do it. ### How this bug got introduced In #94194 we accidentally started clobbering the resume data cache in the `cachedNavigations` codepath (i.e. when rendering the embedded runtime prefetch stream). This assignment used to be non-destructive because `prerenderResumeDataCache` was separate: https://github.com/vercel/next.js/blob/b0420899b68a4f7506fdbc93ff5acf6edcfa3d3c/packages/next/src/server/app-render/app-render.tsx#L969-L972 But after unifying `prerenderResumeDataCache` and `renderResumeDataCache`, we started essentially dropping the RDC and using an empty one https://github.com/vercel/next.js/blob/8c661813a1e66cd85b795e3aeae0f04ae3e3201e/packages/next/src/server/app-render/app-render.tsx#L970-L973 This wasn't caught because the tests that checked RDC behavior weren't exercising this codepath (at the time: no `cachedNavigations` + runtime prefetch opt in, and later on no `partialPrefetching` opt in)
Runtime shell prefetch requests were ignoring the provided RDC. I'm not sure what the history was, i.e. whether this was introduced when unifying RDCs like #98005 or if it was like that from the start, but this PR fixes it. (the added tests were failing before the fix)
## Summary Image helpers and components sort arrays from their configuration, which fails when that configuration comes from a frozen deployment manifest. Prepare owned image options once and reuse them across rendering and `getImageProps`. This supports immutable Next.js configuration in Vercel adapter deployments. Modern and legacy Image components share a `useImageConfig` hook that preserves existing configuration selection and SSR `localPatterns` validation. `getImageProps` prepares its fixed options once at module initialization without context. ## Verification Existing local-pattern, query-string validation, and custom-loader production fixtures pass with Webpack and Turbopack. Development checks cover local patterns, legacy remote-image rejection, and the static-export diagnostic with both bundlers. <!-- NEXT_JS_LLM -->
The existing `image-from-node-modules` fixture renders `next/image` when Next.js prerenders its static page. It does not render the external image component during an SSR request, when an adapter deployment loads image configuration from the frozen `required-server-files.json` manifest. This change adds a `getServerSideProps` route, keeps `my-cool-image` external, and configures two `images.deviceSizes`. Before #99394, the adapter deployment fails when `next/image` sorts the frozen manifest configuration.
## Summary Continue removing request-event dependencies from App Router rendering. The request body's `end` event is not a render-completion signal and may already have fired before a custom server invokes Next. Keep the dev indicator Pending until HTML or Flight output completes, then classify from render-phase dynamic API usage and route configuration, including usage discovered during Client Component SSR. Completion handling stays local and dev-only, without shared lifecycle callbacks or stream helper APIs. Actions and prefetches do not reclassify the page. HEAD requests preserve the last completed classification because their output is not consumed. Pages Router and Cache Components behavior is unchanged. ## Verification - Gated browser regressions fail before the change and pass afterward, including a Client Component that calls `unstable_noStore()` after suspending during SSR. - All 21 dev-indicator tests pass in each combination of Turbopack/Webpack and Cache Components on/off. - Isolated `pnpm test-start-webpack test/e2e/app-dir/app/standalone.test.ts` passes (2/2). <!-- NEXT_JS_LLM -->
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )