Skip to content

Upgrade Next.js to 16.4 and enable compiler and tooling features - #137

Merged
abhi1693 merged 3 commits into
masterfrom
upgrade/next-16.4
Oct 8, 2026
Merged

abhi1693 merged 3 commits into
masterfrom
upgrade/next-16.4

Conversation

@abhi1693

@abhi1693 abhi1693 commented Oct 8, 2026 •

Copy link
Copy Markdown
Owner

What changes and why?

Upgrade the reader and admin apps from Next.js 16.3.8 to 16.4.0 and align ESLint and the shared telemetry peer dependency. React already uses 19.3.0.

Enable the Rust React Compiler, Turbopack cache garbage collection, lazy client dynamic imports, worker-thread plugin execution, and latest-release upgrade reminders in both apps. Add bundle-analysis commands with snapshot support and document the configuration.

Keep Cache Components and Partial Prefetching disabled because the apps use per-request CSP nonces, which are incompatible with static shells. Add browser regression checks for fresh nonces on successive page loads and matching nonces on executable scripts. Include the Next.js-generated agent guidance.

Lockfile regeneration exposed vulnerable browser-tooling copies of basic-ftp; extend the existing 6.2.2 override across the workspace to keep the dependency audit clean.

Release reference: https://nextjs.org/blog/next-16-4
CSP compatibility: https://nextjs.org/docs/app/guides/content-security-policy

Validation

  • Clean npm ci and dependency audit: passed, zero vulnerabilities.
  • Web and admin production builds, formatting, ESLint, and TypeScript: passed.
  • Web unit tests: 1,171 passed; admin unit tests: 657 passed. Initial concurrent runs hit timeouts; complete reruns with two workers passed.
  • Web reader and admin overview production-browser suites: passed, including nonce CSP regression checks.
  • Chrome and Edge: type check, 29 unit tests, both builds, and all five browser tests for each browser passed.
  • Web and admin development login smoke checks: HTTP 200 with nonce CSP.
  • Both bundle analyzers: offline reports and named snapshots generated successfully.
  • Workspace version check, dependency-security tests, and Codex transport test: passed.
  • No intended visual changes. Browser screenshots remain in ignored local reports/build output.
  • Sonar coverage normalization and classification regression tests: 96 passed. The nonce checker is classified as a browser test, and its extra navigations run after overview request measurements.
  • Remote CI required and CodeQL checks are pending. Backend integration tests and container/ARM64 verification were not run locally.

Rollout notes

The compiler and Turbopack options are experimental and were verified locally on Node.js 22.23.2. Next.js may fall back to child processes on affected Node.js versions. Keep the per-request rendering and CSP model when deploying this upgrade.

This PR does not deploy the website or submit extension packages to either store. Container and ARM64 checks must pass in CI before merge.

Ready for review

  • The description explains the change and the validation results, including any gaps.
  • Relevant documentation and regression tests are updated, or the description explains why they aren't needed.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

PR reader API performance

Result: INCONCLUSIVE

8 inconclusive. Zero request failures across all six runs.

Base b302fc8849b2ccdc5b29efe9bb82718bb28e2380 → PR 7451938991a996185ffd9a1daba586e7faa52fa3

Three independent runs per revision, each on a fresh GitHub-hosted ARM64 runner. 16 users, 60 seconds/run, 1,000 synthetic articles, cache off, five PgBouncer slots.

Latency comparison

All latency values are in milliseconds; lower is better. Values are medians of three runs.

Route Base p95 PR p95 Change Result
All requests 100 120 +20 (+20.0%) Inconclusive
Latest feed 130 150 +20 (+15.4%) Inconclusive
Feed pagination 93 99 +6 (+6.5%) Inconclusive
Article detail 85 90 +5 (+5.9%) Inconclusive
Source feed 91 110 +19 (+20.9%) Inconclusive
Topic feed 91 110 +19 (+20.9%) Inconclusive
Feed filters 69 99 +30 (+43.5%) Inconclusive
Sources 39 43 +4 (+10.3%) Inconclusive
Topics 46 77 +31 (+67.4%) Inconclusive
Additional latency and throughput metrics

Each cell shows base → PR. Latencies are in milliseconds.

