Skip to content

Migrate from Vite to Next.js 16 App Router#2

Merged
MaxGhenis merged 3 commits into
mainfrom
vite-to-next
May 9, 2026
Merged

Migrate from Vite to Next.js 16 App Router#2
MaxGhenis merged 3 commits into
mainfrom
vite-to-next

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • Replace Vite + React 19 with Next.js 16 (App Router) + React 19 + Tailwind v4
  • Add @policyengine/ui-kit ^0.9.0; load theme.css through globals
  • Move src/main.jsx + src/App.jsx into app/layout.tsx + app/page.jsx
  • Wire MantineProvider + ColorSchemeScript through root layout
  • Replace import.meta.env.BASE_URL with absolute path (/data/google-ads.json)
  • CI runs bun install --frozen-lockfile then bun run build / test / lint; Python jobs unchanged
  • Add vercel.json for nextjs framework

Test plan

  • bun install
  • bun run build
  • bun run test (12 tests pass)
  • bun run lint (no errors)

🤖 Generated with Claude Code

- 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>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
policyengine-ads-dashboard Ready Ready Preview, Comment May 9, 2026 6:40pm

Request Review

@policyengine policyengine Bot added the ⚙️ Engineering... PolicyEngine's GitHub agent is working on this label May 9, 2026
PolicyEngine-Bot and others added 2 commits May 9, 2026 18:39
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>
Copy link
Copy Markdown

@policyengine policyengine Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work on the Vite to Next.js migration! I found and fixed two configuration issues:

Fixed:

  1. eslint.config.mjs - Removed invalid defineConfig and globalIgnores imports from 'eslint/config' that don't exist in the standard ESLint package. Converted to standard flat config array syntax.
  2. tsconfig.json - Changed jsx from '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.jsx and src/App.jsx into 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-kit with proper theme.css loading
  • ✅ Tailwind v4 and PostCSS configuration looks correct
  • ✅ Vitest config properly set up with Next.js path aliases
  • vercel.json correctly 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.

@policyengine policyengine Bot removed the ⚙️ Engineering... PolicyEngine's GitHub agent is working on this label May 9, 2026
@MaxGhenis MaxGhenis merged commit 5e47a44 into main May 9, 2026
6 checks passed
@MaxGhenis MaxGhenis deleted the vite-to-next branch May 9, 2026 18:46
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.

2 participants