Upgrade to Next.js 16 with Turbopack and React 19#22
Merged
Conversation
- Upgrade Next.js from 14.2.5 to 16.1.4 - Upgrade React and React DOM from 18.3.1 to 19.2.3 - Upgrade ESLint from 8.57.0 to 9.0.0 for Next.js 16 compatibility - Enable Turbopack as default bundler (5-10x faster Fast Refresh, 2-5x faster builds) - Enable Turbopack filesystem caching for faster dev startup - Enable React Compiler for automatic memoization - Migrate middleware.js to proxy.ts per Next.js 16 conventions - Update test suite to reference new proxy.ts file - All 141 tests passing
- Add automated PR checks that run on pull requests to main - Run test suite (141 tests) to ensure code quality - Validate Docker build without pushing to registry - Run linter to catch code style issues - Use GitHub Actions cache for faster builds - Include coverage reporting to Codecov (non-blocking)
- Add 'needs: test' to docker-build job - Docker build now only runs after tests pass - Saves CI time by failing fast if tests fail
- Update existsSync mock to return false for 'secrets' directory - This allows mkdirSync to be called and mocked properly - Removes debugging code added by codemod that was masking the issue - All 141 tests now passing
- Replace HTML 'class' attributes with React 'className' in TokenManager - Fixes console error: Invalid DOM property 'class' - Affects <a> tag (line 215) and <i>/<code> tags (line 219)
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #18
Changes
Core Upgrades
New Features Enabled
middleware.jstoproxy.tsper Next.js 16 conventionsCI/CD Improvements
Performance Improvements
Before (Next.js 14.2.5):
After (Next.js 16.1.4 with Turbopack):
Testing
✅ All 141 tests passing across 13 test files
✅ Production build successful
✅ Dev server working with Turbopack
✅ Docker build validated
✅ Proxy/middleware authentication flow working correctly
Files Changed
.github/workflows/pr-checks.yml(new) - PR validation workflowproxy.ts(new) - Renamed from middleware.js with updated exportmiddleware.js(deleted) - Replaced by proxy.tsnext.config.mjs- Added React Compiler + Turbopack configpackage.json- Updated dependencies__tests__/middleware.test.mjs- Updated to test new proxy function__tests__/mam-token.test.mjs- Minor test improvement from codemodMigration Notes
No breaking changes for the application logic. The codebase was already using modern Next.js patterns (App Router, route handlers) which made the upgrade smooth. The only user-facing change is the performance improvement from Turbopack.