Endpoint p50 p99 Requests/s
Aggregated 28 → 33 150 → 170 30.33 → 29.65
/v1/feed [latest] 46 → 50 170 → 190 8.74 → 8.60
/v1/feed [page] 27 → 29 120 → 180 3.82 → 3.54
/v1/articles/[id] 18 → 19 130 → 120 6.33 → 5.87
/v1/feed [source] 30 → 30 150 → 140 1.71 → 1.91
/v1/feed [topic] 28 → 30 140 → 170 1.93 → 1.77
/v1/feed/options 22 → 23 110 → 130 2.53 → 2.51
/v1/sources 12 → 12 79 → 110 2.53 → 2.51
/v1/topics 13 → 14 89 → 110 2.53 → 2.51
Individual runs
Run Requests Failures Exit code
Base 1 1754 0 0
Base 2 1701 0 0
Base 3 1644 0 0
PR 1 1675 0 0
PR 2 1673 0 0
PR 3 1653 0 0
How to interpret this report

Regressed / Improved: a p95 regression needs >20% and >20 ms increase in the medians and at least two head samples versus the base median. Improvements use the inverse threshold. Within threshold means the change did not meet both thresholds.

Inconclusive: a within-revision p95 range >35% of its median and >20 ms is too noisy for a confident latency verdict.

Inconclusive latency comparisons are non-blocking: the check passes without claiming an improvement. Confirmed regressions and test/report errors fail the PR gate. Throughput is descriptive: paced users do not measure maximum capacity. This uncached public API test does not establish production health, browser performance or worker capacity. Separate runners can differ in hardware or host load; repetitions and noise checks reduce but cannot eliminate that uncertainty.

Full HTML/CSV reports and logs · attempt 1

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Backend unit coverage

PASS · minimum combined coverage 67.60%.

Tests: 3509 passed, 0 failed, 0 skipped. Source files: 276.

Workspace Lines Branches Combined
All backend code 72.17% 54.31% 68.33%
apps/admin-api 65.12% 36.07% 60.29%
apps/aggregator 73.94% 57.18% 70.13%
apps/api 72.77% 58.45% 70.13%
apps/article-enrichment-worker 80.00% 50.00% 71.43%
apps/cli 68.76% 42.93% 64.81%
apps/images-worker 80.00% 50.00% 71.43%
apps/mcp 82.99% 73.88% 81.28%
apps/notifications 83.33% 76.67% 81.75%
apps/search-indexer 85.48% 85.71% 85.53%
apps/source-discovery-worker 80.00% 50.00% 71.43%
apps/user-api 59.37% 33.33% 54.50%
packages/core 74.09% 57.12% 70.06%
packages/http 94.94% 87.77% 93.29%

Unit coverage includes every backend workspace. PostgreSQL/Redis integration tests run separately.

Commit: 7451938 · HTML, JSON, XML reports and job logs · attempt 1

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

Lighthouse · ⚠️ Targets exceeded

⚠️ 3 target warnings · Bold values need attention.

Page FCP LCP CLS TBT JS Total
Latest (/latest) 1.07 s 2.72 s 0.001 96 ms 264 KiB 542 KiB
Article preview (/articles/…) 1.07 s 2.74 s 0.005 134 ms 269 KiB 560 KiB
Topics (/topics) 1.07 s 2.42 s 0.000 34 ms 240 KiB 371 KiB
Sources (/sources) 1.07 s 2.61 s 0.000 44 ms 278 KiB 409 KiB
Public profile (/users/…) 1.07 s 2.30 s 0.000 32 ms 230 KiB 336 KiB
Leaderboard (/leaderboard) 0.91 s 2.06 s 0.000 58 ms 196 KiB 287 KiB

Mobile reader · Three cold loads per page · Median timings · Largest transfer size.

Needs attention

Page Finding Measured Target / limit
Latest (/latest) ⚠️ Target · LCP 2.72 s 2.50 s
Article preview (/articles/…) ⚠️ Target · LCP 2.74 s 2.50 s
Sources (/sources) ⚠️ Target · LCP 2.61 s 2.50 s

Full reports and logs · 7451938 · Attempt 1

@gitar-bot

gitar-bot Bot commented Oct 8, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

🟡 Medium risk · Enabling the React Compiler and worker-thread plugin execution in both apps could alter rendering or build behavior and cause regressions.

Upgrades Next.js to 16.4.0 and enables Rust React Compiler, Turbopack cache garbage collection, lazy client dynamic imports, and worker-thread plugin execution. Includes CSP nonce regression checks and bundle-analysis commands; keeps Cache Components and Partial Prefetching disabled due to per-request nonce incompatibility. All builds, tests, and browser checks passed. No issues found.

Review coverage

📋 Rules No rules evaluated

🧪 Functional validation Not enabled · Set up

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud

sonarqubecloud Bot commented Oct 8, 2026

Copy link
Copy Markdown

@abhi1693
abhi1693 merged commit 0783fbe into master Oct 8, 2026
67 checks passed
@abhi1693
abhi1693 deleted the upgrade/next-16.4 branch October 8, 2026 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant