Skip to content

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

Merged
MaxGhenis merged 2 commits into
masterfrom
vite-to-next
May 9, 2026
Merged

Migrate from Vite to Next.js 16 App Router#2
MaxGhenis merged 2 commits into
masterfrom
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
  • Replace import.meta.env.BASE_URL with absolute path (/github-data.json)
  • Remove GitHub Pages deploy workflow; the Next.js build needs Vercel-style hosting
  • Switch refresh-data cron to bun
  • Bun with bun.lock checked in; CI runs bun install --frozen-lockfile then bun run build / bun run lint

Test plan

  • bun install
  • bun run build
  • bun run lint (only legacy unused-var and <img> warnings, 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
- Convert index.html metadata into root layout
- Replace import.meta.env.BASE_URL with absolute path for github-data.json
- Remove GitHub Pages deploy workflow (Next.js needs Vercel-style deployment)
- Switch refresh-data cron to oven-sh/setup-bun action
- Add PR workflow with bun frozen-lockfile build/lint

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@policyengine policyengine Bot added the ⚙️ Engineering... PolicyEngine's GitHub agent is working on this label May 9, 2026
- Change jsx compiler option from 'react-jsx' to 'preserve' for Next.js
- Fix stats grid from 5 columns to 6 to match actual stat count

🤖 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.

Solid migration from Vite to Next.js 16! The core functionality is well-preserved and the migration follows Next.js App Router best practices.

What I reviewed

  • Next.js App Router setup (layout.tsx, page.jsx in src/app/)
  • TypeScript configuration
  • Tailwind v4 integration with @policyengine/ui-kit
  • GitHub Actions workflows (PR checks with bun, refresh-data cron)
  • Data fetching pattern (client-side fetch from /github-data.json)

Issues found and fixed

I pushed two fixes to the PR branch:

  1. TypeScript JSX config: Changed jsx compiler option from "react-jsx" to "preserve" - Next.js requires this setting as it handles JSX transformation itself
  2. Stats grid layout: Fixed CSS grid from 5 columns to 6 to match the actual number of stats displayed (Commits, PRs Filed, PRs Merged, Reviews, Issues, Repos)

What looks good

  • Clean Next.js App Router structure with proper metadata API usage
  • Correct client component boundary ('use client' in page.jsx)
  • Proper path change from import.meta.env.BASE_URL to absolute /github-data.json
  • GitHub Actions workflows correctly updated for bun
  • Package.json scripts properly configured for Next.js
  • ESLint config using Next.js core-web-vitals preset
  • Tailwind v4 PostCSS setup is correct
  • Git ignore updated for Next.js (.next, out, next-env.d.ts)

Note on deployment

As mentioned in the PR description, this removes the GitHub Pages deploy workflow. You'll need to deploy to a Next.js-compatible platform (Vercel, etc.) since Next.js requires Node.js runtime for SSR/API routes.

@policyengine policyengine Bot removed the ⚙️ Engineering... PolicyEngine's GitHub agent is working on this label May 9, 2026
@MaxGhenis MaxGhenis merged commit a21c268 into master May 9, 2026
2 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