Skip to content

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

Merged
MaxGhenis merged 1 commit into
mainfrom
vite-to-next
May 9, 2026
Merged

Migrate from Vite to Next.js 16 App Router#1
MaxGhenis merged 1 commit into
mainfrom
vite-to-next

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • Migrate from Vite + React 18 to Next.js 16.2.6 + React 19.2 App Router
  • App router lives at /app (not src/app) to coexist with the Streamlit pages/ directory at the repo root — Next requires app/ and pages/ at the same depth
  • Tailwind 4 via @tailwindcss/postcss; load @policyengine/ui-kit ^0.9.0 theme tokens
  • Add stub data/households/cliff_demo.json + all_households.json so CI builds pass without first running precompute_cliff_household.py / precompute_households.py. Real data is still regenerated by those scripts; gitignore keeps the rest of data/ ignored.
  • Replace Vite-shaped vercel.json with the PolicyEngine-standard framework: nextjs config
  • Demote two new React 19 lint rules (set-state-in-effect, static-components) to warnings — they flag pre-existing patterns this migration should not rewrite
  • Replace deploy workflow with PolicyEngine PR pattern (build + lint via bun)
  • bun lockfile committed, npm lockfile removed

Test plan

  • bun install
  • bun run build — clean
  • bun run lint — 0 errors (6 warnings)
  • Run python precompute_cliff_household.py && python precompute_households.py to regenerate real data before deploying

- Replace Vite with Next.js 16.2.6 + React 19.2 App Router.
- Tailwind 4 via @tailwindcss/postcss; @policyengine/ui-kit ^0.9.0 theme tokens.
- App router lives at /app (not src/app) to coexist with the Streamlit
  pages/ directory at the repo root — Next requires app/ and pages/ at the
  same depth.
- Move metadata from index.html to app/layout.tsx; src/main.jsx → app/page.tsx
  with App rendered as a client-only dynamic import (recharts mounts
  client-side; data is fetched/displayed in the browser).
- Add 'use client' to every component using state/refs/effects.
- Native ESLint flat-config extending eslint-config-next; demote two new
  React 19 lint rules (set-state-in-effect, static-components) to warnings —
  they flag pre-existing patterns this migration should not rewrite.
- Add stub data/households/cliff_demo.json + all_households.json so the
  build passes in CI without the precompute pipeline (gitignore keeps the
  rest of data/ ignored). Real data is regenerated by
  precompute_cliff_household.py / precompute_households.py.
- Replace Vite vercel.json (build/output dir + Vite framework) with the
  PolicyEngine-standard `framework: nextjs` config.
- Replace deploy/build workflow with PolicyEngine PR pattern (build + lint
  via bun).
- bun lockfile committed; npm lockfile dropped.
@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)
acacalc Ready Ready Preview, Comment May 9, 2026 11:14pm

Request Review

@policyengine
Copy link
Copy Markdown

policyengine Bot commented May 9, 2026

Sorry @MaxGhenis, only members of the PolicyEngine/core-developers team can invoke Claude Code.

@MaxGhenis MaxGhenis merged commit 8065155 into main May 9, 2026
4 checks passed
@MaxGhenis MaxGhenis deleted the vite-to-next branch May 9, 2026 23:18
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