fix(config): match deprecation warning parity#2252
Conversation
|
/bigbonk review for issues |
commit: |
|
There was a problem hiding this comment.
/bigbonk review — PR #2252 (deprecation warning parity)
Verified the implementation against Next.js v16 source (packages/next/src/server/config.ts → checkDeprecations / warnOptionHasBeenDeprecated) and the target test test/e2e/deprecation-warnings/deprecation-warnings.test.ts. The five warnings, their exact message strings, the property-path traversal (!== undefined semantics including falsy values), and the no-config-file silence all match Next.js precisely. vp check and the focused tests pass. No blocking issues found — the notes below are non-blocking.
Non-blocking observations
1. warnConfigOnce dedup is process-global and never reset in tests (next-config.ts:829).
emittedConfigWarnings is a module-level Set with no test reset hook. The three new tests only stay independent because they happen to use different config filenames (next.config.js vs next.config.mjs), so the dedup keys differ. This is correct parity with Next.js Log.warnOnce (process-global), but the test isolation is incidental. If a future test resolves these deprecated options at the default cwd, run-order could suppress a warning and flake the "matches Next.js warnings" assertion. Consider exporting a reset helper for tests, or clearing the set in afterEach.
2. "matches Next.js warnings" test depends on repo cwd having no next.config.* (next-config.test.ts:64).
It calls resolveNextConfig(config) with the default root = process.cwd() and asserts the next.config.js filename. This passes today only because the vinext repo root has no next.config.* (verified). It would break if such a file were ever added at the root. Passing an explicit temp root (as the "warns once" test does) would make it robust.
3. Partial parity — only 5 of Next.js's deprecation warnings are implemented.
Next.js checkDeprecations also warns for experimental.after, experimental.rootParams, eslint, images.domains, i18n (App Router), and experimental.browserDebugInfoInTerminal. This PR scopes to the five the target test covers, which is fine, but the PR title ("match deprecation warning parity") is broader than the actual coverage. Worth a code comment or follow-up note that the list is intentionally partial.
4. filter-e2e-install-log.sh lifecycle state machine relies on pnpm output ordering (filter-e2e-install-log.sh:5-13).
in_lifecycle_script flips on at the first > pkg ... postinstall header and only flips off at Done in ... using pnpm vN. Two assumptions:
- If install fails before emitting the
Done in ...line (the deploy step tolerates a non-zero install via|| true),in_lifecycle_scriptstays1for the remainder and nodeprecated subdependencies/DEP0169 filtering happens. This fails open (keeps content), so it's safe but means the noise this PR targets could still leak in a failed-install run. - The design assumes pnpm prints its own
deprecated subdependencies found:summary after the finalDone inline, while application lifecycle output precedes it. That matches current pnpm behavior but is a heuristic that could break on a pnpm output-format change. Acceptable for an internal deploy-harness filter; just flagging the coupling.
5. Filter step has no || true under set -euo pipefail (e2e-deploy.sh:627).
Unlike the install (run_pnpm ... || true), the filter pipeline can now abort the whole deploy if awk/the redirect fails. Awk failure is unlikely and aborting on a genuine write error is arguably correct, but it's a slightly stricter failure surface than the previous direct >> append.
Verdict
Implementation faithfully reproduces the Next.js v16 behavior the target e2e test checks. The notes above are hardening/maintainability suggestions, not correctness blockers.
|
Review posted to PR #2252. SummaryI reviewed PR #2252 (deprecation warning parity), verifying the implementation against the Next.js v16 source ( Verdict: No blocking issues. The five warnings, exact message strings, Non-blocking findings posted:
All findings are hardening/maintainability suggestions, not correctness blockers — the implementation faithfully reproduces the Next.js behavior the target e2e test checks. |
Performance benchmarksCompared 4 improved · 0 regressed · 2 within ±1.5%
View detailed results and traces 🟢 improvement · 🔴 regression · ⚫ change below 1.5% · paired base/head |
|
/bigbonk review |
There was a problem hiding this comment.
/bigbonk review — PR #2252 (deprecation warning parity)
Independently verified the implementation against Next.js v16 source (packages/next/src/server/config.ts → warnOptionHasBeenDeprecated / checkDeprecations) and the target e2e test (test/e2e/deprecation-warnings/deprecation-warnings.test.ts). The five warnings, their exact message strings, the property-path traversal semantics, and the no-config silence all match Next.js. vp check is clean on the changed source and the focused suites pass (tests/next-config.test.ts, tests/check.test.ts, tests/e2e-deploy-script.test.ts — 347 tests).
Verdict: no blocking issues. This concurs with the earlier review on this PR. A few additional confirmations and one nuance below; all non-blocking.
Parity confirmations
hasConfigPropertyis safer than Next.js, not divergent. Next.js traverses withcurrent[key] !== undefinedand would throw on anullintermediate (e.g.experimental: null→null["instrumentationHook"]). vinext'sisUnknownRecord(current)guard returnsfalseinstead. Both reach "not found" for primitive/missing intermediates, and a config that crashes Next.js is not a behavior we need to reproduce. Leafnull/falsevalues warn in both (matching the e2e fixture'sinstrumentationHook: falseexpectation). Good.- Message strings match Next.js v16 exactly, including the
in ${configFileName}.suffix and the distinctinstrumentationHookphrasing. The e2e test only usestoContain, so the absence of Next.js's⚠Log.warnprefix on the bareconsole.warnoutput is immaterial to the target assertions. - Centralized in
resolveNextConfig, so dev/prod/Workers paths all inherit the same behavior — no parity gap across the four request-handling entries.
Non-blocking notes (concurring with the prior review)
emittedConfigWarningsis process-global with no test reset. The two newnext-config.test.tscases stay independent only because their messages differ byconfigFileName(next.config.jsvsnext.config.mjs), so the dedup keys differ. This is correct parity withLog.warnOnce, but a future test that resolves the same options at the default cwd could be order-suppressed and flake. An exported reset helper (orafterEachclear) would make isolation explicit.- The "matches Next.js warnings" test depends on the repo root having no
next.config.*. It assertsnext.config.jsas the filename via the defaultroot = process.cwd(). True today; would break if a root config were ever added. Passing an explicit temproot(as the "warns once" test does) would harden it. - Partial parity by design. Only 5 of Next.js's
checkDeprecationswarnings are implemented (omitsexperimental.after,rootParams,eslint,images.domains,i18n,browserDebugInfoInTerminal). This covers exactly what the target e2e test checks, which is fine, but the PR title is broader than coverage — a code comment noting the list is intentionally partial would help future readers. filter-e2e-install-log.shfails open on a failed install. Ifpnpm installerrors before emittingDone in … using pnpm vN,in_lifecycle_scriptstays1and nodeprecated subdependencies/DEP0169 filtering happens for the rest of the stream. Safe (keeps content) but means the targeted noise could still leak in a failed-install run. TheDone in … using pnpm v[0-9]anchor is also a heuristic coupled to current pnpm output formatting. Acceptable for an internal deploy-harness filter.- The filter pipeline has no
|| trueunderset -euo pipefail(e2e-deploy.sh:627), unlike the tolerated install (|| true). An awk/write failure would now abort the whole deploy. Awk failure is unlikely and aborting on a genuine write error is arguably correct, but it's a slightly stricter failure surface than the previous direct>>append.
Verdict
Faithfully reproduces the Next.js v16 behavior the target e2e test exercises. The notes above are hardening/maintainability suggestions, not correctness blockers.
|
Review posted to PR #2252. SummaryI independently reviewed PR #2252 (deprecation warning parity), verifying the implementation against the Next.js v16 source ( Verdict: No blocking issues. What I verified directly:
Non-blocking findings (concurring with the earlier review on this PR):
All are hardening/maintainability suggestions, not correctness blockers — the implementation faithfully reproduces the Next.js v16 behavior the target e2e test exercises. |
Summary
Log.warnOnceNext.js parity
Addresses the two failures in
test/e2e/deprecation-warnings/deprecation-warnings.test.tsfrom the latest deploy-suite report.Validation
vp checkvp run vinext#buildFull suites are deferred to CI.