Migrate from Vite to Next.js 16 App Router#2
Merged
Merged
Conversation
- Replace Vite + React 19 with Next.js 16 / React 19 / Tailwind 4 stack - Move src/main.jsx + src/App.jsx into App Router app/layout.tsx and app/page.jsx - Add @policyengine/ui-kit ^0.9.0 with Tailwind v4 globals - Wire MantineProvider + ColorSchemeScript into the root layout - Replace import.meta.env.BASE_URL with absolute path for google-ads.json - Drop legacy ESLint react-refresh disable comments now that the config is Next-flat - Switch CI to PolicyEngine bun + frozen-lockfile build/test/lint pattern - Add vercel.json for nextjs framework Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The imports from 'eslint/config' don't exist in the standard ESLint package. Use the standard flat config array syntax instead. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Next.js requires jsx: 'preserve' to properly handle JSX transformation through its own compiler. Using 'react-jsx' can cause build issues. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Nice work on the Vite to Next.js migration! I found and fixed two configuration issues:
Fixed:
- eslint.config.mjs - Removed invalid
defineConfigandglobalIgnoresimports from 'eslint/config' that don't exist in the standard ESLint package. Converted to standard flat config array syntax. - tsconfig.json - Changed
jsxfrom 'react-jsx' to 'preserve' which is required for Next.js to properly handle JSX transformation.
Review summary:
- ✅ Migration from Vite to Next.js 16 App Router is well-structured
- ✅ Properly moved
src/main.jsxandsrc/App.jsxinto Next.js App Router structure - ✅ MantineProvider and ColorSchemeScript correctly wired through root layout
- ✅ Data fetching updated to use absolute path (
/data/google-ads.json) - ✅ CI workflow properly split into separate build/test/lint jobs
- ✅ Added
@policyengine/ui-kitwith proper theme.css loading - ✅ Tailwind v4 and PostCSS configuration looks correct
- ✅ Vitest config properly set up with Next.js path aliases
- ✅
vercel.jsoncorrectly specifies Next.js framework - ✅ All the React 19 + Mantine dependencies are properly configured
The two issues I fixed were blocking - the lint command would have failed with the invalid ESLint config, and the Next.js build could have had issues with the wrong JSX setting. With these fixes, the migration should be solid.
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
@policyengine/ui-kit^0.9.0; loadtheme.cssthrough globalssrc/main.jsx+src/App.jsxintoapp/layout.tsx+app/page.jsximport.meta.env.BASE_URLwith absolute path (/data/google-ads.json)bun install --frozen-lockfilethenbun run build/test/lint; Python jobs unchangedvercel.jsonfor nextjs frameworkTest plan
bun installbun run buildbun run test(12 tests pass)bun run lint(no errors)🤖 Generated with Claude Code