Migrate from Vite to Next.js 16 App Router#1
Merged
Merged
Conversation
- 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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Sorry @MaxGhenis, only members of the PolicyEngine/core-developers team can invoke Claude Code. |
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
/app(notsrc/app) to coexist with the Streamlitpages/directory at the repo root — Next requires app/ and pages/ at the same depth@tailwindcss/postcss; load@policyengine/ui-kit ^0.9.0theme tokensdata/households/cliff_demo.json+all_households.jsonso CI builds pass without first runningprecompute_cliff_household.py/precompute_households.py. Real data is still regenerated by those scripts; gitignore keeps the rest ofdata/ignored.vercel.jsonwith the PolicyEngine-standardframework: nextjsconfigset-state-in-effect,static-components) to warnings — they flag pre-existing patterns this migration should not rewriteTest plan
bun installbun run build— cleanbun run lint— 0 errors (6 warnings)python precompute_cliff_household.py && python precompute_households.pyto regenerate real data before deploying