Repository navigation
chore(deps): upgrade api to next@16.3.0 - #811
Conversation
Bumps next 16.0.10 -> 16.3.0 and react/react-dom 19.2.1 -> 19.2.8. 16.3 brings Turbopack disk caching for `next build`, memory eviction in dev, and native Node.js streams in the App Router render path. Also drops `eslint-config-next` (15.1.7). It is a dead dependency here: `eslint.config.js` builds its own flat config from @typescript-eslint, prettier, jsdoc and import, and never references the Next config or @next/eslint-plugin-next. Nothing but package.json mentioned it. Commits the `<!-- BEGIN:nextjs-agent-rules -->` block that `next dev` writes into AGENTS.md on 16.2+. It points agents at version-matched docs in node_modules/next/dist/docs/, and `next dev` re-adds it on every run, so committing it is what keeps the tree clean. Tracked in recoupable/app#1929.
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (5)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
There was a problem hiding this comment.
No issues found across 3 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Dev as Developer
participant CLI as next dev / next build
participant Agent as AI Agent Docs
participant Lint as ESLint Flat Config
participant TSC as TypeScript Compiler
participant App as App Router
participant NodeStream as Native Node.js Streams
participant Cache as Turbopack Disk Cache
Note over Dev,Cache: Runtime interactions after next@16.3.0 upgrade
Dev->>CLI: Run next dev
CLI->>Agent: NEW: Write agent rules block to AGENTS.md
Agent-->>CLI: Committed block keeps tree clean
Dev->>CLI: Run next build
CLI->>Cache: Use Turbopack disk cache
Cache-->>CLI: Reuse cached build artifacts
Dev->>Lint: Run pnpm lint:check
Lint->>Lint: Resolve from @typescript-eslint, prettier, jsdoc, import only
Note over Lint: eslint-config-next removed (was unused)
Dev->>TSC: Run pnpm exec tsc --noEmit
TSC->>TSC: 33 type errors fixed by react@19.2.8
alt Pre-existing errors in __tests__
TSC->>TSC: 203 drift errors remain (out of scope)
end
CLI->>App: Serve requests
App->>NodeStream: NEW: Use native Node.js streams
Note over App,NodeStream: ~22% more requests under load
App->>Cache: Cache rendered pages
Cache-->>App: Up to 90% less dev-server memory
Auto-approved: Focused dependency upgrade (next 16.0.10→16.3.0, react 19.2.1→19.2.8) with no application code changes; tests and lint pass; unused dependency removed. No operational or behavioral tradeoff to decide.
Re-trigger cubic
Preview verification: ❌ deployment failed — and I got the cause wrong in the PR body aboveCorrecting the claim I made when opening this: I wrote that What actually happens
Preview deployment Verified locally by reinstalling Root causeNext.js 16.3 changed the default type checker. Per
So the 203 errors are pre-existing (they reproduce under They are all fixture drift in test files, not app code: Why this was invisible until nowNone of the last 40 merged PRs in this repo touched Not resolving this unilaterallyThere are two defensible fixes and they differ by an order of magnitude in cost, so I am leaving this PR as-is pending a call:
Marking this draft until that is decided. |
Next 16.3 switched the default type checker to the project-local `tsc` CLI. Per the useTypeScriptCli docs it checks "the complete project selected by the configured tsconfig file ... including test files", where 16.0's compiler-API checker narrowed the set to app code. tsconfig.json is `"include": ["**/*.ts"]`, so every __tests__ file entered the build's type check for the first time and 203 pre-existing fixture errors failed the build and the preview deploy. They are not regressions: on main with 16.0.10 reinstalled and a cold tsbuildinfo, `next build` emits 0 error TS lines, and this bump introduces 0 new errors while fixing 33 of them. Points the build at a tsconfig.build.json that excludes test files, so the build checks what it checked before. This is scoping, not silencing -- `pnpm exec tsc --noEmit` still uses the root tsconfig and still reports all 203, which is where the burn-down will happen. Verified: build compiles and type-checks with 0 errors, then stops at `STRIPE_SK environment variable is required` collecting page data, which is the same point main reaches locally. tsc --noEmit still reports 203. Tests 797/797 files, 4329/4329.
Preview verification: ✅ greenBlocker resolved by scoping the build's type check back to app code ( Build
That last row is the point: the errors are scoped out of the build, not out of existence. Locally the build now compiles, type-checks clean, and stops at Live checks against the preview
Check 5 matters most: the x402 payment middleware still works on 16.3, returning the challenge with the right price ( No secret or env value appears in any response body or header. Suite
Marking ready for review. |
There was a problem hiding this comment.
1 issue found across 5 files
Confidence score: 3/5
- In
tsconfig.build.json, excluding tests from the build-time type check can hide fixture drift and test/type regressions that Next 16.3 correctly surfaced, increasing the chance of shipping mismatched assumptions that fail later in CI or runtime-like environments — restore test coverage in type-checking (or add an equivalent dedicated test tsconfig check in CI) before relying on this build config.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="tsconfig.build.json">
<violation number="1" location="tsconfig.build.json:15">
P2: This new build-only tsconfig permanently removes the entire test suite from the production build's type check. The PR confirms that is exactly the 203-error 'fixture drift' that Next 16.3's build check surfaced, so after this change `next build` will go green while `tsc --noEmit` and the IDE keep reporting the same 203 diagnostics. That creates a confusing, durable two-standard signal (build green !== type-clean) and lets test/fixture type-drift silently accumulate again — the same class of undetected drift this upgrade was meant to surface. Consider fixing the underlying 203 errors rather than permanently excluding them, or at minimum narrowing the exclusion to the fixture files, and adding a build/CI invariant that guards against the two tsconfigs diverging.</violation>
</file>
Architecture diagram
sequenceDiagram
participant TS as tsconfig.json
participant Build as tsconfig.build.json
participant Next as next.config.ts
participant BuildCLI as next build
participant TSC as tsc CLI
participant TestFiles as **/__tests__/**
participant AppCode as src/** app code
Note over Next,BuildCLI: Already-existing production build path (unchanged)
Next->>BuildCLI: NEW: typescript.tsconfigPath = "tsconfig.build.json"
BuildCLI->>Build: Read build-specific tsconfig
alt With tsconfig.build.json
Build->>Build: Extends tsconfig.json
Build->>Build: Excludes __tests__ and *.test.ts
Build-->>TSC: Only app code paths
TSC->>AppCode: Type-check app source only
AppCode-->>TSC: Type errors (pass/fail)
TSC-->>BuildCLI: Compilation result
BuildCLI-->>Next: Success/failure
else Without tsconfig.build.json (default)
Note over TSC,TestFiles: This is what 16.3 would do unconfigured
BuildCLI->>TSC: Default: project-local tsc CLI
TSC->>TS: Read root tsconfig.json
TS->>TSC: include: ["**/*.ts", ...]
TSC->>TestFiles: Also type-checks test files
TSC->>AppCode: Type-checks app code
TestFiles-->>TSC: 203 pre-existing fixture errors
TSC-->>BuildCLI: Fail (203 errors)
BuildCLI-->>Next: Build failure
end
Note over Next,BuildCLI: tsc --noEmit (CI / local dev) unchanged
Note over TS,TSC: Still uses root tsconfig.json -- reports all 203 errors
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| "See recoupable/chat#1929." | ||
| ], | ||
| "extends": "./tsconfig.json", | ||
| "exclude": ["node_modules", "**/__tests__/**", "**/*.test.ts"] |
There was a problem hiding this comment.
P2: This new build-only tsconfig permanently removes the entire test suite from the production build's type check. The PR confirms that is exactly the 203-error 'fixture drift' that Next 16.3's build check surfaced, so after this change next build will go green while tsc --noEmit and the IDE keep reporting the same 203 diagnostics. That creates a confusing, durable two-standard signal (build green !== type-clean) and lets test/fixture type-drift silently accumulate again — the same class of undetected drift this upgrade was meant to surface. Consider fixing the underlying 203 errors rather than permanently excluding them, or at minimum narrowing the exclusion to the fixture files, and adding a build/CI invariant that guards against the two tsconfigs diverging.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tsconfig.build.json, line 15:
<comment>This new build-only tsconfig permanently removes the entire test suite from the production build's type check. The PR confirms that is exactly the 203-error 'fixture drift' that Next 16.3's build check surfaced, so after this change `next build` will go green while `tsc --noEmit` and the IDE keep reporting the same 203 diagnostics. That creates a confusing, durable two-standard signal (build green !== type-clean) and lets test/fixture type-drift silently accumulate again — the same class of undetected drift this upgrade was meant to surface. Consider fixing the underlying 203 errors rather than permanently excluding them, or at minimum narrowing the exclusion to the fixture files, and adding a build/CI invariant that guards against the two tsconfigs diverging.</comment>
<file context>
@@ -0,0 +1,16 @@
+ "See recoupable/chat#1929."
+ ],
+ "extends": "./tsconfig.json",
+ "exclude": ["node_modules", "**/__tests__/**", "**/*.test.ts"]
+}
</file context>
Dismissed because Cubic found issues in a newer review.
Authenticated preview testing: ✅ all greenFollow-up to the earlier unauthenticated pass — this one exercises the authenticated surface, mutations, and framework-level behaviour. Preview: https://api-n9csksfau-recoup.vercel.app A prod curl -sX POST "$PREVIEW/api/agents/signup" -H 'Content-Type: application/json' \
-d '{"email":"agent+<ts>-<rand>@recoupable.com"}' # → 200, account ccd69ed8…1. Authenticated happy path
2. Async dynamic params + full CRUD round-tripThis is the surface most likely to break on a Next 16.x bump (
Create → read → update → verify → delete all work through 3. Deliberate bad input, sent with a valid keyRe-run with credentials so these test body/query validation rather than just tripping the auth gate:
4. Framework-level surfaces
5. Preview vs production differentialSame requests against prod (still on
Two things I initially recorded as failures and then disproved rather than reporting:
Not covered
Both are worth an eye during merge, since neither is exercised here. CleanupTest artist deleted, Nothing in this PR changes runtime behaviour — it is a version bump plus a build-time type-check scope — and the preview bears that out across auth, CRUD, validation, CORS, and MCP. |
Part of recoupable/app#1929 (PR 1 of 8). This is the fleet's canary:
apiis the only one of the three frontends that needs no lint or build-system work first, so it isolates "does 16.3 break us" from "is our tooling broken."What changed
next16.0.10→16.3.0,react/react-dom19.2.1→19.2.8(16.3 release notes).eslint-config-next@15.1.7. It was dead weight, not something to upgrade:eslint.config.jsbuilds its own flat config out of@typescript-eslint,prettier,jsdoc, andimport, and never extends the Next config or loads@next/eslint-plugin-next. The only mention anywhere in the repo was thepackage.jsonline this PR deletes.<!-- BEGIN:nextjs-agent-rules -->block thatnext devwrites intoAGENTS.mdon Next 16.2+. Per the upgrade guide,next devre-adds it on every run, so committing it is what keeps the tree clean.What we get for free, with no application code changes: Turbopack disk caching for
next build, up to 90% less dev-server memory, and native Node.js streams in the App Router render path (~22% more requests under load per Vercel's benchmarks).Verification
16.0.10)16.3.0)pnpm testpnpm lint:checkeslint-disabledirectives)pnpm exec tsc --noEmitnext buildtype checkstate=failureThe blocker. 16.3 changes the default type checker to the project-local
tscCLI, which peruseTypeScriptClichecks "the complete project selected by the configuredtsconfigfile […] including test files."tsconfig.jsonhere is"include": ["**/*.ts", ...], so every__tests__/**file is now in the build's type check for the first time. The errors are pre-existing fixture drift, not regressions — normalized tofile(line,col): error TSxxxx, this bump introduces 0 new ones and fixes 33.Two ways forward, costed very differently — see the diagnosis comment for the options. Holding here rather than picking one unilaterally, since it sets this repo's type-checking posture.
Notes
pnpm addreportsx402-next@0.7.3has an unmet peernext@^15.0.0. This is not new — that peer was already unmet on16.0.10, since the package pins the v15 major. Flagging it because the last PR in this fleet renamesmiddleware.ts→proxy.ts, which touches the same x402 payment path.next devon this branch emits⚠ The "middleware" file convention is deprecated. Please use "proxy" instead.Tracked separately in chat#1929, sequenced last because it is the only change in the fleet touching a live payment path.apihas no build workflow in CI (format.yml,lint.yml,test.ymlonly), and none of the last 40 merged PRs touchedpackage.json— which is how the type drift accumulated unnoticed.🤖 Generated with Claude Code