[pull] canary from vercel:canary - #1412
Merged
Merged
Conversation
### Fixing a bug Nothing reads the two fields `hasWarnings` and `warnings` on `TypeCheckResult`. `verifyAndRunTypeScript` has four callers: - `build/type-check.ts` only reads `inputFilesCount`, `totalFilesCount` and `incremental` - `next-test` only reads `version` - `setup-dev-bundler` only reads `version` - `next-typegen` throws the result away `warnings` is also always empty. It looks for diagnostics with the `Warning` category, but I checked, and TypeScript 6.0.2 has no messages in that category. Deprecation messages use `Suggestion` instead. So on every build, we filtered and formatted every diagnostic to build a list that was always empty, and that nobody read. So I'm suggesting removing it instead, as it is clearly not being used. I also checked the GitHub code search across all public repositories and couldn't find anyone using either of them. That aside, it also never really worked correctly, as it would always return `hasWarnings: true` even if `warnings` was empty. No test added since the fields are being removed. Also since this is such a small change I didn't create an issue to link here, I'd be happy to file one if you prefer me to. Thanks for the hard work and taking the time for reviewing this PR! 😊
## Summary Use structural React keys during server rendering so an HTML prerender can resume without rewriting React's postponed state when route params become known. Browser keys and router-cache identity are unchanged. For example, `/products/[slug]` previously prerendered layout boundaries with a key containing an opaque slug placeholder. Resuming `/products/shoe` produced a different key, so Next.js substituted `shoe` into the serialized React state before handing it back to React. Both server passes now use `slug|d`. The browser still uses `slug|shoe|d`, preserving template remounts and back/forward state behavior. The server only renders the active entry at each layout-router position, so it does not need parameter values to distinguish cached browser entries. React keys are not embedded in the HTML; hydration derives its concrete keys from the request's route state. - Use segment name/type for server layout keys and structural route paths for the server head key. Server keys always omit search params. The existing browser-module variant mechanism selects the concrete key implementation for browser bundles in both Webpack and Turbopack. - Remove placeholder substitution and the request-params argument from postponed-state parsing. Persist only fallback param names for render staging; React's postponed state no longer needs to be searched or rewritten. - Simplify the remaining opaque fallback map to param name → placeholder. Its dynamic-param type slot is unused after removing interpolation. Parameter wrappers still control suspension; this does not make unknown params available to application code. - Test server and browser keys directly, including catch-all/intercepted segments and search params. Update the action-only resume fixture's single assertion on the resume-metadata format so its three cases reach their behavioral checks for action execution, revalidation, and `notFound()` with names-only metadata. This refactor is independently landable against `canary` and is now the base of the parameter-matching stack: #98944 → #98891 → #98892 → #98893 → #97393. It supersedes #98890. It retains internal opaque placeholders but removes their role in matching React's postponed state. No new integration fixtures are needed. ## Verification Latest cleanup: - 126 focused unit tests and 4 snapshots pass in both default and Cache Components/Webpack configurations. - 34 production Webpack tests pass across `fallback-shells`, `partial-fallback-shell-upgrade`, `action-only-fallback-resume-data-cache`, and `resuming-head-runtime-search-param`; 4 existing tests remain skipped. The three action-only resume cases now reach and pass their behavioral assertions. Earlier commits also passed existing production and dev Webpack coverage for back/forward state, template remounts, base-path params, nested/parallel/intercepted routes, form-state hydration, and standalone/edge output. A reviewer verified this head under Turbopack using a native binary built from the same commit: a broader unit selection passed (144 tests, the focused set above plus the remaining router-reducer suites), the `packages/next` type check was clean, and 33 production e2e tests passed across `fallback-shells`, `partial-fallback-shell-upgrade`, and `action-only-fallback-resume-data-cache`. <!-- 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 : )